-
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
cross_val changes #29
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.
i think we can get rid of self._training_features. it is a legacy holdover and isn't used anymore.
few/few.py
Outdated
@@ -213,7 +215,7 @@ def fit(self, features, labels): | |||
initial_estimator = copy.deepcopy(self.ml.fit(x_t,y_t)) | |||
# self._best_estimator = copy.deepcopy(self.ml.fit(x_t,y_t)) | |||
|
|||
self._best_score = self.ml.score(x_v,y_v) | |||
self._best_score = np.amax(cross_val_score(self.ml,x_t,y_t,cv=3)) |
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.
use mean
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.
will do
few/few.py
Outdated
#tmp_score = self.ml.score(self.transform( | ||
# x_v,self.pop.individuals)[:,self.valid_loc()], | ||
# y_v) | ||
tmp_score = np.amax(cross_val_score(self.ml,x_t,y_t,cv=3)) |
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.
use mean
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.
will do
few/few.py
Outdated
@@ -213,7 +215,7 @@ def fit(self, features, labels): | |||
initial_estimator = copy.deepcopy(self.ml.fit(x_t,y_t)) | |||
# self._best_estimator = copy.deepcopy(self.ml.fit(x_t,y_t)) | |||
|
|||
self._best_score = self.ml.score(x_v,y_v) | |||
self._best_score = np.amax(cross_val_score(self.ml,x_t,y_t,cv=3)) |
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.
I don't think you need to have cv=3 in there, that is the default
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.
yeah, realized that later..will do
self._training_features is used in population.py in line 235 which is called in few.py line 50 few.py line 50 population.py line 235 |
ok, let's leave _training_features in for now then. |
I am not sure which is the best approach, commenting out the previous code or removing it. Thus, commented as of now.
Also, kept self._training_features and self._training_labels assigned as these are being used in functions in other python files, which are being called here.