Skip to content

Commit

Permalink
Francisco Rivera Valverde: [Fix] docs links (#201)
Browse files Browse the repository at this point in the history
  • Loading branch information
Github Actions committed May 7, 2021
1 parent 11d9c5d commit f108374
Show file tree
Hide file tree
Showing 66 changed files with 31,785 additions and 1,067 deletions.
2 changes: 1 addition & 1 deletion development/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: da1291ead51b7998a2311fe24055da4c
config: fe944f1b1d3cb4e7269e41b4f8b98b0d
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@
# Build and fit a classifier with default resampling strategy
# ===========================================================
api = TabularClassificationTask(
temporary_directory='./tmp/autoPyTorch_example_tmp_03',
output_directory='./tmp/autoPyTorch_example_out_03',
# To maintain logs of the run, set the next two as False
delete_tmp_folder_after_terminate=True,
delete_output_folder_after_terminate=True,
# 'HoldoutValTypes.holdout_validation' with 'val_share': 0.33
# is the default argument setting for TabularClassificationTask.
# It is explicitly specified in this example for demonstrational
Expand Down Expand Up @@ -85,11 +80,6 @@
# Build and fit a classifier with Cross validation resampling strategy
# ====================================================================
api = TabularClassificationTask(
temporary_directory='./tmp/autoPyTorch_example_tmp_04',
output_directory='./tmp/autoPyTorch_example_out_04',
# To maintain logs of the run, set the next two as False
delete_tmp_folder_after_terminate=True,
delete_output_folder_after_terminate=True,
resampling_strategy=CrossValTypes.k_fold_cross_validation,
resampling_strategy_args={'num_splits': 3}
)
Expand Down Expand Up @@ -123,11 +113,6 @@
# Build and fit a classifier with Stratified resampling strategy
# ==============================================================
api = TabularClassificationTask(
temporary_directory='./tmp/autoPyTorch_example_tmp_05',
output_directory='./tmp/autoPyTorch_example_out_05',
# To maintain logs of the run, set the next two as False
delete_tmp_folder_after_terminate=True,
delete_output_folder_after_terminate=True,
# For demonstration purposes, we use
# Stratified hold out validation. However,
# one can also use CrossValTypes.stratified_k_fold_cross_validation.
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
"outputs": [],
"source": [
"import os\nimport tempfile as tmp\nimport warnings\n\nimport sklearn.datasets\nimport sklearn.model_selection\n\nos.environ['JOBLIB_TEMP_FOLDER'] = tmp.gettempdir()\nos.environ['OMP_NUM_THREADS'] = '1'\nos.environ['OPENBLAS_NUM_THREADS'] = '1'\nos.environ['MKL_NUM_THREADS'] = '1'\n\nwarnings.simplefilter(action='ignore', category=UserWarning)\nwarnings.simplefilter(action='ignore', category=FutureWarning)\n\nfrom autoPyTorch.api.tabular_regression import TabularRegressionTask\n\n\nif __name__ == '__main__':\n\n ############################################################################\n # Data Loading\n # ============\n X, y = sklearn.datasets.fetch_openml(name='boston', return_X_y=True, as_frame=True)\n X_train, X_test, y_train, y_test = sklearn.model_selection.train_test_split(\n X,\n y,\n random_state=1,\n )\n\n # Scale the regression targets to have zero mean and unit variance.\n # This is important for Neural Networks since predicting large target values would require very large weights.\n # One can later rescale the network predictions like this: y_pred = y_pred_scaled * y_train_std + y_train_mean\n y_train_mean = y_train.mean()\n y_train_std = y_train.std()\n\n y_train_scaled = (y_train - y_train_mean) / y_train_std\n y_test_scaled = (y_test - y_train_mean) / y_train_std\n\n ############################################################################\n # Build and fit a regressor\n # ==========================\n api = TabularRegressionTask(\n temporary_directory='./tmp/autoPyTorch_example_tmp_02',\n output_directory='./tmp/autoPyTorch_example_out_02',\n # To maintain logs of the run, set the next two as False\n delete_tmp_folder_after_terminate=True,\n delete_output_folder_after_terminate=True\n )\n\n ############################################################################\n # Search for an ensemble of machine learning algorithms\n # =====================================================\n api.search(\n X_train=X_train,\n y_train=y_train_scaled,\n X_test=X_test.copy(),\n y_test=y_test_scaled.copy(),\n optimize_metric='r2',\n total_walltime_limit=300,\n func_eval_time_limit_secs=50,\n enable_traditional_pipeline=False,\n )\n\n ############################################################################\n # Print the final ensemble performance\n # ====================================\n print(api.run_history, api.trajectory)\n y_pred_scaled = api.predict(X_test)\n\n # Rescale the Neural Network predictions into the original target range\n y_pred = y_pred_scaled * y_train_std + y_train_mean\n score = api.score(y_pred, y_test)\n\n print(score)\n # Print the final ensemble built by AutoPyTorch\n print(api.show_models())"
"import os\nimport tempfile as tmp\nimport warnings\n\nimport sklearn.datasets\nimport sklearn.model_selection\n\nos.environ['JOBLIB_TEMP_FOLDER'] = tmp.gettempdir()\nos.environ['OMP_NUM_THREADS'] = '1'\nos.environ['OPENBLAS_NUM_THREADS'] = '1'\nos.environ['MKL_NUM_THREADS'] = '1'\n\nwarnings.simplefilter(action='ignore', category=UserWarning)\nwarnings.simplefilter(action='ignore', category=FutureWarning)\n\nfrom autoPyTorch.api.tabular_regression import TabularRegressionTask\n\n\nif __name__ == '__main__':\n\n ############################################################################\n # Data Loading\n # ============\n X, y = sklearn.datasets.fetch_openml(name='boston', return_X_y=True, as_frame=True)\n X_train, X_test, y_train, y_test = sklearn.model_selection.train_test_split(\n X,\n y,\n random_state=1,\n )\n\n # Scale the regression targets to have zero mean and unit variance.\n # This is important for Neural Networks since predicting large target values would require very large weights.\n # One can later rescale the network predictions like this: y_pred = y_pred_scaled * y_train_std + y_train_mean\n y_train_mean = y_train.mean()\n y_train_std = y_train.std()\n\n y_train_scaled = (y_train - y_train_mean) / y_train_std\n y_test_scaled = (y_test - y_train_mean) / y_train_std\n\n ############################################################################\n # Build and fit a regressor\n # ==========================\n api = TabularRegressionTask()\n\n ############################################################################\n # Search for an ensemble of machine learning algorithms\n # =====================================================\n api.search(\n X_train=X_train,\n y_train=y_train_scaled,\n X_test=X_test.copy(),\n y_test=y_test_scaled.copy(),\n optimize_metric='r2',\n total_walltime_limit=300,\n func_eval_time_limit_secs=50,\n enable_traditional_pipeline=False,\n )\n\n ############################################################################\n # Print the final ensemble performance\n # ====================================\n print(api.run_history, api.trajectory)\n y_pred_scaled = api.predict(X_test)\n\n # Rescale the Neural Network predictions into the original target range\n y_pred = y_pred_scaled * y_train_std + y_train_mean\n score = api.score(y_pred, y_test)\n\n print(score)\n # Print the final ensemble built by AutoPyTorch\n print(api.show_models())"
]
}
],
Expand Down
Loading

0 comments on commit f108374

Please sign in to comment.