用于进行预测的库/框架。
predictit的Python项目详细描述
预测
用于进行预测的库/框架。从statsmodels、sci-kit、tensorflow和一些自己的模型库中选择20个模型(arima、回归、lstm…)中的最佳。库还自动对数据进行预处理,选择最佳的预测参数。
输出
最常见的输出是绘图交互图,部署到数据库和结果列表。 图形打印屏幕
如何使用
pipinstallpredictit
pypi
的简单示例importpredictitpredictions=predictit.main.predict()# Make prediction on test data
示例,包含来自csv和config
importpredictitpredictit.config.predicts=12# Create 30 predictionspredictit.config.data_source='csv'# Define that we load data from CSVpredictit.config.csv_adress=r'E:\VSCODE\Diplomka\test_data\daily-minimum-temperatures.csv'# Load CSV file with datapredictit.config.datalength=1000# Consider only last 1000 data points predictit.config.predicted_columns_names='Temp'# Column name that we want to predictpredictit.config.optimizeit=0# Find or not best parameters for modelspredictit.config.compareit=6# Visualize 6 best modelspredictit.config.repeatit=4# Repeat calculation 4x times on shifted data to reduce chancepredictit.config.other_columns=0# Whether use other columns or not# Chose models that will be computedused_models={"AR (Autoregression)":predictit.models.ar,"ARIMA (Autoregression integrated moving average)":predictit.models.arima,"Autoregressive Linear neural unit":predictit.models.autoreg_LNU,"Conjugate gradient":predictit.models.cg,"Extreme learning machine":predictit.models.elm,"Sklearn universal":predictit.models.sklearn_universal,"Bayes Ridge Regression":predictit.models.regression_bayes_ridge,"Hubber regression":predictit.models.regression_hubber,"Lasso Regression":predictit.models.regression_lasso,}# Define parameters of modelsn_steps_in=50# How many lagged values in modelsoutput_shape='batch'# Whether batch or one-step modelsmodels_parameters={"AR (Autoregression)":{"plot":0,'method':'cmle','ic':'aic','trend':'nc','solver':'lbfgs'},"ARMA":{"plot":0,"p":3,"q":0,'method':'mle','ic':'aic','trend':'nc','solver':'lbfgs','forecast_type':'in_sample'},"ARIMA (Autoregression integrated moving average)":{"p":12,"d":0,"q":1,"plot":0,'method':'css','ic':'aic','trend':'nc','solver':'nm','forecast_type':'out_of_sample'},"Autoregressive Linear neural unit":{"plot":0,"lags":n_steps_in,"mi":1,"minormit":0,"tlumenimi":1},"Conjugate gradient":{"n_steps_in":30,"epochs":5,"constant":1,"other_columns_lenght":None,"constant":None},"Extreme learning machine":{"n_steps_in":20,"output_shape":'one_step',"other_columns_lenght":None,"constant":None,"n_hidden":20,"alpha":0.3,"rbf_width":0,"activation_func":'selu'},"Sklearn universal":{"n_steps_in":n_steps_in,"output_shape":"one_step","model":predictit.models.default_regressor,"constant":None},"Bayes Ridge Regression":{"n_steps_in":n_steps_in,"output_shape":output_shape,"other_columns_lenght":None,"constant":None,"alpha_1":1.e-6,"alpha_2":1.e-6,"lambda_1":1.e-6,"lambda_2":1.e-6},"Hubber regression":{"n_steps_in":n_steps_in,"output_shape":output_shape,"other_columns_lenght":None,"constant":None,"epsilon":1.35,"alpha":0.0001},"Lasso Regression":{"n_steps_in":n_steps_in,"output_shape":output_shape,"other_columns_lenght":None,"constant":None,"alpha":0.6}}predictions=predictit.main.predict()