def experiment(method, windpark, windpark_test, damaged, rate):
    args, nseries = argfuncs[method](windpark)
    reconstructed = interpolate(damaged,  **args)

    target = windpark.get_target()
    measurements = repair_nrel(target.get_measurements()[:10000])
    turbines = windpark.get_turbines()

    for t in range(len(turbines)):
        turbines[t].add_measurements(\
            repair_nrel(turbines[t].get_measurements()[:10000]))

    # this is the target turbine, use the reconstructed here.
    turbines[-1].add_measurements(reconstructed)

    feature_window, horizon = 3,3

    mapping = PowerMapping()
    # with damaged
    X = mapping.get_features_park(windpark, feature_window, horizon)
    Y = mapping.get_labels_turbine(target, feature_window, horizon)

    train_to = int(math.floor(len(X)))
    train_step, test_step = 1, 1

    reg = linear_model.LinearRegression()
    reg = reg.fit(X[0:train_to:train_step], Y[0:train_to:train_step])

    # USE THE 2005 YEAR FOR TESTING, WITHOUT DAMAGE
    # predict on second year without damage

    turbines = windpark_test.get_turbines()
    for t in turbines:
        t.add_measurements(repair_nrel(t.get_measurements()[:10000]))
    target_test = windpark_test.get_target()

    XT = mapping.get_features_park(windpark_test, feature_window, horizon)
    test_to = int(math.floor(len(XT)))

    YT = mapping.get_labels_turbine(target_test, feature_window, horizon)[:test_to]
    y_hat = reg.predict(XT[:test_to])

    mse_y_hat = 0
    for i in range(0, len(y_hat)):
        y = YT[i]
        mse_y_hat += (y_hat[i] - y) ** 2

    mse_y_hat /= float(len(y_hat))

    return mse_y_hat

# generating destroyed measurements which are constant over all
# methods
dataset/ETHPy150Open cigroup-ol/windml/examples/missingdata/reconstruction_prediction.py/experiment/original