Я реализовал код с использованием модели automrima как часть пакета пирамид, известного сейчас как pmdarima. Мои данные имеют ~ 266000 баллов. Однако каждый раз, когда я запускаю функцию autorima, я получаю ошибку памяти, когда она пытается выделить массивы.
Traceback (most recent call last):
File "_kalman_filter.pyx", line 3320, in statsmodels.tsa.statespace._kalman_filter.dKalmanFilter.__init__
File "_kalman_filter.pyx", line 3593, in statsmodels.tsa.statespace._kalman_filter.dKalmanFilter.set_filter_method
File "_kalman_filter.pyx", line 3442, in statsmodels.tsa.statespace._kalman_filter.dKalmanFilter.allocate_arrays
MemoryError
Есть ли способ это исправить? Код, который я написал, показан ниже:
import pandas as pd
import matplotlib.pyplot as plt
from plotly.offline import iplot
import numpy as np
import datetime
weatherData = np.loadtxt("C:\Users\z3172719\Desktop\WeatherPredictor-master\station42003.csv",delimiter=",") ## the data is stored in columns : 1st column is year, 2nd is month, 3rd is day, 4th is hour and 6th column is the wind speed (between 0 and 20)
years = np.array(weatherData[:,0],dtype=int)
months = np.array(weatherData[:,1],dtype=int)
days = np.array(weatherData[:,2],dtype=int)
hours = np.array(weatherData[:,3],dtype=int)
windSpeed = weatherData[:,5]
for value in range(len(windSpeed)):
if windSpeed[value] ==0:
windSpeed[value] = 1e-12
calendar = []
for value in range(len(years)):
dataDate = datetime.datetime(years[value],months[value],days[value],hours[value])
calendar.append(dataDate)
data = pd.DataFrame({'date': calendar, 'wind': windSpeed})
data = data.set_index('date')
data.index = pd.to_datetime(data.index)
data.columns = ['Wind Speed']
from pyramid.arima import auto_arima
train = data.loc['2000-01-01':'2018-12-31']
test = data.loc['2019-01-01':]
stepwise_model = auto_arima(train, start_p=1, start_q=1,
max_p=3, max_q=3, m=12,
start_P=0, seasonal=True,
d=1, D=1, trace=True,
error_action='ignore',
suppress_warnings=True,
stepwise=True)