Skip to content

Commit

Permalink
fixed compatibility issues in util.py
Browse files Browse the repository at this point in the history
  • Loading branch information
claesenm committed Jul 10, 2015
1 parent 54e3223 commit 7a5478c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
12 changes: 12 additions & 0 deletions optunity/search_spaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,18 @@ def wrapped(**kwargs):
}
}


hpars = {'algorithm': {'k-nn': {'k': [1, 10]},
'SVM': {'kernel': {'linear': {'C': [0, 2]},
'rbf': {'gamma': [0, 1], 'C': [0, 10]},
'poly': {'degree': [2, 5], 'C': [0, 50], 'coef0': [0, 1]}
}
},
'naive-bayes': {'alpha': [0, 1]},
'random-forest': {'n_estimators': [100, 300], 'max_features': [5, 100]}
}
}

#hpars = {'kernel': {'linear': None,
# 'rbf': {'gamma': [0, 1]},
# 'poly': {'degree': [2, 4]}
Expand Down
6 changes: 2 additions & 4 deletions optunity/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def getargspec(obj):
functions or methods.
"""
if not callable(obj):
raise TypeError, "%s is not callable" % type(obj)
raise TypeError("%s is not callable" % type(obj))
try:
if inspect.isfunction(obj):
return inspect.getargspec(obj)
Expand Down Expand Up @@ -144,6 +144,4 @@ def getargspec(obj):
# care what aspect(s) of that object we actually
# examined).
pass
raise NotImplementedError, \
"do not know how to get argument list for %s" % \
type(obj)
raise NotImplementedError("do not know how to get argument list for %s" % type(obj))

0 comments on commit 7a5478c

Please sign in to comment.