Skip to content

Commit

Permalink
further changes for stall count
Browse files Browse the repository at this point in the history
  • Loading branch information
Rishabh Gupta authored and Rishabh Gupta committed Jun 17, 2017
1 parent 65ff473 commit 05ef0c4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
9 changes: 0 additions & 9 deletions few/tests/test_few.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,6 @@ def test_few_with_parents_weight():
few_score = learner.score(features[:300], target[:300])
test_score = learner.score(features[300:],target[300:])

lasso = LassoLarsCV()
lasso.fit(learner._training_features,learner._training_labels)
lasso_score = lasso.score(features[:300], target[:300])
print("few score:",few_score,"lasso score:",lasso_score)
print("few test score:",test_score,"lasso test score:",lasso.score(features[300:],target[300:]))
assert few_score >= lasso_score

print("lasso coefficients:",lasso.coef_)


def test_few_at_least_as_good_as_default():
"""test_few.py: few performs at least as well as the default ML """
Expand Down
2 changes: 1 addition & 1 deletion few/variation.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def variation(self,parents):
elif hasattr(self.ml,'feature_importances_'):
# for tree methods, filter our individuals with 0 feature importance
if self.weight_parents:
weights = abs(self.ml.feature_importances_)
weights = self.ml.feature_importances_
weights = weights/sum(weights)
offspring = copy.deepcopy(list(np.random.choice(self.valid(parents), self.population_size, p=weights)))
else:
Expand Down

0 comments on commit 05ef0c4

Please sign in to comment.