You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File /opt/conda/lib/python3.10/site-packages/neuralforecast/core.py:495, in NeuralForecast.fit(self, df, static_df, val_size, sort_df, use_init_models, verbose, id_col, time_col, target_col, distributed_config, prediction_intervals)
493 # Process and save new dataset (in self)
494 if isinstance(df, (pd.DataFrame, pl_DataFrame)):
--> 495 validate_freq(df[time_col], self.freq)
496 self.dataset, self.uids, self.last_dates, self.ds = self._prepare_fit(
497 df=df,
498 static_df=static_df,
(...)
503 target_col=target_col,
504 )
505 self.sort_df = sort_df
File /opt/conda/lib/python3.10/site-packages/utilsforecast/validation.py:140, in validate_freq(times, freq)
135 def validate_freq(
136 times: Series,
137 freq: Union[str, int],
138 ) -> None:
139 if _is_int_dtype(times) and not isinstance(freq, int):
--> 140 raise ValueError(
141 "Time column contains integers but the specified frequency is not an integer. "
142 "Please provide a valid integer, e.g. freq=1"
143 )
144 if _is_dt_dtype(times) and isinstance(freq, int):
145 raise ValueError(
146 "Time column contains timestamps but the specified frequency is an integer. "
147 "Please provide a valid pandas or polars offset, e.g. freq='D' or freq='1d'."
148 )
ValueError: Time column contains integers but the specified frequency is not an integer. Please provide a valid integer, e.g. freq=1
Link
No response
Link
No response
The text was updated successfully, but these errors were encountered:
Description
Description
Block:
nf = NeuralForecast(
models=[
AutoNHITS(h=48, config=config_nhits, loss=MQLoss(), num_samples=5),
AutoLSTM(h=48, config=config_lstm, loss=MQLoss(), num_samples=2),
],
#freq='H',
)
nf.fit(df=Y_df)
Required replace freq='H' on freq=1
There is a tax block in another place, but with cross_validation:
nf = NeuralForecast(
models=[
AutoNHITS(h=48, config=config_nhits, loss=MQLoss(), num_samples=5),
AutoLSTM(h=48, config=config_lstm, loss=MQLoss(), num_samples=2),
],
freq='H',
)
cv_df = nf.cross_validation(Y_df, n_windows=2)
Likewise replace on freq=1.
ValueError Traceback (most recent call last)
Cell In[39], line 11
1 #%%capture
2 nf1 = NeuralForecast(
3 models=[
4 AutoNHITS(h=48, config=config_nhits, loss=MQLoss(), num_samples=5),
(...)
8 #freq=1, # https://pandas-pydata-org.translate.goog/pandas-docs/stable/user_guide/timeseries.html?_x_tr_sl=en&_x_tr_tl=ru&_x_tr_hl=ru&_x_tr_pto=sc#offset-aliases
9 )
---> 11 nf1.fit(df=Y_df)
File /opt/conda/lib/python3.10/site-packages/neuralforecast/core.py:495, in NeuralForecast.fit(self, df, static_df, val_size, sort_df, use_init_models, verbose, id_col, time_col, target_col, distributed_config, prediction_intervals)
493 # Process and save new dataset (in self)
494 if isinstance(df, (pd.DataFrame, pl_DataFrame)):
--> 495 validate_freq(df[time_col], self.freq)
496 self.dataset, self.uids, self.last_dates, self.ds = self._prepare_fit(
497 df=df,
498 static_df=static_df,
(...)
503 target_col=target_col,
504 )
505 self.sort_df = sort_df
File /opt/conda/lib/python3.10/site-packages/utilsforecast/validation.py:140, in validate_freq(times, freq)
135 def validate_freq(
136 times: Series,
137 freq: Union[str, int],
138 ) -> None:
139 if _is_int_dtype(times) and not isinstance(freq, int):
--> 140 raise ValueError(
141 "Time column contains integers but the specified frequency is not an integer. "
142 "Please provide a valid integer, e.g.
freq=1
"143 )
144 if _is_dt_dtype(times) and isinstance(freq, int):
145 raise ValueError(
146 "Time column contains timestamps but the specified frequency is an integer. "
147 "Please provide a valid pandas or polars offset, e.g.
freq='D'
orfreq='1d'
."148 )
ValueError: Time column contains integers but the specified frequency is not an integer. Please provide a valid integer, e.g.
freq=1
Link
No response
Link
No response
The text was updated successfully, but these errors were encountered: