How to explicitly set the scoring metric in SplineCV
?
#61
-
Thanks for Verde - I'm just getting started, but it looks like a fantastic package! I have what is probably a very simple question, but so far I haven't figured it out: how can I explicitly set the scoring metric used by At present, the model selection example from the docs generates lots of warnings
This is helpful, but I'd like to silence these warnings and - ideally - switch to using negative root mean squared error in my current code. If I've understood correctly, it looks as though I should be able to specify any of the "regression" scoring metrics listed here, e.g. by passing Using the standard spline = vd.Spline()
score_default = np.mean(
vd.cross_val_score(spline, data_coords, data_values, scoring="neg_root_mean_squared_error")
)
print(" Neg RMSE with defaults:", score_default) How can I do something similar with If I do spline = vd.SplineCV(dampings=dampings, mindists=min_dists)
spline.fit(data_coords, data_values)
print(" Highest score:", spline.scores_.max())
print(" Best damping:", spline.damping_)
print(" Best mindist:", spline.mindist_) It uses R2 as the default and generates lots of warnings. Is there a simple way to specify Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi @JamesSample that's a great question. I actually forgot to build a way to do that into You're more than welcome to take a stab at adding this if you're interested. I laid out the changes needed in that issue and it would be a matter of changing 2 lines of code + a test. Any help we can get is always much appreciated ❤️ |
Beta Was this translation helpful? Give feedback.
-
Implemented in fatiando/verde#380 and will be available in Verde v1.8.0. |
Beta Was this translation helpful? Give feedback.
Hi @JamesSample that's a great question. I actually forgot to build a way to do that into
SplineCV
whenscoring
was introduced as an argument incross_val_score
. I've opened fatiando/verde#379 to add this to our TODO list for the next release, which I'm hoping to get out within the next month.You're more than welcome to take a stab at adding this if you're interested. I laid out the changes needed in that issue and it would be a matter of changing 2 lines of code + a test. Any help we can get is always much appreciated ❤️