Skip to content

Commit

Permalink
Ravin Kohli: [ADD] documentation for pipelines and steps (#329)
Browse files Browse the repository at this point in the history
  • Loading branch information
Github Actions committed Nov 18, 2021
1 parent a0d6e7c commit 139d0ab
Show file tree
Hide file tree
Showing 39 changed files with 3,948 additions and 483 deletions.
Binary file not shown.
Binary file not shown.
Binary file modified development/_images/sphx_glr_example_visualization_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_visualization_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_visualization_thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ <h1>Source code for autoPyTorch.api.tabular_classification</h1><div class="highl
<span class="sd"> Fit both optimizes the machine learning models and builds an ensemble out of them.</span>
<span class="sd"> To disable ensembling, set ensemble_size==0.</span>
<span class="sd"> using the optimizer.</span>

<span class="sd"> Args:</span>
<span class="sd"> X_train, y_train, X_test, y_test: Union[np.ndarray, List, pd.DataFrame]</span>
<span class="sd"> A pair of features (X_train) and targets (y_train) used to fit a</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ <h1>Source code for autoPyTorch.api.tabular_regression</h1><div class="highlight
<span class="sd"> Fit both optimizes the machine learning models and builds an ensemble out of them.</span>
<span class="sd"> To disable ensembling, set ensemble_size==0.</span>
<span class="sd"> using the optimizer.</span>

<span class="sd"> Args:</span>
<span class="sd"> X_train, y_train, X_test, y_test: Union[np.ndarray, List, pd.DataFrame]</span>
<span class="sd"> A pair of features (X_train) and targets (y_train) used to fit a</span>
Expand Down
442 changes: 442 additions & 0 deletions development/_modules/autoPyTorch/pipeline/components/base_choice.html

Large diffs are not rendered by default.

Large diffs are not rendered by default.

510 changes: 510 additions & 0 deletions development/_modules/autoPyTorch/pipeline/tabular_classification.html

Large diffs are not rendered by default.

460 changes: 460 additions & 0 deletions development/_modules/autoPyTorch/pipeline/tabular_regression.html

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions development/_modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@
<h1>All modules for which code is available</h1>
<ul><li><a href="autoPyTorch/api/tabular_classification.html">autoPyTorch.api.tabular_classification</a></li>
<li><a href="autoPyTorch/api/tabular_regression.html">autoPyTorch.api.tabular_regression</a></li>
<li><a href="autoPyTorch/pipeline/components/base_choice.html">autoPyTorch.pipeline.components.base_choice</a></li>
<li><a href="autoPyTorch/pipeline/components/base_component.html">autoPyTorch.pipeline.components.base_component</a></li>
<li><a href="autoPyTorch/pipeline/tabular_classification.html">autoPyTorch.pipeline.tabular_classification</a></li>
<li><a href="autoPyTorch/pipeline/tabular_regression.html">autoPyTorch.pipeline.tabular_regression</a></li>
<li><a href="autoPyTorch/pipeline/traditional_tabular_classification.html">autoPyTorch.pipeline.traditional_tabular_classification</a></li>
<li><a href="autoPyTorch/pipeline/traditional_tabular_regression.html">autoPyTorch.pipeline.traditional_tabular_regression</a></li>
</ul>

</div>
Expand Down
46 changes: 45 additions & 1 deletion development/_sources/api.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,48 @@ Regression

.. autoclass:: autoPyTorch.api.tabular_regression.TabularRegressionTask
:members:
:inherited-members: search, refit, predict, score
:inherited-members: search, refit, predict, score


=========
Pipelines
=========

~~~~~~~~~~~~~~~~~~~~~~
Tabular Classification
~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: autoPyTorch.pipeline.tabular_classification.TabularClassificationPipeline
:members:

.. autoclass:: autoPyTorch.pipeline.traditional_tabular_classification.TraditionalTabularClassificationPipeline
:members:

~~~~~~~~~~~~~~~~~~
Tabular Regression
~~~~~~~~~~~~~~~~~~

.. autoclass:: autoPyTorch.pipeline.tabular_regression.TabularRegressionPipeline
:members:

.. autoclass:: autoPyTorch.pipeline.traditional_tabular_regression.TraditionalTabularRegressionPipeline
:members:

=================
Steps in Pipeline
=================


~~~~~~~~~~~~~~~~~~~~
autoPyTorchComponent
~~~~~~~~~~~~~~~~~~~~

.. autoclass:: autoPyTorch.pipeline.components.base_component.autoPyTorchComponent
:members:

~~~~~~~~~~~~~~~~~
autoPyTorchChoice
~~~~~~~~~~~~~~~~~

.. autoclass:: autoPyTorch.pipeline.components.base_choice.autoPyTorchChoice
:members:
Original file line number Diff line number Diff line change
Expand Up @@ -85,26 +85,25 @@ Image Classification
Pipeline Random Config:
________________________________________
Configuration:
image_augmenter:GaussianBlur:sigma_min, Value: 1.1477050650598004
image_augmenter:GaussianBlur:sigma_offset, Value: 0.2823191510883727
image_augmenter:GaussianBlur:use_augmenter, Value: True
image_augmenter:GaussianBlur:use_augmenter, Value: False
image_augmenter:GaussianNoise:use_augmenter, Value: False
image_augmenter:RandomAffine:rotate, Value: 313
image_augmenter:RandomAffine:scale_offset, Value: 0.22157150483045607
image_augmenter:RandomAffine:shear, Value: 33
image_augmenter:RandomAffine:translate_percent_offset, Value: 0.31366795252179314
image_augmenter:RandomAffine:rotate, Value: 114
image_augmenter:RandomAffine:scale_offset, Value: 0.11914307425363649
image_augmenter:RandomAffine:shear, Value: 8
image_augmenter:RandomAffine:translate_percent_offset, Value: 0.027196925844249223
image_augmenter:RandomAffine:use_augmenter, Value: True
image_augmenter:RandomCutout:use_augmenter, Value: False
image_augmenter:Resize:use_augmenter, Value: True
image_augmenter:ZeroPadAndCrop:percent, Value: 0.4994526394988469
normalizer:__choice__, Value: 'NoNormalizer'
image_augmenter:RandomCutout:p, Value: 0.24908507480752906
image_augmenter:RandomCutout:use_augmenter, Value: True
image_augmenter:Resize:use_augmenter, Value: False
image_augmenter:ZeroPadAndCrop:percent, Value: 0.2779993065586726
normalizer:__choice__, Value: 'ImageNormalizer'

Fitting the pipeline...
________________________________________
ImageClassificationPipeline
________________________________________
0-) normalizer:
NoNormalizer
ImageNormalizer

1-) preprocessing:
EarlyPreprocessing
Expand Down Expand Up @@ -176,7 +175,7 @@ Image Classification
.. rst-class:: sphx-glr-timing

**Total running time of the script:** ( 0 minutes 5.335 seconds)
**Total running time of the script:** ( 0 minutes 5.899 seconds)


.. _sphx_glr_download_examples_20_basics_example_image_classification.py:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ Search for an ensemble of machine learning algorithms
.. code-block:: none
<autoPyTorch.api.tabular_classification.TabularClassificationTask object at 0x7f9ce60aad00>
<autoPyTorch.api.tabular_classification.TabularClassificationTask object at 0x7f17d1cd15e0>
Expand Down Expand Up @@ -162,7 +162,7 @@ Print the final ensemble performance

.. code-block:: none
<smac.runhistory.runhistory.RunHistory object at 0x7f9ce60aadc0> [TrajEntry(train_perf=2147483648, incumbent_id=1, incumbent=Configuration:
<smac.runhistory.runhistory.RunHistory object at 0x7f17d1d96e50> [TrajEntry(train_perf=2147483648, incumbent_id=1, incumbent=Configuration:
data_loader:batch_size, Value: 64
encoder:__choice__, Value: 'OneHotEncoder'
feature_preprocessor:__choice__, Value: 'NoFeaturePreprocessor'
Expand Down Expand Up @@ -194,7 +194,7 @@ Print the final ensemble performance
scaler:__choice__, Value: 'StandardScaler'
trainer:StandardTrainer:weighted_loss, Value: True
trainer:__choice__, Value: 'StandardTrainer'
, ta_runs=0, ta_time_used=0.0, wallclock_time=0.0012331008911132812, budget=0), TrajEntry(train_perf=0.1578947368421053, incumbent_id=1, incumbent=Configuration:
, ta_runs=0, ta_time_used=0.0, wallclock_time=0.0011916160583496094, budget=0), TrajEntry(train_perf=0.1578947368421053, incumbent_id=1, incumbent=Configuration:
data_loader:batch_size, Value: 64
encoder:__choice__, Value: 'OneHotEncoder'
feature_preprocessor:__choice__, Value: 'NoFeaturePreprocessor'
Expand Down Expand Up @@ -226,59 +226,68 @@ Print the final ensemble performance
scaler:__choice__, Value: 'StandardScaler'
trainer:StandardTrainer:weighted_loss, Value: True
trainer:__choice__, Value: 'StandardTrainer'
, ta_runs=1, ta_time_used=3.5240633487701416, wallclock_time=4.555788516998291, budget=5.555555555555555), TrajEntry(train_perf=0.14035087719298245, incumbent_id=2, incumbent=Configuration:
data_loader:batch_size, Value: 148
encoder:__choice__, Value: 'OneHotEncoder'
feature_preprocessor:TruncatedSVD:target_dim, Value: 5
feature_preprocessor:__choice__, Value: 'TruncatedSVD'
imputer:categorical_strategy, Value: 'constant_!missing!'
, ta_runs=1, ta_time_used=3.463505744934082, wallclock_time=4.493630886077881, budget=5.555555555555555), TrajEntry(train_perf=0.14035087719298245, incumbent_id=2, incumbent=Configuration:
data_loader:batch_size, Value: 170
encoder:__choice__, Value: 'NoEncoder'
feature_preprocessor:Nystroem:kernel, Value: 'cosine'
feature_preprocessor:Nystroem:n_components, Value: 5
feature_preprocessor:__choice__, Value: 'Nystroem'
imputer:categorical_strategy, Value: 'most_frequent'
imputer:numerical_strategy, Value: 'constant_zero'
lr_scheduler:ExponentialLR:gamma, Value: 0.8253455276715344
lr_scheduler:__choice__, Value: 'ExponentialLR'
network_backbone:ShapedMLPBackbone:activation, Value: 'tanh'
network_backbone:ShapedMLPBackbone:max_units, Value: 950
network_backbone:ShapedMLPBackbone:mlp_shape, Value: 'long_funnel'
network_backbone:ShapedMLPBackbone:num_groups, Value: 12
network_backbone:ShapedMLPBackbone:output_dim, Value: 426
network_backbone:ShapedMLPBackbone:use_dropout, Value: False
lr_scheduler:__choice__, Value: 'NoScheduler'
network_backbone:ShapedMLPBackbone:activation, Value: 'sigmoid'
network_backbone:ShapedMLPBackbone:max_dropout, Value: 0.2058174477473529
network_backbone:ShapedMLPBackbone:max_units, Value: 656
network_backbone:ShapedMLPBackbone:mlp_shape, Value: 'stairs'
network_backbone:ShapedMLPBackbone:num_groups, Value: 7
network_backbone:ShapedMLPBackbone:output_dim, Value: 894
network_backbone:ShapedMLPBackbone:use_dropout, Value: True
network_backbone:__choice__, Value: 'ShapedMLPBackbone'
network_embedding:__choice__, Value: 'NoEmbedding'
network_head:__choice__, Value: 'fully_connected'
network_head:fully_connected:activation, Value: 'sigmoid'
network_head:fully_connected:num_layers, Value: 2
network_head:fully_connected:units_layer_1, Value: 205
network_init:KaimingInit:bias_strategy, Value: 'Zero'
network_init:__choice__, Value: 'KaimingInit'
optimizer:AdamWOptimizer:beta1, Value: 0.8736175987868154
optimizer:AdamWOptimizer:beta2, Value: 0.9829288984771918
optimizer:AdamWOptimizer:lr, Value: 0.0004977933591642692
optimizer:AdamWOptimizer:weight_decay, Value: 0.09691900491056754
network_head:fully_connected:units_layer_1, Value: 218
network_init:NoInit:bias_strategy, Value: 'Normal'
network_init:__choice__, Value: 'NoInit'
optimizer:AdamWOptimizer:beta1, Value: 0.8602054373347771
optimizer:AdamWOptimizer:beta2, Value: 0.952272648589522
optimizer:AdamWOptimizer:lr, Value: 0.00038032217671957316
optimizer:AdamWOptimizer:weight_decay, Value: 0.05235035327160109
optimizer:__choice__, Value: 'AdamWOptimizer'
scaler:__choice__, Value: 'MinMaxScaler'
trainer:MixUpTrainer:alpha, Value: 0.9512542558695131
scaler:Normalizer:norm, Value: 'mean_squared'
scaler:__choice__, Value: 'Normalizer'
trainer:MixUpTrainer:alpha, Value: 0.758019642405335
trainer:MixUpTrainer:weighted_loss, Value: False
trainer:__choice__, Value: 'MixUpTrainer'
, ta_runs=15, ta_time_used=121.69535493850708, wallclock_time=171.1178548336029, budget=50.0)]
{'accuracy': 0.8554913294797688}
| | Preprocessing | Estimator | Weight |
|---:|:----------------------------------------------------------|:----------------------------------------------------------------|---------:|
| 0 | None | RFLearner | 0.24 |
| 1 | SimpleImputer,OneHotEncoder,Normalizer,KernelPCA | embedding,ShapedMLPBackbone,FullyConnectedHead,nn.Sequential | 0.22 |
| 2 | None | SVMLearner | 0.18 |
| 3 | None | CBLearner | 0.1 |
| 4 | None | ETLearner | 0.08 |
| 5 | None | KNNLearner | 0.08 |
| 6 | SimpleImputer,OneHotEncoder,MinMaxScaler,PowerTransformer | embedding,ShapedMLPBackbone,FullyConnectedHead,nn.Sequential | 0.04 |
| 7 | SimpleImputer,NoEncoder,Normalizer,Nystroem | no embedding,ShapedMLPBackbone,FullyConnectedHead,nn.Sequential | 0.04 |
| 8 | None | LGBMLearner | 0.02 |
, ta_runs=15, ta_time_used=109.08182263374329, wallclock_time=159.79244685173035, budget=50.0)]
{'accuracy': 0.861271676300578}
| | Preprocessing | Estimator | Weight |
|---:|:------------------------------------------------------------------|:-------------------------------------------------------------------|---------:|
| 0 | None | CBLearner | 0.18 |
| 1 | SimpleImputer,OneHotEncoder,Normalizer,KernelPCA | embedding,ShapedMLPBackbone,FullyConnectedHead,nn.Sequential | 0.14 |
| 2 | SimpleImputer,OneHotEncoder,Normalizer,KitchenSink | embedding,MLPBackbone,FullyConnectedHead,nn.Sequential | 0.14 |
| 3 | SimpleImputer,NoEncoder,Normalizer,Nystroem | no embedding,ShapedMLPBackbone,FullyConnectedHead,nn.Sequential | 0.12 |
| 4 | SimpleImputer,NoEncoder,Normalizer,KitchenSink | no embedding,MLPBackbone,FullyConnectedHead,nn.Sequential | 0.1 |
| 5 | SimpleImputer,NoEncoder,Normalizer,Nystroem | no embedding,ShapedMLPBackbone,FullyConnectedHead,nn.Sequential | 0.08 |
| 6 | SimpleImputer,OneHotEncoder,Normalizer,PowerTransformer | embedding,ResNetBackbone,FullyConnectedHead,nn.Sequential | 0.04 |
| 7 | SimpleImputer,NoEncoder,Normalizer,KernelPCA | no embedding,ShapedResNetBackbone,FullyConnectedHead,nn.Sequential | 0.04 |
| 8 | SimpleImputer,OneHotEncoder,MinMaxScaler,PowerTransformer | embedding,ShapedMLPBackbone,FullyConnectedHead,nn.Sequential | 0.02 |
| 9 | SimpleImputer,OneHotEncoder,MinMaxScaler,TruncSVD | no embedding,ShapedMLPBackbone,FullyConnectedHead,nn.Sequential | 0.02 |
| 10 | None | RFLearner | 0.02 |
| 11 | None | ETLearner | 0.02 |
| 12 | None | SVMLearner | 0.02 |
| 13 | None | KNNLearner | 0.02 |
| 14 | SimpleImputer,OneHotEncoder,StandardScaler,NoFeaturePreprocessing | no embedding,ShapedMLPBackbone,FullyConnectedHead,nn.Sequential | 0.02 |
| 15 | SimpleImputer,OneHotEncoder,StandardScaler,NoFeaturePreprocessing | no embedding,ShapedMLPBackbone,FullyConnectedHead,nn.Sequential | 0.02 |
.. rst-class:: sphx-glr-timing

**Total running time of the script:** ( 5 minutes 19.860 seconds)
**Total running time of the script:** ( 5 minutes 34.529 seconds)


.. _sphx_glr_download_examples_20_basics_example_tabular_classification.py:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Search for an ensemble of machine learning algorithms
.. code-block:: none
<autoPyTorch.api.tabular_regression.TabularRegressionTask object at 0x7f9d88915a90>
<autoPyTorch.api.tabular_regression.TabularRegressionTask object at 0x7f1874c24ca0>
Expand Down Expand Up @@ -157,7 +157,7 @@ Print the final ensemble performance

.. code-block:: none
<smac.runhistory.runhistory.RunHistory object at 0x7f9d88915e80> [TrajEntry(train_perf=2147483648, incumbent_id=1, incumbent=Configuration:
<smac.runhistory.runhistory.RunHistory object at 0x7f185d369790> [TrajEntry(train_perf=2147483648, incumbent_id=1, incumbent=Configuration:
data_loader:batch_size, Value: 64
encoder:__choice__, Value: 'OneHotEncoder'
feature_preprocessor:__choice__, Value: 'NoFeaturePreprocessor'
Expand Down Expand Up @@ -188,7 +188,7 @@ Print the final ensemble performance
optimizer:__choice__, Value: 'AdamOptimizer'
scaler:__choice__, Value: 'StandardScaler'
trainer:__choice__, Value: 'StandardTrainer'
, ta_runs=0, ta_time_used=0.0, wallclock_time=0.0011785030364990234, budget=0), TrajEntry(train_perf=0.3195903909944855, incumbent_id=1, incumbent=Configuration:
, ta_runs=0, ta_time_used=0.0, wallclock_time=0.0011248588562011719, budget=0), TrajEntry(train_perf=0.3195903909944855, incumbent_id=1, incumbent=Configuration:
data_loader:batch_size, Value: 64
encoder:__choice__, Value: 'OneHotEncoder'
feature_preprocessor:__choice__, Value: 'NoFeaturePreprocessor'
Expand Down Expand Up @@ -219,7 +219,7 @@ Print the final ensemble performance
optimizer:__choice__, Value: 'AdamOptimizer'
scaler:__choice__, Value: 'StandardScaler'
trainer:__choice__, Value: 'StandardTrainer'
, ta_runs=1, ta_time_used=2.167248249053955, wallclock_time=3.1977641582489014, budget=5.555555555555555)]
, ta_runs=1, ta_time_used=2.1191773414611816, wallclock_time=3.1469626426696777, budget=5.555555555555555)]
{'r2': 0.9445248186059718}
| | Preprocessing | Estimator | Weight |
|---:|:------------------------------------------------------------------|:----------------------------------------------------------------|---------:|
Expand All @@ -234,7 +234,7 @@ Print the final ensemble performance
.. rst-class:: sphx-glr-timing

**Total running time of the script:** ( 5 minutes 28.349 seconds)
**Total running time of the script:** ( 5 minutes 29.258 seconds)


.. _sphx_glr_download_examples_20_basics_example_tabular_regression.py:
Expand Down
Loading

0 comments on commit 139d0ab

Please sign in to comment.