-
Does river support diminish weights? As new data comes in and model updates, I want the newer samples added to have more weight compared to the oldest. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hi @numersoz 👋 Online learning algorithms naturally "forget" about past observations over time as they learn from new ones. If you want to speed up that forgetting part you can use the sample_weight, increment = 1, 0.01
for x, y in X_y:
y_pred = model.predict_one(x)
sample_weight += increment
model.learn_one(x, y, sample_weight=sample_weight) The drawback here is to persist the last value of Feel free to raise a PR @numersoz if you feel like you have the momentum. Hope that helps, cheers! |
Beta Was this translation helpful? Give feedback.
Hi @numersoz 👋
Online learning algorithms naturally "forget" about past observations over time as they learn from new ones. If you want to speed up that forgetting part you can use the
sample_weight
argument of thelearn_one
method of your model. Simple example that adds an increment of 0.01 to each new sample weight:The drawback here is to persist the last value of
sample_weight
and the value ofincrement
in order to resume training later on. It could be nice to do that with a scheduler. I think thelearn_one
methods…