Skip to content

Commit

Permalink
Add ElasticNet as the linear regression model for TPOT-MDR-regression
Browse files Browse the repository at this point in the history
  • Loading branch information
rhiever committed May 10, 2017
1 parent d521c3b commit b67600b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion optional-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
xgboost==0.6
scikit-mdr==0.4.2
scikit-mdr==0.4.4
skrebate==0.3.4
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def calculate_version():
extras_require={
'xgboost': ['xgboost>=0.6'],
'skrebate': ['skrebate>=0.3.4'],
'mdr': ['scikit-mdr>=0.4.2']
'mdr': ['scikit-mdr>=0.4.4']
},
classifiers=[
'Intended Audience :: Science/Research',
Expand Down
4 changes: 3 additions & 1 deletion tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
from tpot.config_classifier_light import classifier_config_dict_light
from tpot.config_regressor_light import regressor_config_dict_light
from tpot.config_classifier_mdr import tpot_mdr_classifier_config_dict
from tpot.config_regressor_mdr import tpot_mdr_regressor_config_dict

import numpy as np
import inspect
Expand Down Expand Up @@ -193,7 +194,8 @@ def test_lite_params():
tpot_obj = TPOTRegressor(config_dict='TPOT light')
assert tpot_obj.config_dict == regressor_config_dict_light

assert_raises(TypeError, TPOTRegressor, config_dict='TPOT MDR')
tpot_obj = TPOTRegressor(config_dict='TPOT MDR')
assert tpot_obj.config_dict == tpot_mdr_regressor_config_dict


def test_random_ind():
Expand Down
9 changes: 9 additions & 0 deletions tpot/config_regressor_mdr.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,21 @@
License along with TPOT. If not, see <http://www.gnu.org/licenses/>.
"""

import numpy as np

# Check the TPOT documentation for information on the structure of config dicts

tpot_mdr_regressor_config_dict = {

# Regressors

'sklearn.linear_model.ElasticNetCV': {
'l1_ratio': np.arange(0.0, 1.01, 0.05),
'tol': [1e-5, 1e-4, 1e-3, 1e-2, 1e-1]
},

# Feature Constructors

'mdr.ContinuousMDR': {
'tie_break': [0, 1],
'default_label': [0, 1]
Expand Down

0 comments on commit b67600b

Please sign in to comment.