Commit 7a20792a authored by Kapil Sachdeva's avatar Kapil Sachdeva Committed by liuzhe-lz
Browse files

fix - sklearn/classification example has a typo in the property 'kernel' when...

fix - sklearn/classification example has a typo in the property 'kernel' when setting model parameterss (#1630)

* fix - sklearn/classification example has a typo in the property 'kernel' when setting model parameters
parent a54728f8
...@@ -41,7 +41,7 @@ def get_default_parameters(): ...@@ -41,7 +41,7 @@ def get_default_parameters():
'''get default parameters''' '''get default parameters'''
params = { params = {
'C': 1.0, 'C': 1.0,
'keral': 'linear', 'kernel': 'linear',
'degree': 3, 'degree': 3,
'gamma': 0.01, 'gamma': 0.01,
'coef0': 0.01 'coef0': 0.01
...@@ -52,7 +52,7 @@ def get_model(PARAMS): ...@@ -52,7 +52,7 @@ def get_model(PARAMS):
'''Get model according to parameters''' '''Get model according to parameters'''
model = SVC() model = SVC()
model.C = PARAMS.get('C') model.C = PARAMS.get('C')
model.keral = PARAMS.get('keral') model.kernel = PARAMS.get('kernel')
model.degree = PARAMS.get('degree') model.degree = PARAMS.get('degree')
model.gamma = PARAMS.get('gamma') model.gamma = PARAMS.get('gamma')
model.coef0 = PARAMS.get('coef0') model.coef0 = PARAMS.get('coef0')
......
{ {
"C": {"_type":"uniform","_value":[0.1, 1]}, "C": {"_type":"uniform","_value":[0.1, 1]},
"keral": {"_type":"choice","_value":["linear", "rbf", "poly", "sigmoid"]}, "kernel": {"_type":"choice","_value":["linear", "rbf", "poly", "sigmoid"]},
"degree": {"_type":"choice","_value":[1, 2, 3, 4]}, "degree": {"_type":"choice","_value":[1, 2, 3, 4]},
"gamma": {"_type":"uniform","_value":[0.01, 0.1]}, "gamma": {"_type":"uniform","_value":[0.01, 0.1]},
"coef0 ": {"_type":"uniform","_value":[0.01, 0.1]} "coef0 ": {"_type":"uniform","_value":[0.01, 0.1]}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment