Skip to content

Commit

Permalink
fixes bug in variation for ml_type variable
Browse files Browse the repository at this point in the history
  • Loading branch information
lacava committed Jul 13, 2017
1 parent 6ba6f8b commit 5a46411
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion few/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
"""

__version__ = '0.0.41'
__version__ = '0.0.42'
5 changes: 3 additions & 2 deletions few/variation.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def variation(self,parents):
"""performs variation operators on parents."""
# downselect to features that are important
if (self.valid(parents) and
type(self.ml).__name__ != 'SVC' and type(self.ml).__name__ != 'SVR'):
self.ml_type != 'SVC' and self.ml_type != 'SVR'):
# this is needed because svm has a bug that throws valueerror on
# attribute check
if hasattr(self.ml.named_steps['ml'],'coef_'):
Expand Down Expand Up @@ -151,7 +151,8 @@ def cross(self,p_i,p_j, max_depth = 2):
#swap subtrees
tmpi = p_i[:]
tmpj = p_j[:]
tmpi[x_i_begin:x_i_end+1:],tmpj[x_j_begin:x_j_end+1:] = tmpj[x_j_begin:x_j_end+1:],tmpi[x_i_begin:x_i_end+1:]
tmpi[x_i_begin:x_i_end+1:],tmpj[x_j_begin:x_j_end+1:] = \
tmpj[x_j_begin:x_j_end+1:],tmpi[x_i_begin:x_i_end+1:]

if not self.is_valid_program(p_i) or not self.is_valid_program(p_j):
# pdb.set_trace()
Expand Down

0 comments on commit 5a46411

Please sign in to comment.