66 'horizontal_concat' , 'copy_if_pandas' , 'join' , 'drop_index_if_pandas' , 'rename' , 'sort' , 'offset_times' ,
77 'offset_dates' , 'time_ranges' , 'repeat' , 'cv_times' , 'group_by' , 'group_by_agg' , 'is_in' , 'between' ,
88 'fill_null' , 'cast' , 'value_cols_to_numpy' , 'make_future_dataframe' , 'anti_join' , 'ensure_sorted' ,
9- 'process_df' , 'DataFrameProcessor' , 'backtest_splits' , 'add_insample_levels' ]
9+ 'ProcessedDF' , ' process_df' , 'DataFrameProcessor' , 'backtest_splits' , 'add_insample_levels' ]
1010
1111# %% ../nbs/processing.ipynb 2
1212import re
@@ -641,20 +641,20 @@ def ensure_sorted(df: DataFrame, id_col: str, time_col: str) -> DataFrame:
641641 return df
642642
643643# %% ../nbs/processing.ipynb 75
644- class _ProcessedDF (NamedTuple ):
644+ class ProcessedDF (NamedTuple ):
645645 uids : Series
646- times : np .ndarray
646+ last_times : np .ndarray
647647 data : np .ndarray
648648 indptr : np .ndarray
649649 sort_idxs : Optional [np .ndarray ]
650650
651- # %% ../nbs/processing.ipynb 76
651+
652652def process_df (
653653 df : DataFrame ,
654654 id_col : str ,
655655 time_col : str ,
656656 target_col : Optional [str ],
657- ) -> _ProcessedDF :
657+ ) -> ProcessedDF :
658658 """Extract components from dataframe
659659
660660 Parameters
@@ -697,9 +697,9 @@ def process_df(
697697 data = data [sort_idxs ]
698698 last_idxs = sort_idxs [last_idxs ]
699699 times = df [time_col ].to_numpy ()[last_idxs ]
700- return _ProcessedDF (uids , times , data , indptr , sort_idxs )
700+ return ProcessedDF (uids , times , data , indptr , sort_idxs )
701701
702- # %% ../nbs/processing.ipynb 78
702+ # %% ../nbs/processing.ipynb 77
703703class DataFrameProcessor :
704704 def __init__ (
705705 self ,
@@ -716,7 +716,7 @@ def process(
716716 ) -> Tuple [Series , np .ndarray , np .ndarray , np .ndarray , Optional [np .ndarray ]]:
717717 return process_df (df , self .id_col , self .time_col , self .target_col )
718718
719- # %% ../nbs/processing.ipynb 83
719+ # %% ../nbs/processing.ipynb 82
720720def _single_split (
721721 df : DataFrame ,
722722 i_window : int ,
@@ -781,7 +781,7 @@ def _single_split(
781781 )
782782 return cutoffs , train_mask , valid_mask
783783
784- # %% ../nbs/processing.ipynb 84
784+ # %% ../nbs/processing.ipynb 83
785785def backtest_splits (
786786 df : DataFrame ,
787787 n_windows : int ,
@@ -813,7 +813,7 @@ def backtest_splits(
813813 valid = filter_with_mask (df , valid_mask )
814814 yield cutoffs , train , valid
815815
816- # %% ../nbs/processing.ipynb 88
816+ # %% ../nbs/processing.ipynb 87
817817def add_insample_levels (
818818 df : DataFrame ,
819819 models : List [str ],
0 commit comments