Skip to content

Commit a4cb1b2

Browse files
author
Github Actions
committed
chico: [FIX] Update Readme
1 parent c0a9761 commit a4cb1b2

File tree

65 files changed

+31677
-1017
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+31677
-1017
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: da1291ead51b7998a2311fe24055da4c
3+
config: fe944f1b1d3cb4e7269e41b4f8b98b0d
44
tags: 645f666f9bcd5a90fca523b33c5a78b7
-7.44 KB
Binary file not shown.
Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,6 @@
4343
# Build and fit a classifier with default resampling strategy
4444
# ===========================================================
4545
api = TabularClassificationTask(
46-
temporary_directory='./tmp/autoPyTorch_example_tmp_03',
47-
output_directory='./tmp/autoPyTorch_example_out_03',
48-
# To maintain logs of the run, set the next two as False
49-
delete_tmp_folder_after_terminate=True,
50-
delete_output_folder_after_terminate=True,
5146
# 'HoldoutValTypes.holdout_validation' with 'val_share': 0.33
5247
# is the default argument setting for TabularClassificationTask.
5348
# It is explicitly specified in this example for demonstrational
@@ -85,11 +80,6 @@
8580
# Build and fit a classifier with Cross validation resampling strategy
8681
# ====================================================================
8782
api = TabularClassificationTask(
88-
temporary_directory='./tmp/autoPyTorch_example_tmp_04',
89-
output_directory='./tmp/autoPyTorch_example_out_04',
90-
# To maintain logs of the run, set the next two as False
91-
delete_tmp_folder_after_terminate=True,
92-
delete_output_folder_after_terminate=True,
9383
resampling_strategy=CrossValTypes.k_fold_cross_validation,
9484
resampling_strategy_args={'num_splits': 3}
9585
)
@@ -123,11 +113,6 @@
123113
# Build and fit a classifier with Stratified resampling strategy
124114
# ==============================================================
125115
api = TabularClassificationTask(
126-
temporary_directory='./tmp/autoPyTorch_example_tmp_05',
127-
output_directory='./tmp/autoPyTorch_example_out_05',
128-
# To maintain logs of the run, set the next two as False
129-
delete_tmp_folder_after_terminate=True,
130-
delete_output_folder_after_terminate=True,
131116
# For demonstration purposes, we use
132117
# Stratified hold out validation. However,
133118
# one can also use CrossValTypes.stratified_k_fold_cross_validation.

development_update_bibtext/_downloads/342871cbb8ddcf6157ab171f9b9eab25/example_resampling_strategy.ipynb

Lines changed: 0 additions & 54 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
},
2727
"outputs": [],
2828
"source": [
29-
"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())"
29+
"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())"
3030
]
3131
}
3232
],
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)