• 学习小计: Kaggle Learn Time Series Modeling


    ARIMA模型,参数含义参考:https://www.cnblogs.com/bradleon/p/6827109.html

    from statsmodels.tsa.arima_model import ARIMA
    plt.figure(figsize = (15,8))
    model = ARIMA(Train_log, order = (2,1,0))  #here q value is zero since it is just AR Model

    SARIMAX Model,多元季节性时间序列模型,用于预测与异常诊断,参考博客:https://blog.csdn.net/weixin_41512727/article/details/82999831

    import statsmodels.api as sm
    y_hat_avg = valid.copy()
    fit1 = sm.tsa.statespace.SARIMAX(Train.Count, order = (2,1,4), seasonal_order =(0,1,1,7)).fit()
    y_hat_avg['SARIMA'] = fit1.predict(start="2014-6-25", end="2014-9-25", dynamic=True)

    LSTM Model

    import numpy as np
    from numpy import newaxis
    from keras.layers.core import Dense, Activation, Dropout
    from keras.layers.recurrent import LSTM
    from keras.models import Sequential
    
    my_model = Sequential()
    
    my_model.add(LSTM(
        input_shape=(None, 1),
        units=50,
        return_sequences=True))
    
    
    my_model.add(LSTM(100, return_sequences=False))
    my_model.add(Dropout(0.5))
    
    my_model.add(Dense(1))
    my_model.add(Activation('linear'))
    
    my_model.compile(loss='mse', optimizer='rmsprop')
    
    # Fill in the parameters to fit your model
    my_model.fit(
        X_train,
        y_train,
        batch_size=1024,   # Fill this in
        epochs=1,       # Fill this in
        validation_split=0.05)
  • 相关阅读:
    final 和 static
    EL表达式
    strusts2request,session取得
    Double的精度问题
    隐藏软件盘(个人因为好用的方法)
    ListView没有分割线怎么办?
    自定义ActionBar完全覆盖系统的
    保存图片的工具类
    Intent传递list<bean>集合
    Android取得图库图片的具体地址
  • 原文地址:https://www.cnblogs.com/xbit/p/10184176.html
Copyright © 2020-2023  润新知