Skip to content

Commit

Permalink
Fixed initialisation bug with "full" initialisation whereby no produc…
Browse files Browse the repository at this point in the history
…tion choices could be selected if no children with non-terminal choices were available under certain conditions. Changed "sklearn" in requirements file to "scikit-learn".
  • Loading branch information
mikefenton committed Nov 25, 2016
1 parent 7a461bf commit 71eb5c1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,6 @@ To try this problem, use command-line arguments similar to the following:
--extra_fitness_parameters "alpha=0.5, beta=0.5, gamma=0.5"



#Adding New Problems
--------------------

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ numpy
scipy
matplotlib
pandas
sklearn
scikit-learn
8 changes: 4 additions & 4 deletions src/representation/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,17 +370,17 @@ def legal_productions(method, depth_limit, root, productions):
available = productions

else:
# The depth limit is less than the maximum arity of the grammar.
# We have to be careful in selecting available production
# The depth limit is at or less than the maximum arity of the
# grammar. We have to be careful in selecting available production
# choices lest we generate a tree which violates the depth limit.
available = [prod for prod in productions if prod['max_path'] ==
depth_limit - 1]
depth_limit]

if not available:
# There are no available choices which extend exactly to the
# depth limit. List the NT choices with the longest terminating
# paths that don't violate the limit.
available = [prod for prod in productions if prod['max_path']
< depth_limit and prod['NT_kids']]
< depth_limit]

return available

0 comments on commit 71eb5c1

Please sign in to comment.