Slackbot
10/27/2023, 6:48 PMJosé Morales
10/27/2023, 6:55 PMSayan Sinha
10/27/2023, 9:51 PMSayan Sinha
10/27/2023, 9:52 PMTypeError Traceback (most recent call last)
Cell In[1], line 1
----> 1 crossvalidation_df = model.cross_validation()
File /home/$USER/neuralforecast/neuralforecast/core.py:542, in NeuralForecast.cross_validation(self, df, static_df, n_windows, step_size, val_size,
test_size, sort_df, use_init_models, verbose, **data_kwargs)
539 fcsts_df = pd.concat([fcsts_df, fcsts], axis=1)
541 # Add original input df's y to forecasts DataFrame
--> 542 fcsts_df = fcsts_df.merge(df, how="left", on=["unique_id", "ds"])
543 return fcsts_df
File ~/anaconda3/envs/$CONDA_ENV/lib/python3.10/site-packages/pandas/core/frame.py:9843, in DataFrame.merge(self, right, how, on, left_on, right_on, left_ind
ex, right_index, sort, suffixes, copy, indicator, validate)
9824 @Substitution("")
9825 @Appender(_merge_doc, indents=2)
9826 def merge(
(...)
9839 validate: str | None = None,
9840 ) -> DataFrame:
9841 from pandas.core.reshape.merge import merge
-> 9843 return merge(
9844 self,
9845 right,
9846 how=how,
9847 on=on,
9848 left_on=left_on,
9849 right_on=right_on,
9850 left_index=left_index,
9851 right_index=right_index,
9852 sort=sort,
9853 suffixes=suffixes,
9854 copy=copy,
9855 indicator=indicator,
9856 validate=validate,
9857 )
File ~/anaconda3/envs/$CONDA_ENV/lib/python3.10/site-packages/pandas/core/reshape/merge.py:148, in merge(left, right, how, on, left_on, right_on, le[12/1635]
right_index, sort, suffixes, copy, indicator, validate)
131 @Substitution("\nleft : DataFrame or named Series")
132 @Appender(_merge_doc, indents=0)
133 def merge(
(...)
146 validate: str | None = None,
147 ) -> DataFrame:
--> 148 op = _MergeOperation(
149 left,
150 right,
151 how=how,
152 on=on,
153 left_on=left_on,
154 right_on=right_on,
155 left_index=left_index,
156 right_index=right_index,
157 sort=sort,
158 suffixes=suffixes,
159 indicator=indicator,
160 validate=validate,
161 )
162 return op.get_result(copy=copy)
File ~/anaconda3/envs/$CONDA_ENV/lib/python3.10/site-packages/pandas/core/reshape/merge.py:681, in _MergeOperation.__init__(self, left, right, how, on, left_
on, right_on, axis, left_index, right_index, sort, suffixes, indicator, validate)
664 def __init__(
665 self,
666 left: DataFrame | Series,
(...)
678 validate: str | None = None,
679 ) -> None:
680 _left = _validate_operand(left)
--> 681 _right = _validate_operand(right)
682 self.left = self.orig_left = _left
683 self.right = self.orig_right = _right
File ~/anaconda3/envs/$CONDA_ENV/lib/python3.10/site-packages/pandas/core/reshape/merge.py:2575, in _validate_operand(obj)
2573 return obj.to_frame()
2574 else:
-> 2575 raise TypeError(
2576 f"Can only merge Series or DataFrame objects, a {type(obj)} was passed"
2577 )
TypeError: Can only merge Series or DataFrame objects, a <class 'NoneType'> was passed
José Morales
10/27/2023, 11:21 PMcrossvalidation_df = model.cross_validation(df=df)
. I've opened https://github.com/Nixtla/neuralforecast/issues/800 to fix itSayan Sinha
10/27/2023, 11:37 PMSayan Sinha
10/28/2023, 12:33 AMy
column as nan
. How do I fix it?Sayan Sinha
10/28/2023, 1:12 AMval_size
columns while training in the cross validation function? I believe the nan
occurs because it is expecting y
outside the training dataset.Sayan Sinha
10/29/2023, 8:33 AMnan
is popping up when the frequency inference is incorrect. Naturally, the merge with the original df
isn't happening properly due to mismatched timestamps.José Morales
11/01/2023, 5:36 PM