尝试运行此命令时,我收到以下错误。我真的不知道如何解决这个问题。由于我对此很陌生,所以我非常感谢任何帮助。
在这里,我使用不同的模型来检查哪一个在这里最好。
检查此导入代码:
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as mcolors
import pandas as pd
import plotly.express as px
from datetime import date, timedelta
import random
import math
import time
import operator
import folium
import plotly.offline as py
from sklearn.linear_model import LinearRegression, BayesianRidge
from sklearn.model_selection import RandomizedSearchCV, train_test_split
from sklearn.preprocessing import PolynomialFeatures
from fbprophet import Prophet
from fbprophet.plot import plot_plotly, add_changepoints_to_plot
from sklearn import preprocessing, cross_validation
from sklearn.tree import DecisionTreeRegressor
from sklearn.neural_network import MLPRegressor
from sklearn.svm import SVR
from sklearn.metrics import mean_squared_error, mean_absolute_error
from statsmodels.tsa.arima_model import ARIMA
from statsmodels.graphics.tsaplots import plot_acf, plot_pacf
import statsmodels.api as sm
from keras.models import Sequential
from keras.layers import LSTM,Dense
from keras.layers import Dropout
from sklearn.preprocessing import MinMaxScaler
from tensorflow.keras.preprocessing.sequence import TimeseriesGenerator
plt.style.use('fivethirtyeight')
%matplotlib inline
多项式回归的模型开发
data1 = confirmed_df.melt(value_vars=dates1, var_name='Date', value_name='Confirmed')
data1 = data1.groupby('Date')['Confirmed'].sum().reset_index()
data1.head()
X = pd.DataFrame(data=data1, columns=data1.Date)
y = data1.Confirmed
y -= y.mean()
#cross_validation.train_test_split(x, y, test_size=0.1,random_state=0)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.1,
random_state=0)
茅侃侃
慕尼黑8549860
相关分类