invert4geom.kfold_df_to_lists

invert4geom.kfold_df_to_lists#

kfold_df_to_lists(df)[source]#

convert a single dataframe with fold columns in the form fold_0, fold_1 etc. into a list of testing dataframes for each fold and a list of training dataframes for each fold.

Parameters:

df (DataFrame) – dataframe with fold columns in the form fold_0, fold_1 etc., as output by function split_test_train().

Return type:

tuple[list[DataFrame], list[DataFrame]]

Returns:

  • test_dfs (list[pandas.DataFrame]) – a list of testing dataframes for each fold

  • train_dfs (list[pandas.DataFrame]) – a list of training dataframes for each fold