Skip to content

Commit

Permalink
fixes ml seeding error when more features than individuals
Browse files Browse the repository at this point in the history
  • Loading branch information
lacava committed Oct 17, 2016
1 parent 09a790b commit 263be4e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 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.6'
__version__ = '0.0.7'
11 changes: 6 additions & 5 deletions few/few.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,11 +496,12 @@ def init_pop(self):
raise(AttributeError)
except Exception: # seed pop with raw features
for i,p in it.zip_longest(range(self._training_features.shape[1]),pop.individuals,fillvalue=None):
if i is not None:
p.stack = [('x',0,i)]
else:
make_program(p.stack,self.func_set,self.term_set,np.random.randint(self.min_depth,self.max_depth+1),self.otype)
p.stack = list(reversed(p.stack))
if p is not None:
if i is not None:
p.stack = [('x',0,i)]
else:
make_program(p.stack,self.func_set,self.term_set,np.random.randint(self.min_depth,self.max_depth+1),self.otype)
p.stack = list(reversed(p.stack))

# print initial population
if self.verbosity > 2: print("seeded initial population:",stacks_2_eqns(pop.individuals))
Expand Down

0 comments on commit 263be4e

Please sign in to comment.