-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
changes for parents pressure for selection #22
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good except for a couple things noted in my comments
few/tests/test_few.py
Outdated
few_score = learner.score(features[:300], target[:300]) | ||
test_score = learner.score(features[300:],target[300:]) | ||
|
||
lasso = LassoLarsCV() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can remove the lasso model fitting.
few/tests/test_few.py
Outdated
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't need to check the score with an assertion
few/variation.py
Outdated
elif hasattr(self.ml,'feature_importances_'): | ||
# for tree methods, filter our individuals with 0 feature importance | ||
offspring = copy.deepcopy(list(x for i,x in zip(self.ml.feature_importances_, self.valid(parents)) if i != 0)) | ||
if self.weight_parents: | ||
weights = abs(self.ml.feature_importances_) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feature importances are always positive so you can remove the abs() from this one
No description provided.