Skip to content

Commit

Permalink
Merge pull request #26 from AutoResearch/25-fix-tutorial
Browse files Browse the repository at this point in the history
correct return value in tutorial
  • Loading branch information
younesStrittmatter authored Jul 26, 2024
2 parents cc0388d + 82b3a85 commit d1931c5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 22 deletions.
43 changes: 22 additions & 21 deletions docs/Basic Usage.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -24,7 +24,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 6,
"metadata": {
"collapsed": false,
"pycharm": {
Expand All @@ -48,7 +48,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 7,
"metadata": {
"collapsed": false
},
Expand All @@ -68,7 +68,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 8,
"metadata": {
"collapsed": false
},
Expand All @@ -88,7 +88,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 9,
"metadata": {
"collapsed": false
},
Expand All @@ -108,7 +108,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 10,
"metadata": {
"collapsed": false
},
Expand All @@ -117,8 +117,9 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[[10]\n",
" [ 9]]\n"
" 0\n",
"9 10\n",
"8 9\n"
]
}
],
Expand All @@ -145,7 +146,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 11,
"metadata": {
"collapsed": false
},
Expand All @@ -166,7 +167,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 12,
"metadata": {
"collapsed": false
},
Expand All @@ -175,7 +176,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[[10 11 12]]\n"
" 0 1 2\n",
"3 10 11 12\n"
]
}
],
Expand All @@ -195,7 +197,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 13,
"metadata": {
"collapsed": false
},
Expand All @@ -204,16 +206,15 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[[10 11 12]\n",
" [ 7 8 9]]\n",
"[1.35401943 0.43928867]\n"
" 0 1 2 score\n",
"3 10 11 12 1.354019\n",
"2 7 8 9 0.439289\n"
]
}
],
"source": [
"X_sampled, scores = novelty_score_sample(conditions = X_prime, reference_conditions = X, num_samples = 2, metric = \"euclidean\", integration = \"sum\")\n",
"print(X_sampled)\n",
"print(scores)"
"X_sampled = novelty_score_sample(conditions = X_prime, reference_conditions = X, num_samples = 2, metric = \"euclidean\", integration = \"sum\")\n",
"print(X_sampled)"
]
},
{
Expand All @@ -235,14 +236,14 @@
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
"pygments_lexer": "ipython3",
"version": "3.10.13"
}
},
"nbformat": 4,
Expand Down
4 changes: 3 additions & 1 deletion src/autora/experimentalist/novelty/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ def sample(
new_conditions.drop("score", axis=1, inplace=True)

if isinstance(condition_pool_copy, pd.DataFrame):
new_conditions = pd.DataFrame(new_conditions, columns=condition_pool_copy.columns)
new_conditions = pd.DataFrame(
new_conditions, columns=condition_pool_copy.columns
)

return new_conditions

Expand Down

0 comments on commit d1931c5

Please sign in to comment.