Skip to content

Instantly share code, notes, and snippets.

@Neeratyoy
Created October 25, 2019 16:33
Show Gist options
  • Save Neeratyoy/cdf7b9ca8ba6f435980b5e144e794db4 to your computer and use it in GitHub Desktop.
Save Neeratyoy/cdf7b9ca8ba6f435980b5e144e794db4 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>run_id</th>\n",
" <th>task_id</th>\n",
" <th>setup_id</th>\n",
" <th>flow_id</th>\n",
" <th>flow_name</th>\n",
" <th>data_id</th>\n",
" <th>data_name</th>\n",
" <th>function</th>\n",
" <th>upload_time</th>\n",
" <th>uploader</th>\n",
" <th>uploader_name</th>\n",
" <th>value</th>\n",
" <th>values</th>\n",
" <th>array_data</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>3626</th>\n",
" <td>2012941</td>\n",
" <td>59</td>\n",
" <td>157624</td>\n",
" <td>6048</td>\n",
" <td>sklearn.pipeline.Pipeline(dualimputer=helper.d...</td>\n",
" <td>61</td>\n",
" <td>iris</td>\n",
" <td>predictive_accuracy</td>\n",
" <td>2017-04-07 01:36:00</td>\n",
" <td>1104</td>\n",
" <td>[email protected]</td>\n",
" <td>0.986667</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3618</th>\n",
" <td>2012930</td>\n",
" <td>59</td>\n",
" <td>157613</td>\n",
" <td>6048</td>\n",
" <td>sklearn.pipeline.Pipeline(dualimputer=helper.d...</td>\n",
" <td>61</td>\n",
" <td>iris</td>\n",
" <td>predictive_accuracy</td>\n",
" <td>2017-04-06 23:00:24</td>\n",
" <td>1104</td>\n",
" <td>[email protected]</td>\n",
" <td>0.986667</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3633</th>\n",
" <td>2083536</td>\n",
" <td>59</td>\n",
" <td>217067</td>\n",
" <td>6049</td>\n",
" <td>sklearn.svm.classes.NuSVC(1)</td>\n",
" <td>61</td>\n",
" <td>iris</td>\n",
" <td>predictive_accuracy</td>\n",
" <td>2017-04-23 01:13:21</td>\n",
" <td>1104</td>\n",
" <td>[email protected]</td>\n",
" <td>0.986667</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3631</th>\n",
" <td>2039750</td>\n",
" <td>59</td>\n",
" <td>180924</td>\n",
" <td>6048</td>\n",
" <td>sklearn.pipeline.Pipeline(dualimputer=helper.d...</td>\n",
" <td>61</td>\n",
" <td>iris</td>\n",
" <td>predictive_accuracy</td>\n",
" <td>2017-04-09 01:17:39</td>\n",
" <td>1104</td>\n",
" <td>[email protected]</td>\n",
" <td>0.986667</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3630</th>\n",
" <td>2039748</td>\n",
" <td>59</td>\n",
" <td>180922</td>\n",
" <td>6048</td>\n",
" <td>sklearn.pipeline.Pipeline(dualimputer=helper.d...</td>\n",
" <td>61</td>\n",
" <td>iris</td>\n",
" <td>predictive_accuracy</td>\n",
" <td>2017-04-09 01:09:01</td>\n",
" <td>1104</td>\n",
" <td>[email protected]</td>\n",
" <td>0.986667</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" run_id task_id setup_id flow_id \\\n",
"3626 2012941 59 157624 6048 \n",
"3618 2012930 59 157613 6048 \n",
"3633 2083536 59 217067 6049 \n",
"3631 2039750 59 180924 6048 \n",
"3630 2039748 59 180922 6048 \n",
"\n",
" flow_name data_id data_name \\\n",
"3626 sklearn.pipeline.Pipeline(dualimputer=helper.d... 61 iris \n",
"3618 sklearn.pipeline.Pipeline(dualimputer=helper.d... 61 iris \n",
"3633 sklearn.svm.classes.NuSVC(1) 61 iris \n",
"3631 sklearn.pipeline.Pipeline(dualimputer=helper.d... 61 iris \n",
"3630 sklearn.pipeline.Pipeline(dualimputer=helper.d... 61 iris \n",
"\n",
" function upload_time uploader uploader_name \\\n",
"3626 predictive_accuracy 2017-04-07 01:36:00 1104 [email protected] \n",
"3618 predictive_accuracy 2017-04-06 23:00:24 1104 [email protected] \n",
"3633 predictive_accuracy 2017-04-23 01:13:21 1104 [email protected] \n",
"3631 predictive_accuracy 2017-04-09 01:17:39 1104 [email protected] \n",
"3630 predictive_accuracy 2017-04-09 01:09:01 1104 [email protected] \n",
"\n",
" value values array_data \n",
"3626 0.986667 None None \n",
"3618 0.986667 None None \n",
"3633 0.986667 None None \n",
"3631 0.986667 None None \n",
"3630 0.986667 None None "
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Fetching top performances\n",
"task_df.sort_values(by='value', ascending=False).head()"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"OpenML Flow\n",
"===========\n",
"Flow ID.........: 6048 (version 1)\n",
"Flow URL........: https://www.openml.org/f/6048\n",
"Flow Name.......: sklearn.pipeline.Pipeline(dualimputer=helper.dual_imputer.DualImputer,nusvc=sklearn.svm.classes.NuSVC)\n",
"Flow Description: Automatically created scikit-learn flow.\n",
"Upload Date.....: 2017-04-06 22:42:59\n",
"Dependencies....: sklearn==0.18.1\n",
"numpy>=1.6.1\n",
"scipy>=0.9"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Fetching best performing flow\n",
"f = openml.flows.get_flow(6048)\n",
"f"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"steps : [('DualImputer', <helper.dual_imputer.DualImputer object at 0x7ff618e4d908>), ('nusvc', NuSVC(cache_size=200, class_weight=None, coef0=0.0,\n",
" decision_function_shape=None, degree=3, gamma='auto', kernel='linear',\n",
" max_iter=-1, nu=0.3, probability=True, random_state=3, shrinking=True,\n",
" tol=3.2419092644286417e-05, verbose=False))]\n",
"cache_size : 200 \n",
"class_weight : None \n",
"coef0 : 0.0 \n",
"decision_function_shape : None \n",
"degree : 3 \n",
"gamma : auto \n",
"kernel : linear \n",
"max_iter : -1 \n",
"nu : 0.3 \n",
"probability : True \n",
"random_state : 3 \n",
"shrinking : True \n",
"tol : 3.24190926443e-05\n",
"verbose : False \n"
]
}
],
"source": [
"# Fetching best performing run\n",
"r = openml.runs.get_run(2012943)\n",
"\n",
"# The model parameters\n",
"for param in r.parameter_settings:\n",
" name, value = param['oml:name'], param['oml:value']\n",
" print(\"{:<25} : {:<10}\".format(name, value))"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment