Skip to content

cross_validation.py has problems when ran as main. #2

@matsantoro

Description

@matsantoro

In cross_validation.py, CrossValidate.cross_validate() has comparison between strings and pd.Timestamp (lines 140-147) if called as main.
One can add

df['date'] = pd.to_datetime(df['date'])

on line 234.

The function extract_features_for_prediction doesn't work when cross_validation.py is ran as main, because it attempts to stack the train dataset with topological features to the test dataset.
Substitute line 36 including only the non-topological features:

all_x_train = x_train[:, :14]

Finally, on line 200, one should have

model_config_with_topo = self._validate_k_fold_model(x_train_model[:train_x.shape[0]], train_y, val_x_with_topo, val_y)

as x_train_model is the stacking of the original x_train with the validation features.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions