From 39b05493ce0e36ef35d10cb3104368a38589174a Mon Sep 17 00:00:00 2001 From: perib Date: Wed, 18 Sep 2024 10:07:26 -0700 Subject: [PATCH 01/10] seconds to mins --- Tutorial/1_Estimators_Overview.ipynb | 20 +++++----- Tutorial/2_Search_Spaces.ipynb | 22 +++++------ Tutorial/7_dask_parallelization.ipynb | 10 ++--- Tutorial/8_SH_and_early_termination.ipynb | 2 +- .../amltk_search_space_parser_example.ipynb | 8 ++-- tpot2/evolvers/base_evolver.py | 38 +++++++++---------- tpot2/evolvers/steady_state_evolver.py | 32 ++++++++-------- tpot2/tests/test_estimators.py | 6 +-- tpot2/tpot_estimator/estimator.py | 24 ++++++------ .../tpot_estimator/steady_state_estimator.py | 22 +++++------ .../tpot_estimator/templates/tpottemplates.py | 36 +++++++++--------- tpot2/utils/eval_utils.py | 12 +++--- 12 files changed, 116 insertions(+), 116 deletions(-) diff --git a/Tutorial/1_Estimators_Overview.ipynb b/Tutorial/1_Estimators_Overview.ipynb index 7da6be38..cae78a96 100644 --- a/Tutorial/1_Estimators_Overview.ipynb +++ b/Tutorial/1_Estimators_Overview.ipynb @@ -134,7 +134,7 @@ "X_train, X_test, y_train, y_test = sklearn.model_selection.train_test_split(X, y, train_size=0.75, test_size=0.25)\n", "\n", "\n", - "est = tpot2.TPOTClassifier(n_jobs=40, max_time_seconds=30, verbose=5, generations=1, population_size=5)\n", + "est = tpot2.TPOTClassifier(n_jobs=40, max_time_mins=30, verbose=5, generations=1, population_size=5)\n", "est.fit(X_train, y_train)\n", "\n", "\n", @@ -815,7 +815,7 @@ "X, y = sklearn.datasets.load_diabetes(return_X_y=True)\n", "X_train, X_test, y_train, y_test = sklearn.model_selection.train_test_split(X, y, train_size=0.75, test_size=0.25)\n", "\n", - "est = tpot2.tpot_estimator.templates.TPOTRegressor(n_jobs=4, max_time_seconds=30, verbose=2, cv=5)\n", + "est = tpot2.tpot_estimator.templates.TPOTRegressor(n_jobs=4, max_time_mins=30, verbose=2, cv=5)\n", "est.fit(X_train, y_train)\n", "\n", "print(scorer(est, X_test, y_test))" @@ -865,7 +865,7 @@ " X_train, X_test, y_train, y_test = sklearn.model_selection.train_test_split(X, y, train_size=0.75, test_size=0.25)\n", "\n", "\n", - " est = tpot2.TPOTClassifier(n_jobs=4, max_time_seconds=60, verbose=2)\n", + " est = tpot2.TPOTClassifier(n_jobs=4, max_time_mins=60, verbose=2)\n", " est.fit(X_train, y_train)\n", "\n", "\n", @@ -909,10 +909,10 @@ " generations : int, default=50\n", " Number of generations to run\n", " \n", - " max_time_seconds : float, default=float(\"inf\")\n", + " max_time_mins : float, default=float(\"inf\")\n", " Maximum time to run the optimization. If none or inf, will run until the end of the generations.\n", " \n", - " max_eval_time_seconds : float, default=60*5\n", + " max_eval_time_mins : float, default=60*5\n", " Maximum time to evaluate a single individual. If none or inf, there will be no time limit per evaluation.\n", "\n", " n_jobs : int, default=1\n", @@ -930,7 +930,7 @@ " 3. best individual\n", " 4. warnings\n", " >=5. full warnings trace\n", - " 6. evaluations progress bar. (Temporary: This used to be 2. Currently, using evaluation progress bar may prevent some instances were we terminate a generation early due to it reaching max_time_seconds in the middle of a generation OR a pipeline failed to be terminated normally and we need to manually terminate it.)\n", + " 6. evaluations progress bar. (Temporary: This used to be 2. Currently, using evaluation progress bar may prevent some instances were we terminate a generation early due to it reaching max_time_mins in the middle of a generation OR a pipeline failed to be terminated normally and we need to manually terminate it.)\n", " \n" ] }, @@ -995,8 +995,8 @@ "\n", " classification=True,\n", "\n", - " max_eval_time_seconds=15,\n", - " max_time_seconds=30,\n", + " max_eval_time_mins=15,\n", + " max_time_mins=30,\n", " verbose=2)\n", "\n", "\n", @@ -1303,8 +1303,8 @@ "\n", " classification=True,\n", "\n", - " max_eval_time_seconds=15,\n", - " max_time_seconds=30,\n", + " max_eval_time_mins=15,\n", + " max_time_mins=30,\n", " verbose=2)\n", "\n", "\n", diff --git a/Tutorial/2_Search_Spaces.ipynb b/Tutorial/2_Search_Spaces.ipynb index 84a869af..3e975731 100644 --- a/Tutorial/2_Search_Spaces.ipynb +++ b/Tutorial/2_Search_Spaces.ipynb @@ -5228,16 +5228,16 @@ " /* fitted */\n", " background-color: var(--sklearn-color-fitted-level-3);\n", "}\n", - "
TPOTEstimator(classification=True, generations=5, max_eval_time_seconds=300,\n",
+       "
TPOTEstimator(classification=True, generations=5, max_eval_time_mins=300,\n",
        "              population_size=10, scorers=['roc_auc'], scorers_weights=[1],\n",
        "              search_space=<tpot2.search_spaces.pipelines.graph.GraphPipeline object at 0x716246e21cf0>,\n",
-       "              verbose=2)
In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.