bc4a5f5d29bb5a74d9cb254ff4dfed916676c8aa,examples/model_selection/example_cross_validation.py,,,#,16

Before Change


cv = model_selection.SlidingWindowForecastCV(window_size=100, step=24, h=1)

// store the residuals for each model
m1_residuals = []
m2_residuals = []

for train_window_indices, val_index in cv.split(train):
    tr_fold = train[train_window_indices]
    model1.fit(tr_fold)
    model2.fit(tr_fold)

    m1_residuals.append(train[val_index] - model1.predict(n_periods=1))
    m2_residuals.append(train[val_index] - model2.predict(n_periods=1))

// make sure residuals are flat and compute RMSE
rmse = lambda arr: np.sqrt(np.average(utils.check_endog(arr) ** 2))

After Change


    model2, train, scoring="mean_squared_error", cv=cv, verbose=2)

// Pick based on which has a lower mean error rate
m1_average_error = np.average(model1_cv_scores)
m2_average_error = np.average(model2_cv_scores)
errors = [m1_average_error, m2_average_error]
models = [model1, model2]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: tgsmith61591/pmdarima
Commit Name: bc4a5f5d29bb5a74d9cb254ff4dfed916676c8aa
Time: 2019-11-01
Author: tgsmith61591@gmail.com
File Name: examples/model_selection/example_cross_validation.py
Class Name:
Method Name:


Project Name: dnouri/skorch
Commit Name: a5f83e8f1e29c62070333d6ce48009e2fdb323b9
Time: 2017-07-19
Author: benjamin.bossan@ottogroup.com
File Name: inferno/callbacks.py
Class Name: AverageLoss
Method Name: on_epoch_end


Project Name: logpai/loglizer
Commit Name: 64e2c49007ccbd1df92a16d43c4943cee5f0147f
Time: 2019-03-05
Author: zhujm.home@gmail.com
File Name: loglizer/models/LogClustering.py
Class Name: LogClustering
Method Name: _extract_representatives