Saturday 24 July 2021

Error in implementing autokeras timeseries model

I was trying to implement autokeras TimeSeriesForecaster on a serial dataset. The features and label of the dataset are respectively given below.

df1_x = enter image description here

df1_y = 
0    2.5
1    2.1
2    2.2
3    2.2
4    1.5
Name: target_carbon_monoxide, dtype: float64

AutoML preparation

#parameters
predict_from = 1
predict_until = 1
lookback = 3
clf = ak.TimeseriesForecaster(
    lookback=lookback,
    predict_from=predict_from,
    predict_until=predict_until,
    max_trials=1,
    objective="val_loss",
)
# Train the TimeSeriesForecaster with train data
clf.fit(
    x=df1_x,
    y=df1_y,
    epochs=10,
)

The dataframe has no NaN values, the shape of the features dataframe is (7111, 8) i.e. a 2D dataframe.

But the error came as following:

Search: Running Trial #1

Hyperparameter    |Value             |Best Value So Far 
timeseries_bloc...|True              |?                 
timeseries_bloc...|lstm              |?                 
timeseries_bloc...|3                 |?                 
regression_head...|0                 |?                 
optimizer         |adam              |?                 
learning_rate     |0.001             |?                 

Epoch 1/10
    173/Unknown - 4s 5ms/step - loss: 2.2421 - mean_squared_error: 2.2421
---------------------------------------------------------------------------
InvalidArgumentError                      Traceback (most recent call last)
/tmp/ipykernel_11292/1163792963.py in <module>
     10 )
     11 # Train the TimeSeriesForecaster with train data
---> 12 clf.fit(
     13     x=df1_x,
     14     y=df1_y,

InvalidArgumentError:  Incompatible shapes: [32,1] vs. [30,1]
     [[node mean_squared_error/SquaredDifference (defined at home/samar/.local/lib/python3.8/site-packages/autokeras/utils/utils.py:88) ]] [Op:__inference_train_function_13895]

Function call stack:
train_function


from Error in implementing autokeras timeseries model

No comments:

Post a Comment