示例#1
0
# update the configuration for the new version of the data
config["csv"] = "test/weather_v2.csv"
config["inputs"] = data.drop(columns=["city", "date", "avg_temp"]).columns.tolist()

# test features
# config["inputs"] = None
# config["resolution"] = None
config["input_history"] = False

# In[2]: Model the data

# produce a bayesian ridge regression rolling forecast
print("---- Bayesian Ridge Regression ----")
model5 = Bayes(**config)
model5.roll(verbose=True)
print(f"Bayesian Average Error: {np.round(model5._error.mean()[0] * 100, 2)}%")

print("---- PLS ----")
model4 = PLS(**config)
model4.roll(verbose=True)
print(f"PLS Average Error: {np.round(model4._error.mean()[0] * 100, 2)}%")

# produce a neural network rolling forecast
print("---- Neural Network ----")
model3 = MLP(**config)
model3.roll(verbose=True)
print(f"NNet Average Error: {np.round(model3._error.mean()[0] * 100, 2)}%")

# produce a random forest rolling forecast
print("---- Random Forest ----")