-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
108 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
""" | ||
Various configurations for MatPipe. | ||
Use them like so: | ||
config = get_preset_config() | ||
pipe = MatPipe(**config) | ||
""" | ||
|
||
__author__ = ["Alex Dunn <ardunn@lbl.gov>", | ||
"Abhinav Ashar <AbhinavAshar@lbl.gov"] | ||
|
||
from automatminer.featurization import AutoFeaturizer | ||
from automatminer.preprocessing import FeatureReducer, DataCleaner | ||
from automatminer.automl import TPOTAdaptor | ||
|
||
|
||
def get_preset_config(preset='default'): | ||
production_config = {"learner": TPOTAdaptor(generations=500, | ||
population_size=500, | ||
max_time_mins=720, | ||
max_eval_time_mins=60), | ||
"reducer": FeatureReducer(), | ||
"autofeaturizer": AutoFeaturizer(preset="best"), | ||
"cleaner": DataCleaner() | ||
} | ||
default_config = {"learner": TPOTAdaptor(max_time_mins=120), | ||
"reducer": FeatureReducer(), | ||
"autofeaturizer": AutoFeaturizer(preset="best"), | ||
"cleaner": DataCleaner()} | ||
|
||
fast_config = {"learner": TPOTAdaptor(max_time_mins=30, population_size=50), | ||
"reducer": FeatureReducer(reducers=('corr', 'tree')), | ||
"autofeaturizer": AutoFeaturizer(preset="fast"), | ||
"cleaner": DataCleaner()} | ||
|
||
debug_config = {"learner": TPOTAdaptor(max_time_mins=2, | ||
max_eval_time_mins=1, | ||
population_size=10), | ||
"reducer": FeatureReducer(reducers=('corr',)), | ||
"autofeaturizer": AutoFeaturizer(preset="fast"), | ||
"cleaner": DataCleaner()} | ||
if preset == "default": | ||
return default_config | ||
elif preset == "fast": | ||
return fast_config | ||
elif preset == "debug": | ||
return debug_config | ||
elif preset == "production": | ||
return production_config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
""" | ||
Testing the preset configurations for MatPipe. | ||
Mainly ensuring all args can be passed to matpipe constituent parts correctly. | ||
""" | ||
import unittest | ||
|
||
from automatminer.presets import get_preset_config | ||
|
||
|
||
class TestMatPipe(unittest.TestCase): | ||
def test_production(self): | ||
prod = get_preset_config("production") | ||
|
||
def test_debug(self): | ||
debug = get_preset_config("debug") | ||
|
||
def test_fast(self): | ||
fast = get_preset_config("fast") | ||
|
||
def test_default(self): | ||
default = get_preset_config("default") | ||
|
||
|
This file was deleted.
Oops, something went wrong.