Skip to content

Data Leakage in pre-processing #20

@parthkl021

Description

@parthkl021

In reference to this snippet from the preprocessing section in the file model_notebook.ipynb

for col in data.columns:
        if(col not in categorical):
            data[col] = (data[col].astype('float') - np.mean(data[col].astype('float')))/np.std(data[col].astype('float'))

The normalization is done on the whole data (i.e. when the train and test split did not occur). This means that information from the test set is used to scale the training set.

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