Skip to content

Commit

Permalink
Eddie Bergman: Clearup warnings (#1238)
Browse files Browse the repository at this point in the history
  • Loading branch information
Github Actions committed Dec 1, 2021
1 parent 3af0c5f commit e3bb62b
Show file tree
Hide file tree
Showing 70 changed files with 573 additions and 520 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
},
"outputs": [],
"source": [
"# Using reuters multilabel dataset -- https://www.openml.org/d/40594\nX, y = sklearn.datasets.fetch_openml(data_id=40594, return_X_y=True, as_frame=False)\n\n# fetch openml downloads a numpy array with TRUE/FALSE strings. Re-map it to\n# integer dtype with ones and zeros\n# This is to comply with Scikit-learn requirement:\n# \"Positive classes are indicated with 1 and negative classes with 0 or -1.\"\n# More information on: https://scikit-learn.org/stable/modules/multiclass.html\ny[y == 'TRUE'] = 1\ny[y == 'FALSE'] = 0\ny = y.astype(np.int)\n\n# Using type of target is a good way to make sure your data\n# is properly formatted\nprint(f\"type_of_target={type_of_target(y)}\")\n\nX_train, X_test, y_train, y_test = sklearn.model_selection.train_test_split(\n X, y, random_state=1\n)"
"# Using reuters multilabel dataset -- https://www.openml.org/d/40594\nX, y = sklearn.datasets.fetch_openml(data_id=40594, return_X_y=True, as_frame=False)\n\n# fetch openml downloads a numpy array with TRUE/FALSE strings. Re-map it to\n# integer dtype with ones and zeros\n# This is to comply with Scikit-learn requirement:\n# \"Positive classes are indicated with 1 and negative classes with 0 or -1.\"\n# More information on: https://scikit-learn.org/stable/modules/multiclass.html\ny[y == 'TRUE'] = 1\ny[y == 'FALSE'] = 0\ny = y.astype(int)\n\n# Using type of target is a good way to make sure your data\n# is properly formatted\nprint(f\"type_of_target={type_of_target(y)}\")\n\nX_train, X_test, y_train, y_test = sklearn.model_selection.train_test_split(\n X, y, random_state=1\n)"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# More information on: https://scikit-learn.org/stable/modules/multiclass.html
y[y == 'TRUE'] = 1
y[y == 'FALSE'] = 0
y = y.astype(np.int)
y = y.astype(int)

# Using type of target is a good way to make sure your data
# is properly formatted
Expand Down
Binary file not shown.
Binary file not shown.
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.
4 changes: 2 additions & 2 deletions development/_modules/autosklearn/estimators.html
Original file line number Diff line number Diff line change
Expand Up @@ -346,13 +346,13 @@ <h1>Source code for autosklearn.estimators</h1><div class="highlight"><pre>
<span class="sd"> Attributes</span>
<span class="sd"> ----------</span>

<span class="sd"> cv_results\_ : dict of numpy (masked) ndarrays</span>
<span class="sd"> cv_results_ : dict of numpy (masked) ndarrays</span>
<span class="sd"> A dict with keys as column headers and values as columns, that can be</span>
<span class="sd"> imported into a pandas ``DataFrame``.</span>

<span class="sd"> Not all keys returned by scikit-learn are supported yet.</span>

<span class="sd"> performance_over_time\_ : pandas.core.frame.DataFrame</span>
<span class="sd"> performance_over_time_ : pandas.core.frame.DataFrame</span>
<span class="sd"> A ``DataFrame`` containing the models performance over time data. Can be</span>
<span class="sd"> used for plotting directly. Please refer to the example</span>
<span class="sd"> :ref:`Train and Test Inputs &lt;sphx_glr_examples_40_advanced_example_pandas_train_test.py&gt;`.</span>
Expand Down
81 changes: 50 additions & 31 deletions development/_modules/autosklearn/metrics.html

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions development/_modules/autosklearn/pipeline/components/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,16 @@ <h1>Source code for autosklearn.pipeline.components.base</h1><div class="highlig


<span class="k">class</span> <span class="nc">IterativeComponent</span><span class="p">(</span><span class="n">AutoSklearnComponent</span><span class="p">):</span>

<span class="k">def</span> <span class="nf">fit</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">X</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">sample_weight</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">iterative_fit</span><span class="p">(</span><span class="n">X</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">n_iter</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">refit</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>

<span class="n">iteration</span> <span class="o">=</span> <span class="mi">2</span>
<span class="k">while</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">configuration_fully_fitted</span><span class="p">():</span>
<span class="n">n_iter</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="mi">2</span> <span class="o">**</span> <span class="n">iteration</span> <span class="o">/</span> <span class="mi">2</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">iterative_fit</span><span class="p">(</span><span class="n">X</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">n_iter</span><span class="o">=</span><span class="n">n_iter</span><span class="p">,</span> <span class="n">refit</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="n">iteration</span> <span class="o">+=</span> <span class="mi">1</span>

<span class="k">return</span> <span class="bp">self</span>

<span class="nd">@staticmethod</span>
Expand All @@ -277,15 +280,16 @@ <h1>Source code for autosklearn.pipeline.components.base</h1><div class="highlig


<span class="k">class</span> <span class="nc">IterativeComponentWithSampleWeight</span><span class="p">(</span><span class="n">AutoSklearnComponent</span><span class="p">):</span>

<span class="k">def</span> <span class="nf">fit</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">X</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">sample_weight</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">iterative_fit</span><span class="p">(</span>
<span class="n">X</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">n_iter</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">refit</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">sample_weight</span><span class="o">=</span><span class="n">sample_weight</span>
<span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">iterative_fit</span><span class="p">(</span><span class="n">X</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">n_iter</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">refit</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">sample_weight</span><span class="o">=</span><span class="n">sample_weight</span><span class="p">)</span>

<span class="n">iteration</span> <span class="o">=</span> <span class="mi">2</span>
<span class="k">while</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">configuration_fully_fitted</span><span class="p">():</span>
<span class="n">n_iter</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="mi">2</span> <span class="o">**</span> <span class="n">iteration</span> <span class="o">/</span> <span class="mi">2</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">iterative_fit</span><span class="p">(</span><span class="n">X</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">n_iter</span><span class="o">=</span><span class="n">n_iter</span><span class="p">,</span> <span class="n">sample_weight</span><span class="o">=</span><span class="n">sample_weight</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">iterative_fit</span><span class="p">(</span><span class="n">X</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">n_iter</span><span class="o">=</span><span class="n">n_iter</span><span class="p">,</span> <span class="n">refit</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">sample_weight</span><span class="o">=</span><span class="n">sample_weight</span><span class="p">)</span>
<span class="n">iteration</span> <span class="o">+=</span> <span class="mi">1</span>

<span class="k">return</span> <span class="bp">self</span>

<span class="nd">@staticmethod</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,25 +120,25 @@ View the models found by auto-sklearn
rank ensemble_weight type cost duration
model_id
34 1 0.16 extra_trees 0.014184 2.207980
7 2 0.10 extra_trees 0.014184 1.964377
29 3 0.06 extra_trees 0.021277 2.252809
16 4 0.04 gradient_boosting 0.021277 1.323334
26 5 0.02 extra_trees 0.028369 2.898711
22 6 0.04 gradient_boosting 0.028369 1.466107
2 7 0.04 random_forest 0.028369 2.222874
3 8 0.10 mlp 0.028369 1.336115
14 9 0.02 mlp 0.028369 2.660230
19 10 0.02 extra_trees 0.028369 3.563035
17 11 0.02 gradient_boosting 0.035461 2.186083
8 12 0.02 random_forest 0.035461 2.617924
5 13 0.02 random_forest 0.035461 2.600851
9 14 0.02 extra_trees 0.042553 2.392899
30 15 0.08 liblinear_svc 0.042553 1.263751
32 16 0.16 extra_trees 0.049645 2.269191
33 17 0.02 random_forest 0.056738 2.508028
28 18 0.04 bernoulli_nb 0.070922 1.163354
20 19 0.02 passive_aggressive 0.078014 0.921606
34 1 0.16 extra_trees 0.014184 2.158044
7 2 0.10 extra_trees 0.014184 1.967495
29 3 0.06 extra_trees 0.021277 2.250814
16 4 0.04 gradient_boosting 0.021277 1.271585
26 5 0.02 extra_trees 0.028369 2.775106
22 6 0.04 gradient_boosting 0.028369 1.468125
2 7 0.04 random_forest 0.028369 2.179592
3 8 0.10 mlp 0.028369 1.314463
14 9 0.02 mlp 0.028369 2.650562
19 10 0.02 extra_trees 0.028369 3.390082
17 11 0.02 gradient_boosting 0.035461 2.128715
8 12 0.02 random_forest 0.035461 2.570254
5 13 0.02 random_forest 0.035461 2.554585
9 14 0.02 extra_trees 0.042553 2.313817
30 15 0.08 liblinear_svc 0.042553 1.259079
32 16 0.16 extra_trees 0.049645 2.301594
33 17 0.02 random_forest 0.056738 2.475844
28 18 0.04 bernoulli_nb 0.070922 1.155173
20 19 0.02 passive_aggressive 0.078014 0.918509
Expand Down Expand Up @@ -353,7 +353,7 @@ Get the Score of the final ensemble
.. rst-class:: sphx-glr-timing

**Total running time of the script:** ( 2 minutes 4.034 seconds)
**Total running time of the script:** ( 1 minutes 59.584 seconds)


.. _sphx_glr_download_examples_20_basic_example_classification.py:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Data Loading
# More information on: https://scikit-learn.org/stable/modules/multiclass.html
y[y == 'TRUE'] = 1
y[y == 'FALSE'] = 0
y = y.astype(np.int)
y = y.astype(int)
# Using type of target is a good way to make sure your data
# is properly formatted
Expand All @@ -86,9 +86,6 @@ Data Loading

.. code-block:: none
/home/runner/work/auto-sklearn/auto-sklearn/examples/20_basic/example_multilabel_classification.py:33: DeprecationWarning: `np.int` is a deprecated alias for the builtin `int`. To silence this warning, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
y = y.astype(np.int)
type_of_target=multilabel-indicator
Expand Down Expand Up @@ -157,7 +154,7 @@ View the models found by auto-sklearn
rank ensemble_weight type cost duration
model_id
2 1 1.0 random_forest 0.447294 4.436343
2 1 1.0 random_forest 0.447294 4.533196
Expand Down Expand Up @@ -265,7 +262,7 @@ Get the Score of the final ensemble
.. rst-class:: sphx-glr-timing

**Total running time of the script:** ( 0 minutes 16.045 seconds)
**Total running time of the script:** ( 0 minutes 16.172 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,9 +122,9 @@ View the models found by auto-sklearn

.. code-block:: none
rank ensemble_weight type cost duration
model_id
14 1 1.0 gaussian_process 0.000033 4.520127
rank ensemble_weight type cost duration
model_id
19 1 1.0 gaussian_process 1.718088e-08 4.366592
Expand All @@ -151,7 +151,7 @@ Print the final ensemble constructed by auto-sklearn

.. code-block:: none
[(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},
[(1.000000, SimpleRegressionPipeline({'data_preprocessor:__choice__': 'feature_type', 'feature_preprocessor:__choice__': 'no_preprocessing', 'regressor:__choice__': 'gaussian_process', 'data_preprocessor:feature_type:categorical_transformer:categorical_encoding:__choice__': 'one_hot_encoding', 'data_preprocessor:feature_type:categorical_transformer:category_coalescence:__choice__': 'minority_coalescer', 'data_preprocessor:feature_type:numerical_transformer:imputation:strategy': 'median', 'data_preprocessor:feature_type:numerical_transformer:rescaling:__choice__': 'robust_scaler', 'regressor:gaussian_process:alpha': 7.521590906155149e-08, 'regressor:gaussian_process:thetaL': 4.052724541973572e-07, 'regressor:gaussian_process:thetaU': 17472.745774310217, 'data_preprocessor:feature_type:categorical_transformer:category_coalescence:minority_coalescer:minimum_fraction': 0.43055420836443836, 'data_preprocessor:feature_type:numerical_transformer:rescaling:robust_scaler:q_max': 0.827399658564819, 'data_preprocessor:feature_type:numerical_transformer:rescaling:robust_scaler:q_min': 0.13037866143850987},
dataset_properties={
'task': 5,
'sparse': False,
Expand Down Expand Up @@ -186,7 +186,7 @@ Get the Score of the final ensemble

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

**Total running time of the script:** ( 1 minutes 56.999 seconds)
**Total running time of the script:** ( 1 minutes 56.909 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
25 1 0.46 sgd 0.436679 0.850374
6 2 0.32 ard_regression 0.455042 0.852782
27 3 0.14 ard_regression 0.462249 0.827338
11 4 0.02 random_forest 0.507400 11.182383
7 5 0.06 gradient_boosting 0.518673 1.586598
25 1 0.46 sgd 0.436679 0.802876
6 2 0.32 ard_regression 0.455042 0.828461
27 3 0.14 ard_regression 0.462249 0.795954
11 4 0.02 random_forest 0.507400 10.710532
7 5 0.06 gradient_boosting 0.518673 1.571794
Expand Down Expand Up @@ -267,7 +267,7 @@ the true value).

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

**Total running time of the script:** ( 1 minutes 54.910 seconds)
**Total running time of the script:** ( 1 minutes 56.097 seconds)


.. _sphx_glr_download_examples_20_basic_example_regression.py:
Expand Down
Loading

0 comments on commit e3bb62b

Please sign in to comment.