"**_NOTE_** autosklearn only will run in linux (feb 26, 2022)\n",
"**_NOTE_** \n",
"\n",
"The module `autosklearn` will only run in Linux environments, such as Google Collab or Jupyter Hub. Attempting to run this notebook will fail if you are not in a Linux environment.\n",
"\n",
"\n",
"Example coming from [here](https://automl.github.io/auto-sklearn/master/examples/20_basic/example_classification.html#sphx-glr-examples-20-basic-example-classification-py)"
"Example coming from [here](https://automl.github.io/auto-sklearn/master/examples/20_basic/example_classification.html#sphx-glr-examples-20-basic-example-classification-py)"
]
]
},
},
{
"cell_type": "markdown",
"id": "c5dad4c0",
"metadata": {},
"source": [
"**Classification doesn't work with current version of scipy/github and requires different packages/updates to run notebook**\n",
"- Note from professor Colbry: Notebook can't be fixed in classtime, write note of what needs to be fixed and push to gitlab as is."
"\u001b[0;32m<ipython-input-11-6dfffdcd8374>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0;31m# Different Models run by autosklearn\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mautoml\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mleaderboard\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mNameError\u001b[0m: name 'automl' is not defined"
"\u001b[0;32m<ipython-input-12-ab76765f6a20>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0;31m# Show the different models\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mpprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mautoml\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mshow_models\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mindent\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m4\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mNameError\u001b[0m: name 'automl' is not defined"
"\u001b[0;32m<ipython-input-14-14e40d77d77d>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0;31m# Export the model with the highest rank\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mclf\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mautoml\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mshow_models\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m7\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'sklearn_classifier'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 3\u001b[0m \u001b[0mpickle\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdump\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mclf\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mopen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'model.pickle'\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m'wb'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mNameError\u001b[0m: name 'automl' is not defined"
"\u001b[0;32m<ipython-input-15-b9c89d294f77>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mclf\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mNameError\u001b[0m: name 'clf' is not defined"
]
}
],
"source": [
"source": [
"clf"
"clf"
]
]
...
@@ -261,7 +140,7 @@
...
@@ -261,7 +140,7 @@
],
],
"metadata": {
"metadata": {
"kernelspec": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"language": "python",
"name": "python3"
"name": "python3"
},
},
...
@@ -275,7 +154,7 @@
...
@@ -275,7 +154,7 @@
"name": "python",
"name": "python",
"nbconvert_exporter": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.9.12"
}
}
},
},
"nbformat": 4,
"nbformat": 4,
...
...
%% Cell type:markdown id:8459055e tags:
%% Cell type:markdown id:8459055e tags:
# Classification
# Classification
**_NOTE_** autosklearn only will run in linux (feb 26, 2022)
**_NOTE_**
Example coming from [here](https://automl.github.io/auto-sklearn/master/examples/20_basic/example_classification.html#sphx-glr-examples-20-basic-example-classification-py)
The module `autosklearn` will only run in Linux environments, such as Google Collab or Jupyter Hub. Attempting to run this notebook will fail if you are not in a Linux environment.
%% Cell type:markdown id:c5dad4c0 tags:
**Classification doesn't work with current version of scipy/github and requires different packages/updates to run notebook**
Example coming from [here](https://automl.github.io/auto-sklearn/master/examples/20_basic/example_classification.html#sphx-glr-examples-20-basic-example-classification-py)
- Note from professor Colbry: Notebook can't be fixed in classtime, write note of what needs to be fixed and push to gitlab as is.
%% Cell type:code id:c69433ce tags:
%% Cell type:code id:c69433ce tags:
``` python
``` python
# import
fromsklearn.model_selectionimporttrain_test_split
fromsklearn.model_selectionimporttrain_test_split
fromsklearn.metricsimportaccuracy_score
fromsklearn.metricsimportaccuracy_score
fromsklearn.datasetsimportfetch_openml
fromsklearn.datasetsimportfetch_openml
importautosklearn.classification
importpandasaspd
importpandasaspd
importsklearn.datasets
importsklearn.datasets
importsklearn.metrics
importsklearn.metrics
# Fixed import model_selection
importsklearn.model_selection
importsklearn.model_selection
importpickle
importpickle
importautosklearn.classification#cannot import classification from autosklearn