【发布时间】:2015-07-31 08:07:12
【问题描述】:
我有:
- 3 维基百科文章访问计数(每周)(A-B-C)
- 地面实况数据(每周)
- 维基百科英文文章总流量(每周)
我的目的是,使用 3 条维基百科文章访问次数构建多元线性回归,并尝试预测未来的真实数据。
在开始构建多元线性回归之前,我想对我的 3 个维基百科访问计数数据进行一些预处理(归一化或缩放)。
我的数据格式是这样的。
date | A (x1) | B (x2) | C (x3) | total_en | ground truth(y)
01/01/2008 | 5611 | 606 | 376 | 1467923911 | 3.13599886
08/01/2008 | 8147 | 912 | 569 | 1627405409 | 2.53335614
15/01/2008 | 9809 | 873 | 597 | 1744099880 | 2.91287713
22/01/2008 | 12020 | 882 | 600 | 1804646235 | 3.44497102
... | ... | ... | ... | ... | ...
如果没有标准化,我会像这样构建我的多元线性回归。
wiki3.shape = (150,3) // 使用 numpy 数组包含 A-B-C 文章
ground_truth = (150,1) // 在 numpy 数组中包含地面实况数据
X_train, X_test, y_train, y_test = cross_validation.train_test_split(wiki3, ground_truth, test_size=0.3, random_state=1)
model = linear_model.LinearRegression()
model.fit(X_train, y_train)
predictions = model.predict(X_test)
我的问题是为了获得更好的结果如何标准化/缩放我的 x1、x2、x3 和 y 数据?
我应该用英文文章的总流量来规范每篇文章还是应该使用其他方式?
K-Fold 交叉验证是否适用于时间序列?
谢谢。
【问题讨论】:
标签: python machine-learning scikit-learn regression normalization