-
Notifications
You must be signed in to change notification settings - Fork 484
Labels
Description
What happened + What you expected to happen
无法使用样本内预测,阻止我完成接下来的任务
test.py 75 <module>
Y_hat_insample = nf.predict_insample(step_size=12)
core.py 1213 predict_insample
fcsts[:, col_idx : (col_idx + output_length)] = model_fcsts
ValueError:
could not broadcast input array from shape (17388,1) into shape (17412,1)
Versions / Dependencies
Python 3.9.19
neuralforecast 1.7.3
Reproduction script
train_df = pd.read_csv('ETTh1.csv',encoding='utf-8')
train_df['ds'] = pd.to_datetime(train_df['ds'])
model = iTransformer(h=12,
input_size=24,
n_series=1,
hidden_size=128,
n_heads=8,
e_layers=2,
d_layers=1,
d_ff=4,
factor=1,
dropout=0.1,
use_norm=True,
loss=MSE(),
valid_loss=MSE(),
early_stop_patience_steps=3,
batch_size=24,
max_steps=5)
nf = NeuralForecast(
models=[model],
freq='H'
)
nf.fit(df=train_df, val_size=12)
# nf.save(path=save_path,
# model_index=None,
# overwrite=True,
# save_dataset=True)
print('模型保存完成')
Y_hat_insample = nf.predict_insample(step_size=12)
print('Y_hat_insample' ,Y_hat_insample.head(),Y_hat_insample.shape)
Y_hat_insample = pd.DataFrame(Y_hat_insample)
Y_hat_insample['unique_id'] = Y_hat_insample.index
mae = mae(Y_hat_insample,models=['iTransformer'],id_col='unique_id')
mse = mse(Y_hat_insample,models=['iTransformer'],id_col='unique_id')
validation_df = pd.DataFrame(data={'MAE': mae['iTransformer'], 'MSE': mse['iTransformer']})
### Issue Severity
High: It blocks me from completing my task.
Reactions are currently unavailable