text_plain_output_1.png
from sklearn.model_selection import train_test_split

import numpy as np # linear algebra

import pandas as pd

from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_squared_error
import numpy as np
import pandas as pd
import gc
from tqdm import tqdm
cols = {'countryCode': np.float32, 'c2': np.float32, 'c4': np.float32, 'size': np.float32, 'mediationProviderVersion': np.int32, 'bidFloorPrice': np.float32, 'sentPrice': np.float32, 'winBid': np.float32, 'c1std_bidWin': np.float32, 'c1max_bidWin': np.float32, 'c1min_bidWin': np.float32, 'c1mean_bidWin': np.float32, 'c1median_bidWin': np.float32, 'c1sem_bidWin': np.float32, 'c1var_bidWin': np.float32, 'deviceIdstd_bidWin': np.float32, 'deviceIdmax_bidWin': np.float32, 'deviceIdmin_bidWin': np.float32, 'deviceIdmean_bidWin': np.float32, 'deviceIdmedian_bidWin': np.float32, 'deviceIdsem_bidWin': np.float32, 'deviceIdvar_bidWin': np.float32, 'unitDisplayTypestd_bidWin': np.float32, 'unitDisplayTypemax_bidWin': np.float32, 'unitDisplayTypemean_bidWin': np.float32, 'unitDisplayTypemedian_bidWin': np.float32, 'unitDisplayTypesem_bidWin': np.float32, 'unitDisplayTypevar_bidWin': np.float32, 'bundleIdstd_bidWin': np.float32, 'bundleIdmax_bidWin': np.float32, 'bundleIdmin_bidWin': np.float32, 'bundleIdmean_bidWin': np.float32, 'bundleIdmedian_bidWin': np.float32, 'bundleIdsem_bidWin': np.float32, 'bundleIdvar_bidWin': np.float32, 'ver': np.float32, 'unitDisplayType_0': np.uint8, 'unitDisplayType_1': np.uint8, 'unitDisplayType_2': np.uint8, 'connectionType_0': np.uint8, 'connectionType_1': np.uint8, 'connectionType_2': np.uint8, 'connectionType_3': np.uint8, 'bundleId_0': np.uint8, 'bundleId_1': np.uint8, 'bundleId_2': np.uint8, 'bundleId_3': np.uint8, 'bundleId_4': np.uint8, 'bundleId_5': np.uint8, 'bundleId_6': np.uint8, 'bundleId_7': np.uint8, 'bundleId_8': np.uint8, 'bundleId_9': np.uint8, 'bundleId_10': np.uint8, 'bundleId_11': np.uint8, 'bundleId_12': np.uint8, 'bundleId_13': np.uint8, 'bundleId_14': np.uint8, 'bundleId_15': np.uint8, 'bundleId_16': np.uint8, 'bundleId_17': np.uint8}
for x in range(50):
    cols[f'c1_{x}'] = np.uint8
df = pd.read_csv('../input/fork-of-eda-item-price/prepared_train.csv', float_precision='round_trip', dtype=cols)
s = df.deviceIdstd_bidWin.mean()
df['deviceIdstd_bidWin'].fillna(s, inplace=True)
s = df.deviceIdvar_bidWin.mean()
df['deviceIdvar_bidWin'].fillna(s, inplace=True)
s = df.deviceIdsem_bidWin.mean()
df['deviceIdsem_bidWin'].fillna(s, inplace=True)
train, val = train_test_split(df, test_size=0.33, random_state=42)

df.isnull().sum().sum()