How to change evaluation interval #1067
-
I would like to perform evaluation of metrics in train and validation set only every Rather than changing the callback, is there an easier way to change this behavior? I am looking for something like this: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
I think this can be easily achieved using a custom scoring callback that invokes the scoring you want or returns Example: import numpy as np
from sklearn.mertrics import accuracy_score
import skorch
def my_score(net, X, y):
if len(net.history) % 10 != 0:
return np.nan
return accuracy_score(y, net.predict(X))
net = skorch.NeuralNetClassifier(
mymod,
callbacks=[
EpochScoring(my_score),
],
) Does this help? |
Beta Was this translation helpful? Give feedback.
No, I assumed (wrongly, as it seems), that you have an additional score that is costly and you want to reduce cost here.
In that case, no, you'd have to overwrite the callback: