text_plain_output_1.png
import pandas as pd

def submit(model, test_features, test_ids, filename):
    loss_pred = model.predict(test_features)
    submission = pd.DataFrame({'id': test_ids, 'loss': loss_pred.reshape(-1)})
    submission.to_csv(filename, index=False)

train = pd.read_csv('/kaggle/input/tabular-playground-series-aug-2021/train.csv')
test = pd.read_csv('/kaggle/input/tabular-playground-series-aug-2021/test.csv')

train.shape

corr_score = train.corr()

train.pop('id')
test_ids = test.pop('id')

train_mean = train.mean()
train_std = train.std()

train_targets_mean = train_mean.pop('loss')
train_targets_std = train_std.pop('loss')

train_targets, validation_targets = (train_features.pop('loss'), validation_features.pop('loss'))

should_scale = True
if should_scale == True:
    train_features = (train_features - train_mean) / train_std
    validation_features = (validation_features - train_mean) / train_std
    test_features = (test - train_mean) / train_std
    print(test_features.head())
    print(train_features.head())
    print(validation_features.head())