-
Notifications
You must be signed in to change notification settings - Fork 20
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
Classification crossval results key error #126
Comments
# Make sure we convert numpy arrays to lists
scores = {s: v if np.isscalar(v) else v.tolist()
for s, v in self.scores.items()}
with open(config.crossval_scores_file, 'w') as f:
json.dump(scores, f, sort_keys=True, indent=4)
if self.classification:
to_text = [self.y_true, self.y_pred['most_likely'], self.positions[:,0], self.positions[:,1]]
else:
to_text = [self.y_true, self.y_pred['Prediction'], self.positions[:,0], self.positions[:,1]]
#print(self.y_pred.keys())
#print("classification flag", self.classification)
#to_text = [self.y_true, self.y_pred, self.positions[:,0], self.positions[:,1]]
np.savetxt(config.crossval_results_file, X=np.vstack(to_text).T,
delimiter=',', fmt='%.4f', header='y_true,y_pred,x,y')
if os.path.exists(config.raw_covariates) and os.path.exists(config.raw_covariates_mask):
# Also add prediction values to rawcovariates.csv - yes this file
# is very overloaded and we need to fix the output situation.
# Get indicies sorted by location so we can insert the
# prediction in the correct row.
inds = np.lexsort(self.positions.T)
#sorted_predictions = self.y_pred['Prediction'][inds]
if self.classification:
sorted_predictions = self.y_pred['most_likely'][inds]
else:
sorted_predictions = self.y_pred['Prediction'][inds] |
This is still a problem it would seem? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I get an error
Looking at that dictionary (for a 24 class problem)
is the most_likely supposed to go there in the case of classification, if going to look the same as regression? e.g. using self.classification?
The text was updated successfully, but these errors were encountered: