我正在使用
PassiveAggressiveRegressor
增量分类器。每次我使用
partial_fit
from sklearn import linear_model
import numpy as np
import time
X = np.array(range(1000))
y = np.array([x + random.random() for x in X])
X = X.reshape(1000,1)
model = linear_model.PassiveAggressiveRegressor()
model.partial_fit(X, y)
cPickle.dump(model, open('model.pkl', 'wb'))
for i in range(0,10):
time.sleep(1)
model = cPickle.load(open('model.pkl', 'rb'))
model.partial_fit(X, y)
cPickle.dump(model, open('model.pkl', 'wb'))
我不明白为什么是文件模型。pkl改变大小。有时它是
s的大小变为889字节,然后降至886字节。这正常吗?它在做自己的事情?或者我的代码有问题?