Skip to content

Commit

Permalink
hnishi: Doc: Fix variable name in example (#1200)
Browse files Browse the repository at this point in the history
  • Loading branch information
Github Actions committed Aug 4, 2021
1 parent 58fd8be commit 7fa7fdc
Show file tree
Hide file tree
Showing 70 changed files with 807 additions and 737 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@


def get_runhistory_models_performance(automl):
metric = cls.automl_._metric
metric = automl.automl_._metric
data = automl.automl_.runhistory_.data
performance_list = []
for run_key, run_value in data.items():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
"outputs": [],
"source": [
"import time\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport sklearn.model_selection\nimport sklearn.datasets\nimport sklearn.metrics\n\nfrom smac.tae import StatusType\n\nimport autosklearn.classification\n\n\ndef get_runhistory_models_performance(automl):\n metric = cls.automl_._metric\n data = automl.automl_.runhistory_.data\n performance_list = []\n for run_key, run_value in data.items():\n if run_value.status != StatusType.SUCCESS:\n # Ignore crashed runs\n continue\n # Alternatively, it is possible to also obtain the start time with ``run_value.starttime``\n endtime = pd.Timestamp(time.strftime('%Y-%m-%d %H:%M:%S',\n time.localtime(run_value.endtime)))\n val_score = metric._optimum - (metric._sign * run_value.cost)\n test_score = metric._optimum - (metric._sign * run_value.additional_info['test_loss'])\n train_score = metric._optimum - (metric._sign * run_value.additional_info['train_loss'])\n performance_list.append({\n 'Timestamp': endtime,\n 'single_best_optimization_score': val_score,\n 'single_best_test_score': test_score,\n 'single_best_train_score': train_score,\n })\n return pd.DataFrame(performance_list)"
"import time\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport sklearn.model_selection\nimport sklearn.datasets\nimport sklearn.metrics\n\nfrom smac.tae import StatusType\n\nimport autosklearn.classification\n\n\ndef get_runhistory_models_performance(automl):\n metric = automl.automl_._metric\n data = automl.automl_.runhistory_.data\n performance_list = []\n for run_key, run_value in data.items():\n if run_value.status != StatusType.SUCCESS:\n # Ignore crashed runs\n continue\n # Alternatively, it is possible to also obtain the start time with ``run_value.starttime``\n endtime = pd.Timestamp(time.strftime('%Y-%m-%d %H:%M:%S',\n time.localtime(run_value.endtime)))\n val_score = metric._optimum - (metric._sign * run_value.cost)\n test_score = metric._optimum - (metric._sign * run_value.additional_info['test_loss'])\n train_score = metric._optimum - (metric._sign * run_value.additional_info['train_loss'])\n performance_list.append({\n 'Timestamp': endtime,\n 'single_best_optimization_score': val_score,\n 'single_best_test_score': test_score,\n 'single_best_train_score': train_score,\n })\n return pd.DataFrame(performance_list)"
]
},
{
Expand Down
Binary file not shown.
Binary file not shown.
Binary file modified development/_images/sphx_glr_example_inspect_predictions_001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified development/_images/sphx_glr_example_inspect_predictions_002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified development/_images/sphx_glr_example_inspect_predictions_003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified development/_images/sphx_glr_example_inspect_predictions_thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified development/_images/sphx_glr_example_pandas_train_test_001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified development/_images/sphx_glr_example_pandas_train_test_thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
110 changes: 55 additions & 55 deletions development/_sources/examples/20_basic/example_classification.rst.txt

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ View the models found by auto-sklearn
rank ensemble_weight type cost duration
model_id
2 1 1.0 random_forest 0.44715 4.491632
2 1 1.0 random_forest 0.44715 4.304053
Expand Down Expand Up @@ -265,7 +265,7 @@ Get the Score of the final ensemble
.. rst-class:: sphx-glr-timing

**Total running time of the script:** ( 0 minutes 14.411 seconds)
**Total running time of the script:** ( 0 minutes 14.648 seconds)


.. _sphx_glr_download_examples_20_basic_example_multilabel_classification.py:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,9 @@ View the models found by auto-sklearn

.. code-block:: none
rank ensemble_weight type cost duration
model_id
17 1 0.7 extra_trees 0.077008 10.480845
21 2 0.3 extra_trees 0.086712 2.570516
rank ensemble_weight type cost duration
model_id
14 1 1.0 gaussian_process 0.000041 4.039571
Expand All @@ -152,14 +151,7 @@ Print the final ensemble constructed by auto-sklearn

.. code-block:: none
[(0.700000, SimpleRegressionPipeline({'data_preprocessor:__choice__': 'feature_type', 'feature_preprocessor:__choice__': 'extra_trees_preproc_for_regression', 'regressor:__choice__': 'extra_trees', 'data_preprocessor:feature_type:categorical_transformer:categorical_encoding:__choice__': 'no_encoding', 'data_preprocessor:feature_type:categorical_transformer:category_coalescence:__choice__': 'minority_coalescer', 'data_preprocessor:feature_type:numerical_transformer:imputation:strategy': 'mean', 'data_preprocessor:feature_type:numerical_transformer:rescaling:__choice__': 'quantile_transformer', 'feature_preprocessor:extra_trees_preproc_for_regression:bootstrap': 'False', 'feature_preprocessor:extra_trees_preproc_for_regression:criterion': 'mae', 'feature_preprocessor:extra_trees_preproc_for_regression:max_depth': 'None', 'feature_preprocessor:extra_trees_preproc_for_regression:max_features': 0.7605634701105549, 'feature_preprocessor:extra_trees_preproc_for_regression:max_leaf_nodes': 'None', 'feature_preprocessor:extra_trees_preproc_for_regression:min_samples_leaf': 13, 'feature_preprocessor:extra_trees_preproc_for_regression:min_samples_split': 2, 'feature_preprocessor:extra_trees_preproc_for_regression:min_weight_fraction_leaf': 0.0, 'feature_preprocessor:extra_trees_preproc_for_regression:n_estimators': 100, 'regressor:extra_trees:bootstrap': 'False', 'regressor:extra_trees:criterion': 'mae', 'regressor:extra_trees:max_depth': 'None', 'regressor:extra_trees:max_features': 0.9315905211305524, 'regressor:extra_trees:max_leaf_nodes': 'None', 'regressor:extra_trees:min_impurity_decrease': 0.0, 'regressor:extra_trees:min_samples_leaf': 1, 'regressor:extra_trees:min_samples_split': 2, 'regressor:extra_trees:min_weight_fraction_leaf': 0.0, 'data_preprocessor:feature_type:categorical_transformer:category_coalescence:minority_coalescer:minimum_fraction': 0.002878753280772165, 'data_preprocessor:feature_type:numerical_transformer:rescaling:quantile_transformer:n_quantiles': 1661, 'data_preprocessor:feature_type:numerical_transformer:rescaling:quantile_transformer:output_distribution': 'normal'},
dataset_properties={
'task': 5,
'sparse': False,
'multioutput': True,
'target_type': 'regression',
'signed': False})),
(0.300000, SimpleRegressionPipeline({'data_preprocessor:__choice__': 'feature_type', 'feature_preprocessor:__choice__': 'polynomial', 'regressor:__choice__': 'extra_trees', 'data_preprocessor:feature_type:categorical_transformer:categorical_encoding:__choice__': 'no_encoding', 'data_preprocessor:feature_type:categorical_transformer:category_coalescence:__choice__': 'no_coalescense', 'data_preprocessor:feature_type:numerical_transformer:imputation:strategy': 'median', 'data_preprocessor:feature_type:numerical_transformer:rescaling:__choice__': 'quantile_transformer', 'feature_preprocessor:polynomial:degree': 2, 'feature_preprocessor:polynomial:include_bias': 'True', 'feature_preprocessor:polynomial:interaction_only': 'True', 'regressor:extra_trees:bootstrap': 'False', 'regressor:extra_trees:criterion': 'mse', 'regressor:extra_trees:max_depth': 'None', 'regressor:extra_trees:max_features': 0.9000068627721328, 'regressor:extra_trees:max_leaf_nodes': 'None', 'regressor:extra_trees:min_impurity_decrease': 0.0, 'regressor:extra_trees:min_samples_leaf': 3, 'regressor:extra_trees:min_samples_split': 2, 'regressor:extra_trees:min_weight_fraction_leaf': 0.0, 'data_preprocessor:feature_type:numerical_transformer:rescaling:quantile_transformer:n_quantiles': 365, 'data_preprocessor:feature_type:numerical_transformer:rescaling:quantile_transformer:output_distribution': 'uniform'},
[(1.000000, SimpleRegressionPipeline({'data_preprocessor:__choice__': 'feature_type', 'feature_preprocessor:__choice__': 'feature_agglomeration', 'regressor:__choice__': 'gaussian_process', 'data_preprocessor:feature_type:categorical_transformer:categorical_encoding:__choice__': 'no_encoding', 'data_preprocessor:feature_type:categorical_transformer:category_coalescence:__choice__': 'no_coalescense', 'data_preprocessor:feature_type:numerical_transformer:imputation:strategy': 'median', 'data_preprocessor:feature_type:numerical_transformer:rescaling:__choice__': 'power_transformer', 'feature_preprocessor:feature_agglomeration:affinity': 'manhattan', 'feature_preprocessor:feature_agglomeration:linkage': 'average', 'feature_preprocessor:feature_agglomeration:n_clusters': 365, 'feature_preprocessor:feature_agglomeration:pooling_func': 'mean', 'regressor:gaussian_process:alpha': 0.0001892420474677165, 'regressor:gaussian_process:thetaL': 1.7549152191973897e-09, 'regressor:gaussian_process:thetaU': 2227.384462976473},
dataset_properties={
'task': 5,
'sparse': False,
Expand Down Expand Up @@ -194,7 +186,7 @@ Get the Score of the final ensemble

.. code-block:: none
R2 score: 0.9237314051823002
R2 score: 0.9999535658893771
Expand Down Expand Up @@ -417,7 +409,7 @@ Get the configuration space
.. rst-class:: sphx-glr-timing

**Total running time of the script:** ( 2 minutes 4.849 seconds)
**Total running time of the script:** ( 1 minutes 57.411 seconds)


.. _sphx_glr_download_examples_20_basic_example_multioutput_regression.py:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ View the models found by auto-sklearn
rank ensemble_weight type cost duration
model_id
31 1 0.42 ard_regression 0.449401 0.894925
6 2 0.34 ard_regression 0.455042 0.885143
5 3 0.02 gaussian_process 0.455084 24.584934
25 4 0.16 sgd 0.460012 0.844743
22 5 0.06 libsvm_svr 0.461373 0.863893
31 1 0.42 ard_regression 0.449401 0.803644
6 2 0.34 ard_regression 0.455042 0.810605
5 3 0.02 gaussian_process 0.455084 22.746987
25 4 0.16 sgd 0.460012 0.789462
22 5 0.06 libsvm_svr 0.461373 0.812813
Expand Down Expand Up @@ -266,7 +266,7 @@ the true value).

.. rst-class:: sphx-glr-timing

**Total running time of the script:** ( 2 minutes 7.209 seconds)
**Total running time of the script:** ( 2 minutes 1.622 seconds)


.. _sphx_glr_download_examples_20_basic_example_regression.py:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

Computation times
=================
**06:25.822** total execution time for **examples_20_basic** files:
**06:16.033** total execution time for **examples_20_basic** files:

+-------------------------------------------------------------------------------------------------------------------+-----------+--------+
| :ref:`sphx_glr_examples_20_basic_example_regression.py` (``example_regression.py``) | 02:07.209 | 0.0 MB |
| :ref:`sphx_glr_examples_20_basic_example_classification.py` (``example_classification.py``) | 02:02.351 | 0.0 MB |
+-------------------------------------------------------------------------------------------------------------------+-----------+--------+
| :ref:`sphx_glr_examples_20_basic_example_multioutput_regression.py` (``example_multioutput_regression.py``) | 02:04.849 | 0.0 MB |
| :ref:`sphx_glr_examples_20_basic_example_regression.py` (``example_regression.py``) | 02:01.622 | 0.0 MB |
+-------------------------------------------------------------------------------------------------------------------+-----------+--------+
| :ref:`sphx_glr_examples_20_basic_example_classification.py` (``example_classification.py``) | 01:59.353 | 0.0 MB |
| :ref:`sphx_glr_examples_20_basic_example_multioutput_regression.py` (``example_multioutput_regression.py``) | 01:57.411 | 0.0 MB |
+-------------------------------------------------------------------------------------------------------------------+-----------+--------+
| :ref:`sphx_glr_examples_20_basic_example_multilabel_classification.py` (``example_multilabel_classification.py``) | 00:14.411 | 0.0 MB |
| :ref:`sphx_glr_examples_20_basic_example_multilabel_classification.py` (``example_multilabel_classification.py``) | 00:14.648 | 0.0 MB |
+-------------------------------------------------------------------------------------------------------------------+-----------+--------+
Loading

0 comments on commit 7fa7fdc

Please sign in to comment.