Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zwleisa patch #632

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions 04_training_linear_models.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1381,8 +1381,8 @@
"X_val_poly_scaled = poly_scaler.transform(X_val)\n",
"\n",
"sgd_reg = SGDRegressor(max_iter=1, tol=-np.infty, warm_start=True,\n",
" penalty=None, learning_rate=\"constant\", eta0=0.0005, random_state=42)\n",
"\n",
" penalty=None, learning_rate=\"constant\", eta0=0.0005, random_state=42)\n",
"\n",
"minimum_val_error = float(\"inf\")\n",
"best_epoch = None\n",
"best_model = None\n",
Expand Down Expand Up @@ -1429,8 +1429,8 @@
}
],
"source": [
"sgd_reg = SGDRegressor(max_iter=1, tol=-np.infty, warm_start=True,\n",
" penalty=None, learning_rate=\"constant\", eta0=0.0005, random_state=42)\n",
"sgd_reg = SGDRegressor(max_iter=1, tol=None, warm_start=True,\n",
" penalty=None, learning_rate=\"constant\", eta0=0.0005, random_state=42)\n",
"\n",
"n_epochs = 500\n",
"train_errors, val_errors = [], []\n",
Expand Down Expand Up @@ -1773,7 +1773,7 @@
"outputs": [],
"source": [
"X = iris[\"data\"][:, 3:] # petal width\n",
"y = (iris[\"target\"] == 2).astype(np.int) # 1 if Iris virginica, else 0"
"y = (iris[\"target\"] == 2).astype(np.int32) # 1 if Iris virginica, else 0"
]
},
{
Expand Down Expand Up @@ -1876,7 +1876,7 @@
"source": [
"X_new = np.linspace(0, 3, 1000).reshape(-1, 1)\n",
"y_proba = log_reg.predict_proba(X_new)\n",
"decision_boundary = X_new[y_proba[:, 1] >= 0.5][0]\n",
"decision_boundary = X_new[y_proba[:, 1] >= 0.5][0,0]\n",
"\n",
"plt.figure(figsize=(8, 3))\n",
"plt.plot(X[y==0], y[y==0], \"bs\")\n",
Expand Down
2 changes: 1 addition & 1 deletion 05_support_vector_machines.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
"y = y[setosa_or_versicolor]\n",
"\n",
"# SVM Classifier model\n",
"svm_clf = SVC(kernel=\"linear\", C=float(\"inf\"))\n",
"svm_clf = SVC(kernel=\"linear\", C=float(10e10))\n",
"svm_clf.fit(X, y)"
]
},
Expand Down
2 changes: 1 addition & 1 deletion 10_neural_nets_with_keras.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
"\n",
"iris = load_iris()\n",
"X = iris.data[:, (2, 3)] # petal length, petal width\n",
"y = (iris.target == 0).astype(np.int)\n",
"y = (iris.target == 0).astype(np.int32)\n",
"\n",
"per_clf = Perceptron(max_iter=1000, tol=1e-3, random_state=42)\n",
"per_clf.fit(X, y)\n",
Expand Down