Skip to content

Commit

Permalink
kosmeticka uprava
Browse files Browse the repository at this point in the history
  • Loading branch information
PetraVidnerova committed Nov 10, 2024
1 parent 79800dd commit 174a67b
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions lessons/pydata/homework_revisited/index.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -948,14 +948,9 @@
"outputs": [],
"source": [
"is_bream = X_real_test[\"Species\"] == \"Bream\"\n",
"bream = X_real_test[is_bream][\"Length3\"]\n",
"\n",
"bream_weights = y_real_test[is_bream]\n",
"predicted_bream_weights = best_model.predict(X_real_test_scaled[is_bream])\n",
"\n",
"is_roach = X_real_test[\"Species\"] == \"Roach\"\n",
"roach = X_real_test[is_roach][\"Length3\"]\n",
"roach_weights = y_real_test[is_roach]\n",
"predicted_roach_weights = best_model.predict(X_real_test_scaled[is_roach])"
]
},
Expand All @@ -966,14 +961,14 @@
"outputs": [],
"source": [
"result_bream = pd.DataFrame()\n",
"result_bream[\"length\"] = bream\n",
"result_bream[\"weight\"] = bream_weights\n",
"result_bream[\"length\"] = X_real_test[is_bream][\"Length3\"]\n",
"result_bream[\"weight\"] = y_real_test[is_bream]\n",
"result_bream[\"predicted\"] = predicted_bream_weights\n",
"result_bream = result_bream.sort_values(\"length\")\n",
"\n",
"result_roach = pd.DataFrame()\n",
"result_roach[\"length\"] = roach\n",
"result_roach[\"weight\"] = roach_weights\n",
"result_roach[\"length\"] = X_real_test[is_roach][\"Length3\"]\n",
"result_roach[\"weight\"] = y_real_test[is_roach]\n",
"result_roach[\"predicted\"] = predicted_roach_weights\n",
"result_roach = result_roach.sort_values(\"length\")"
]
Expand Down

0 comments on commit 174a67b

Please sign in to comment.