项目作者: gcarq

项目描述 :
Time series prediction with Sequential Model and LSTM units
高级语言: Python
项目地址: git://github.com/gcarq/keras-timeseries-prediction.git
创建时间: 2017-01-18T23:25:39Z
项目社区:https://github.com/gcarq/keras-timeseries-prediction

开源协议:MIT License

下载


Time series predictions with Keras

Requirements

  • Theano
  • Keras
  • matplotlib
  • pandas
  • scikit-learn
  • tqdm
  • numpy

Usage

  1. git clone https://github.com/gcarq/keras-timeseries-prediction.git
  2. cd keras-timeseries-prediction/
  3. pip install -r requirements.txt
  4. python main.py

Dataset

The dataset is international-airline-passengers.csv which contains 144 data points ranging from Jan 1949 to Dec 1960.
Each data point represents monthly passengers in thousands.

Dataset

Model

  1. model = Sequential()
  2. model.add(LSTM(64,
  3. activation='relu',
  4. batch_input_shape=(batch_size, look_back, 1),
  5. stateful=True,
  6. return_sequences=False))
  7. model.add(Dense(1, activation='linear'))
  8. model.compile(loss='mean_squared_error', optimizer='adam')

Results

Predictions