Skip to content

Commit

Permalink
Updated documentation for string max_times (#189)
Browse files Browse the repository at this point in the history
* Updated documentation for string max_times

* Updated changelog

* Removed deprecation warning from docs
  • Loading branch information
christopherbunn committed Nov 7, 2019
1 parent a9d079d commit 41115b2
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 32 deletions.
83 changes: 63 additions & 20 deletions docs/source/automl/pipeline_search.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
{
"data": {
"text/plain": [
"<evalml.models.auto_classifier.AutoClassifier at 0x1330655d0>"
"<evalml.models.auto_classifier.AutoClassifier at 0x11d782750>"
]
},
"execution_count": 2,
Expand All @@ -74,7 +74,7 @@
{
"data": {
"text/plain": [
"<evalml.models.auto_regressor.AutoRegressor at 0x133088610>"
"<evalml.models.auto_regressor.AutoRegressor at 0x11d792950>"
]
},
"execution_count": 3,
Expand Down Expand Up @@ -108,7 +108,7 @@
{
"data": {
"text/plain": [
"<evalml.models.auto_classifier.AutoClassifier at 0x13308d610>"
"<evalml.models.auto_classifier.AutoClassifier at 0x11d7abf50>"
]
},
"execution_count": 4,
Expand Down Expand Up @@ -139,9 +139,20 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"<evalml.models.auto_classifier.AutoClassifier at 0x11d7b3e50>"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from evalml.objectives import FraudCost\n",
"\n",
Expand Down Expand Up @@ -171,7 +182,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -188,7 +199,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 7,
"metadata": {},
"outputs": [
{
Expand All @@ -197,7 +208,7 @@
"[evalml.pipelines.classification.random_forest.RFClassificationPipeline]"
]
},
"execution_count": 6,
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -215,7 +226,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 8,
"metadata": {},
"outputs": [
{
Expand All @@ -226,7 +237,7 @@
" <ModelTypes.RANDOM_FOREST: 'random_forest'>]"
]
},
"execution_count": 7,
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -237,16 +248,17 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[<ModelTypes.RANDOM_FOREST: 'random_forest'>]"
"[<ModelTypes.LINEAR_MODEL: 'linear_model'>,\n",
" <ModelTypes.RANDOM_FOREST: 'random_forest'>]"
]
},
"execution_count": 8,
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -261,14 +273,45 @@
"source": [
"## Limiting Search Time\n",
"\n",
"You can limit the search time by specifying a maximum number of pipelines or a maximum amount of time. EvalML won't build new pipelines after the maximum time has passed or the maximum number of pipelines have been built.\n",
"You can limit the search time by specifying a maximum number of pipelines and/or a maximum amount of time. EvalML won't build new pipelines after the maximum time has passed or the maximum number of pipelines have been built. If a limit is not set, then a maximum of 5 pipelines will be built. \n",
"\n",
"The maximum search time can be specified as a integer in seconds or as a string in seconds, minutes, or hours. "
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<evalml.models.auto_classifier.AutoClassifier at 0x11d74c250>"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"evalml.AutoClassifier(objective=\"f1\",\n",
" max_time=60)\n",
"\n",
"evalml.AutoClassifier(objective=\"f1\",\n",
" max_time=\"1 minute\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"To start, EvalML samples 10 sets of hyperparameters chosen randomly for each possible pipeline. Therefore, we recommend setting `max_pipelines` at least 10 times the number of possible pipelines."
]
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -277,16 +320,16 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<evalml.models.auto_classifier.AutoClassifier at 0x1330a0250>"
"<evalml.models.auto_classifier.AutoClassifier at 0x11d7ce750>"
]
},
"execution_count": 10,
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -308,7 +351,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -336,7 +379,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
"version": "3.7.5"
},
"mimetype": "text/x-python",
"name": "python",
Expand Down
1 change: 1 addition & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Changelog
* Changes
* Refactoring pipelines :pr:`108`
* Documentation Changes
* Updated documentation to show max_time enhancements :pr:`189`
* Testing Changes

**v0.5.0 Oct. 29, 2019**
Expand Down
2 changes: 1 addition & 1 deletion docs/source/index.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
"version": "3.7.5"
}
},
"nbformat": 4,
Expand Down
9 changes: 4 additions & 5 deletions evalml/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
# must import sklearn first
import sklearn

with warnings.catch_warnings():
warnings.simplefilter("ignore", DeprecationWarning)
import skopt

import evalml.demos
import evalml.model_types
import evalml.objectives
Expand All @@ -20,11 +24,6 @@
from evalml.models import AutoClassifier, AutoRegressor
from evalml.pipelines import list_model_types, load_pipeline, save_pipeline

with warnings.catch_warnings():
warnings.simplefilter("ignore", DeprecationWarning)
import skopt


warnings.filterwarnings("ignore", category=DeprecationWarning)


Expand Down
9 changes: 6 additions & 3 deletions evalml/models/auto_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@ def __init__(self,
multiclass (bool): If True, expecting multiclass data. By default: False.
max_pipelines (int): maximum number of pipelines to search
max_pipelines (int): Maximum number of pipelines to search. If max_pipelines and
max_time is not set, then max_pipelines will default to max_pipelines of 5.
max_time (int): maximum time in seconds to search for pipelines.
won't start new pipeline search after this duration has elapsed
max_time (int, str): Maximum time to search for pipelines.
This will not start a new pipeline search after the duration
has elapsed. If it is an integer, then the time will be in seconds.
For strings, time can be specified as seconds, minutes, or hours.
model_types (list): The model types to search. By default searches over all
model_types. Run evalml.list_model_types("classification") to see options.
Expand Down
9 changes: 6 additions & 3 deletions evalml/models/auto_regressor.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@ def __init__(self,
Arguments:
objective (Object): the objective to optimize
max_pipelines (int): maximum number of pipelines to search
max_pipelines (int): Maximum number of pipelines to search. If max_pipelines and
max_time is not set, then max_pipelines will default to max_pipelines of 5.
max_time (int): maximum time in seconds to search for pipelines.
won't start new pipeline search after this duration has elapsed
max_time (int, str): Maximum time to search for pipelines.
This will not start a new pipeline search after the duration
has elapsed. If it is an integer, then the time will be in seconds.
For strings, time can be specified as seconds, minutes, or hours.
model_types (list): The model types to search. By default searches over all
model_types. Run evalml.list_model_types("regression") to see options.
Expand Down

0 comments on commit 41115b2

Please sign in to comment.