使用随机森林时的时间加权样本
Time Weighted Samples when using Random Forest
我想知道是否有最佳实践可以按时间对随机森林的训练样本进行指数加权(对最近的样本施加更多权重)?我能想到的一种方法是根据给定时间的权重对带有替换项的完整数据集进行采样。我应该考虑其他方法吗?如果有人知道一些可以帮助我实现此目标的 python 包,那就太好了。非常感谢任何帮助!
随机森林的 sklearn 实现允许在 fit function.
中指定样本权重
from sklearn.ensemble import RandomForestClassifier
# fill sample_weight with the desired weighting
sample_weights = numpy.ones(y.shape)
estimator = RandomForestClassifier
estimator.fit(X, y, sample_weights)
我想知道是否有最佳实践可以按时间对随机森林的训练样本进行指数加权(对最近的样本施加更多权重)?我能想到的一种方法是根据给定时间的权重对带有替换项的完整数据集进行采样。我应该考虑其他方法吗?如果有人知道一些可以帮助我实现此目标的 python 包,那就太好了。非常感谢任何帮助!
随机森林的 sklearn 实现允许在 fit function.
中指定样本权重from sklearn.ensemble import RandomForestClassifier
# fill sample_weight with the desired weighting
sample_weights = numpy.ones(y.shape)
estimator = RandomForestClassifier
estimator.fit(X, y, sample_weights)