Replace float('inf') with large value 1e100 since inf now causes an error

main
Aurélien Geron 2023-11-14 11:55:40 +13:00
parent 8fce779633
commit e31ce8a44c
1 changed files with 3 additions and 3 deletions

View File

@ -170,7 +170,7 @@
"y = y[setosa_or_versicolor]\n", "y = y[setosa_or_versicolor]\n",
"\n", "\n",
"# SVM Classifier model\n", "# SVM Classifier model\n",
"svm_clf = SVC(kernel=\"linear\", C=float(\"inf\"))\n", "svm_clf = SVC(kernel=\"linear\", C=1e100)\n",
"svm_clf.fit(X, y)\n", "svm_clf.fit(X, y)\n",
"\n", "\n",
"# Bad models\n", "# Bad models\n",
@ -2580,7 +2580,7 @@
], ],
"metadata": { "metadata": {
"kernelspec": { "kernelspec": {
"display_name": "Python 3", "display_name": "Python 3 (ipykernel)",
"language": "python", "language": "python",
"name": "python3" "name": "python3"
}, },
@ -2594,7 +2594,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.10.6" "version": "3.10.13"
}, },
"nav_menu": {}, "nav_menu": {},
"toc": { "toc": {