Kaggle competition: House Prices - Advanced Regression Techniques
<SOS> metric: rmsle Kaggle data source: house-prices-advanced-regression-techniques<choose_model_class>
!pip install -q git+https://github.com/tensorflow/docs iteration-utilities
MODEL_CLASS = DenseNet201<define_variables>
for dirname, _, filenames in os.walk('/kaggle/input'):
for filename in filenames:
print(os.path.join(dirname, filename))
pd.set_option('display.max_columns', None)
 pp = pprint.PrettyPrinter()
GCS_DS_PATH = KaggleDatasets().get_gcs_path('tpu-getting-started')
 GCS_DS_PATH_EXT = KaggleDatasets().get_gcs_path('tf-flower-photo-tfrec')
 IMAGE_SIZE = [512, 512]
EPOCHS = 35
BATCH_SIZE = 16 * strategy.num_replicas_in_sync
GCS_PATH_SELECT = {
192: GCS_DS_PATH + '/tfrecords-jpeg-192x192',
224: GCS_DS_PATH + '/tfrecords-jpeg-224x224',
331: GCS_DS_PATH + '/tfrecords-jpeg-331x331',
512: GCS_DS_PATH + '/tfrecords-jpeg-512x512'
}
GCS_PATH = GCS_PATH_SELECT[IMAGE_SIZE[0]]
GCS_PATH_SELECT_EXT = {
192: '/tfrecords-jpeg-192x192',
224: '/tfrecords-jpeg-224x224',
331: '/tfrecords-jpeg-331x331',
512: '/tfrecords-jpeg-512x512'
}
GCS_PATH_EXT = GCS_PATH_SELECT_EXT[IMAGE_SIZE[0]]
IMAGENET_FILES = tf.io.gfile.glob(GCS_DS_PATH_EXT + '/imagenet' + GCS_PATH_EXT + '/*.tfrec')
 INATURELIST_FILES = tf.io.gfile.glob(GCS_DS_PATH_EXT + '/inaturalist' + GCS_PATH_EXT + '/*.tfrec')
 OPENIMAGE_FILES = tf.io.gfile.glob(GCS_DS_PATH_EXT + '/openimage' + GCS_PATH_EXT + '/*.tfrec')
 OXFORD_FILES = tf.io.gfile.glob(GCS_DS_PATH_EXT + '/oxford_102' + GCS_PATH_EXT + '/*.tfrec')
 TENSORFLOW_FILES = tf.io.gfile.glob(GCS_DS_PATH_EXT + '/tf_flowers' + GCS_PATH_EXT + '/*.tfrec')
 ADDITIONAL_TRAINING_FILENAMES = IMAGENET_FILES + INATURELIST_FILES + OPENIMAGE_FILES + OXFORD_FILES + TENSORFLOW_FILES
CLASSES = ['pink primrose', 'hard-leaved pocket orchid', 'canterbury bells', 'sweet pea', 'wild geranium', 'tiger lily', 'moon orchid', 'bird of paradise', 'monkshood', 'globe thistle',
'snapdragon', "colt's foot", 'king protea', 'spear thistle', 'yellow iris', 'globe-flower', 'purple coneflower', 'peruvian lily', 'balloon flower', 'giant white arum lily',
'fire lily', 'pincushion flower', 'fritillary', 'red ginger', 'grape hyacinth', 'corn poppy', 'prince of wales feathers', 'stemless gentian', 'artichoke', 'sweet william',
'carnation', 'garden phlox', 'love in the mist', 'cosmos', 'alpine sea holly', 'ruby-lipped cattleya', 'cape flower', 'great masterwort', 'siam tulip', 'lenten rose',
'barberton daisy', 'daffodil', 'sword lily', 'poinsettia', 'bolero deep blue', 'wallflower', 'marigold', 'buttercup', 'daisy', 'common dandelion',
'petunia', 'wild pansy', 'primula', 'sunflower', 'lilac hibiscus', 'bishop of llandaff', 'gaura', 'geranium', 'orange dahlia', 'pink-yellow dahlia',
'cautleya spicata', 'japanese anemone', 'black-eyed susan', 'silverbush', 'californian poppy', 'osteospermum', 'spring crocus', 'iris', 'windflower', 'tree poppy',
'gazania', 'azalea', 'water lily', 'rose', 'thorn apple', 'morning glory', 'passion flower', 'lotus', 'toad lily', 'anthurium',
'frangipani', 'clematis', 'hibiscus', 'columbine', 'desert-rose', 'tree mallow', 'magnolia', 'cyclamen ', 'watercress', 'canna lily',
'hippeastrum ', 'bee balm', 'pink quill', 'foxglove', 'bougainvillea', 'camellia', 'mallow', 'mexican petunia', 'bromelia', 'blanket flower',
'trumpet creeper', 'blackberry lily', 'common tulip', 'wild rose']
TRAINING_FILENAMES = tf.io.gfile.glob(GCS_PATH + '/train/*.tfrec')
 VALIDATION_FILENAMES = tf.io.gfile.glob(GCS_PATH + '/val/*.tfrec')
 TEST_FILENAMES = tf.io.gfile.glob(GCS_PATH + '/test/*.tfrec')
 TRAINING_FILENAMES = TRAINING_FILENAMES + ADDITIONAL_TRAINING_FILENAMES<categorify>
def load_dataset(path: str)-> pd.DataFrame:
df = pd.read_csv(path)
 return df
train_csv = load_dataset("/kaggle/input/house-prices-advanced-regression-techniques/train.csv")
 test_csv = load_dataset("/kaggle/input/house-prices-advanced-regression-techniques/test.csv")
 train_csv.sample(10 )
def random_blockout(img, sl=0.1, sh=0.2, rl=0.4):
p=random.random()
if p>=0.25:
w, h, c = IMAGE_SIZE[0], IMAGE_SIZE[1], 3
origin_area = tf.cast(h*w, tf.float32)
 e_size_l = tf.cast(tf.round(tf.sqrt(origin_area * sl * rl)) , tf.int32)
 e_size_h = tf.cast(tf.round(tf.sqrt(origin_area * sh / rl)) , tf.int32)
 e_height_h = tf.minimum(e_size_h, h)
 e_width_h = tf.minimum(e_size_h, w)
 erase_height = tf.random.uniform(shape=[], minval=e_size_l, maxval=e_height_h, dtype=tf.int32)
 erase_width = tf.random.uniform(shape=[], minval=e_size_l, maxval=e_width_h, dtype=tf.int32)
 erase_area = tf.zeros(shape=[erase_height, erase_width, c])
 erase_area = tf.cast(erase_area, tf.uint8)
 pad_h = h - erase_height
pad_top = tf.random.uniform(shape=[], minval=0, maxval=pad_h, dtype=tf.int32)
 pad_bottom = pad_h - pad_top
pad_w = w - erase_width
pad_left = tf.random.uniform(shape=[], minval=0, maxval=pad_w, dtype=tf.int32)
 pad_right = pad_w - pad_left
erase_mask = tf.pad([erase_area], [[0,0],[pad_top, pad_bottom], [pad_left, pad_right], [0,0]], constant_values=1)
 erase_mask = tf.squeeze(erase_mask, axis=0)
 erased_img = tf.multiply(tf.cast(img,tf.float32), tf.cast(erase_mask, tf.float32))
return tf.cast(erased_img, img.dtype)
 else:
return tf.cast(img, img.dtype)
<data_type_conversions>
FEATURES = {
'categorical':{
'MSSubClass': ['20', '30', '40', '45', '50', '60', '70', '75', '80', '85', '90', '120', '150', '160', '180', '190'],
'MSZoning': ['A', 'C', 'FV', 'I', 'RH', 'RL', 'RP', 'RM'],
'Alley': ['Grvl', 'Pave', 'None'],
'LandContour': ['Lvl', 'Bnk', 'HLS', 'Low'],
'LotConfig': ['Inside', 'Corner', 'CulDSac', 'FR2', 'FR3'],
'Neighborhood': ['Blmngtn', 'Blueste', 'BrDale', 'BrkSide', 'ClearCr', 'CollgCr', 'Crawfor', 'Edwards', 'Gilbert', 'IDOTRR', 'MeadowV', 'Mitchel',
'Names', 'NoRidge', 'NPkVill', 'NridgHt', 'NWAmes', 'OldTown', 'SWISU', 'Sawyer', 'SawyerW', 'Somerst', 'StoneBr', 'Timber', 'Veenker'],
'Condition1': ['Artery', 'Feedr', 'Norm', 'RRNn', 'RRAn', 'PosN', 'PosA', 'RRNe', 'RRAe'],
'Condition2': ['Artery', 'Feedr', 'Norm', 'RRNn', 'RRAn', 'PosN', 'PosA', 'RRNe', 'RRAe'],
'BldgType': ['1Fam', '2FmCon', 'Duplx', 'TwnhsE', 'TwnhsI'],
'HouseStyle': ['1Story', '1.5Fin', '1.5Unf', '2Story', '2.5Fin', '2.5Unf', 'SFoyer', 'SLvl'],
'RoofStyle': ['Flat', 'Gable', 'Gambrel', 'Hip', 'Mansard', 'Shed'],
'RoofMatl': ['ClyTile', 'CompShg', 'Membran', 'Metal', 'Roll', 'Tar&Grv', 'WdShake', 'WdShngl'],
'Exterior1st': ['AsbShng', 'AsphShn', 'BrkComm', 'BrkFace', 'CBlock', 'CemntBd', 'HdBoard', 'ImStucc', 'MetalSd', 'Other', 'Plywood', 'PreCast', 'Stone', 'Stucco',
'VinylSd', 'Wd Sdng', 'WdShing'],
'Exterior2nd': ['AsbShng', 'AsphShn', 'BrkComm', 'BrkFace', 'CBlock', 'CemntBd', 'HdBoard', 'ImStucc', 'MetalSd', 'Other', 'Plywood', 'PreCast', 'Stone', 'Stucco',
'VinylSd', 'Wd Sdng', 'WdShing'],
'MasVnrType': ['BrkCmn', 'BrkFace', 'CBlock', 'None', 'Stone'],
'Foundation': ['BrkTil', 'CBlock', 'PConc', 'Slab', 'Stone', 'Wood'],
'Heating': ['Floor', 'GasA', 'GasW', 'Grav', 'OthW', 'Wall'],
'Electrical': ['SBrkr', 'FuseA', 'FuseF', 'FuseP', 'Mix'],
'Functional': ['Typ', 'Min1', 'Min2', 'Mod', 'Maj1', 'Maj2', 'Sev', 'Sal'],
'GarageType': ['2Types', 'Attchd', 'Basment', 'BuiltIn', 'CarPort', 'Detchd', 'None'],
'GarageFinish': ['Fin', 'RFn', 'Unf', 'None'],
'PavedDrive': ['Y', 'P', 'N'],
'MiscFeature': ['Elev', 'Gar2', 'Othr', 'Shed', 'TenC', 'None'],
'MoSold': ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
'YrSold': ['2006', '2007', '2008', '2009', '2010'],
'SaleType': ['WD', 'CWD', 'VWD', 'New', 'COD', 'Con', 'ConLw', 'ConLI', 'ConLD', 'Oth'],
'SaleCondition': ['Normal', 'Abnorml', 'AdjLand', 'Alloca', 'Family', 'Partial']
},
'binary': {
'Street': ['Pave', 'Grvl'],
'CentralAir': ['Y', 'N']
},
'ordinal': {
'LotShape': ['None', 'IR3', 'IR2', 'IR1', 'Reg'],
'Utilities': ['None', 'NoSeWa', 'NoSewr', 'AllPub'],
'LandSlope': ['None', 'Sev', 'Mod', 'Gtl'],
'ExterQual': ['None', 'Po', 'Fa', 'TA', 'Gd', 'Ex'],
'ExterCond': ['None', 'Po', 'Fa', 'TA', 'Gd', 'Ex'],
'BsmtQual': ['None', 'Po', 'Fa', 'TA', 'Gd', 'Ex'],
'BsmtCond': ['None', 'Po', 'Fa', 'TA', 'Gd', 'Ex'],
'BsmtExposure': ['None', 'No', 'Mn', 'Av', 'Gd'],
'BsmtFinType1': ['None', 'Unf', 'LwQ', 'Rec', 'BLQ', 'ALQ', 'GLQ'],
'BsmtFinType2': ['None', 'Unf', 'LwQ', 'Rec', 'BLQ', 'ALQ', 'GLQ'],
'HeatingQC': ['None', 'Po', 'Fa', 'TA', 'Gd', 'Ex'],
'KitchenQual': ['None', 'Po', 'Fa', 'TA', 'Gd', 'Ex'],
'FireplaceQu': ['None', 'Po', 'Fa', 'TA', 'Gd', 'Ex'],
'GarageQual': ['None', 'Po', 'Fa', 'TA', 'Gd', 'Ex'],
'GarageCond': ['None', 'Po', 'Fa', 'TA', 'Gd', 'Ex'],
'Fence': ['None', 'MnWw', 'GdWo', 'MnPrv', 'GdPrv'],
'PoolQC': ['None', 'Fa', 'Ta', 'Gd', 'Ex'],
'OverallCond': list(range(0, 11)) ,
'OverallQual': list(range(0, 11)) ,
},
}
flatten = lambda l: [item for sublist in l for item in sublist]
FEATURES_CAT = flatten(w.keys() for w in FEATURES.values())
 FEATURES_NUM = list(filter(lambda x: x not in FEATURES_CAT and not x in ['Id'], train_csv.columns))
print("FEATURES_CAT")
 pp.pprint(FEATURES_CAT)
 print("
FEATURES_NUM")
 pp.pprint(FEATURES_NUM )
def decode_image(image_data):

 image = tf.image.decode_jpeg(image_data, channels=3)
 image = tf.cast(image, tf.float32)/ 255.0
image = tf.reshape(image, [*IMAGE_SIZE, 3])
 return image
def read_labeled_tfrecord(example):
LABELED_TFREC_FORMAT = {
"image": tf.io.FixedLenFeature([], tf.string),
"class": tf.io.FixedLenFeature([], tf.int64),
}
example = tf.io.parse_single_example(example, LABELED_TFREC_FORMAT)
 image = decode_image(example['image'])
 label = tf.cast(example['class'], tf.int32)
 return image, label
def read_unlabeled_tfrecord(example):
UNLABELED_TFREC_FORMAT = {
"image": tf.io.FixedLenFeature([], tf.string),
"id": tf.io.FixedLenFeature([], tf.string),
}
example = tf.io.parse_single_example(example, UNLABELED_TFREC_FORMAT)
 image = decode_image(example['image'])
 idnum = example['id']
return image, idnum
def load_dataset(filenames, labeled=True, ordered=False):

 ignore_order = tf.data.Options()
if not ordered:
ignore_order.experimental_deterministic = False
dataset = tf.data.TFRecordDataset(filenames, num_parallel_reads=AUTO)
 dataset = dataset.with_options(ignore_order)
 dataset = dataset.map(read_labeled_tfrecord if labeled else read_unlabeled_tfrecord, num_parallel_calls=AUTO)
 return dataset
def data_augment(image, label):
flag = random.randint(1,3)
 coef_1 = random.randint(70, 90)* 0.01
coef_2 = random.randint(70, 90)* 0.01
if flag == 1:
image = tf.image.random_flip_left_right(image, seed=SEED)
 elif flag == 2:
image = tf.image.random_flip_up_down(image, seed=SEED)
 else:
image = tf.image.random_crop(image, [int(IMAGE_SIZE[0]*coef_1), int(IMAGE_SIZE[0]*coef_2), 3],seed=SEED)
 image = random_blockout(image)
 return image, label
def get_training_dataset() :
dataset = load_dataset(TRAINING_FILENAMES, labeled=True)
 dataset = dataset.map(data_augment, num_parallel_calls=AUTO)
 dataset = dataset.repeat()
dataset = dataset.shuffle(2048)
 dataset = dataset.batch(BATCH_SIZE)
 dataset = dataset.prefetch(AUTO)
 return dataset
def get_validation_dataset() :
dataset = load_dataset(VALIDATION_FILENAMES, labeled=True, ordered=False)
 dataset = dataset.batch(BATCH_SIZE)
 dataset = dataset.cache()
dataset = dataset.prefetch(AUTO)
 return dataset
def get_test_dataset(ordered=False):
dataset = load_dataset(TEST_FILENAMES, labeled=False, ordered=ordered)
 dataset = dataset.batch(BATCH_SIZE)
 dataset = dataset.prefetch(AUTO)
 return dataset
def count_data_items(filenames):
n = [int(re.compile(r"-([0-9]*)\." ).search(filename ).group(1)) for filename in filenames]
return np.sum(n)
 NUM_TRAINING_IMAGES = count_data_items(TRAINING_FILENAMES)
 NUM_VALIDATION_IMAGES = count_data_items(VALIDATION_FILENAMES)
 NUM_TEST_IMAGES = count_data_items(TEST_FILENAMES)
 STEPS_PER_EPOCH = NUM_TRAINING_IMAGES // BATCH_SIZE
print('Dataset: {} training images, {} validation images, {} unlabeled test images'.format(NUM_TRAINING_IMAGES, NUM_VALIDATION_IMAGES, NUM_TEST_IMAGES))<init_hyperparams>
def remove_outliers(df: pd.DataFrame):
orig_count = len(df)
 df = df[~(( df['OverallQual'] == 4)&(df['SalePrice'] > 250_000)) ]
df = df[df['GrLivArea'] < 4600]
df = df[~(( df['GrLivArea'] > 3200)&(df['SalePrice'] < 300_000)) ]
df = df[df['GarageArea'] < 1200]
df = df[~(( df['SalePrice'] > 600_000)&(df['GarageArea'] > 800)) ]
df = df[df['TotalBsmtSF'] < 3000]
df = df[df['1stFlrSF'] < 2800]
removed = orig_count - len(df)
 print(f"remove_outliers: original count={orig_count} removed={removed}")
 return df
train_csv_no = remove_outliers(train_csv)
 display_scatter_SalePrice(train_csv_no, 'OverallQual', xticks=range(0, 11))
display_scatter_SalePrice(train_csv_no, 'GrLivArea')
 display_scatter_SalePrice(train_csv_no, 'GarageArea', xticks=range(0, 1500, 100))
display_scatter_SalePrice(train_csv_no, 'TotalBsmtSF', xticks=range(0, 3000, 200))
display_scatter_SalePrice(train_csv_no, '1stFlrSF', xticks=None )
LR_START = 0.00001
LR_MAX = 0.00005 * strategy.num_replicas_in_sync
LR_MIN = 0.00001
LR_RAMPUP_EPOCHS = 5
LR_SUSTAIN_EPOCHS = 0
LR_EXP_DECAY =.75
def lrfn(epoch):
if epoch < LR_RAMPUP_EPOCHS:
lr =(LR_MAX - LR_START)/ LR_RAMPUP_EPOCHS * epoch + LR_START
elif epoch < LR_RAMPUP_EPOCHS + LR_SUSTAIN_EPOCHS:
lr = LR_MAX
else:
lr =(LR_MAX - LR_MIN)* LR_EXP_DECAY**(epoch - LR_RAMPUP_EPOCHS - LR_SUSTAIN_EPOCHS)+ LR_MIN
return lr
lr_callback = tf.keras.callbacks.LearningRateScheduler(lrfn, verbose=True)
 rng = [i for i in range(EPOCHS)]
y = [lrfn(x)for x in rng]
plt.plot(rng, y)
 print("Learning rate schedule: {:.3g} to {:.3g} to {:.3g}".format(y[0], max(y), y[-1]))<choose_model_class>
lbl_enc = LabelEncoder()
def one_hot_encode_columns(df: pd.DataFrame, cols: [str])-> pd.DataFrame:
for col in cols:
df[col] = df[col].astype(CategoricalDtype(categories=FEATURES['categorical'][col]))
return pd.get_dummies(df, columns=cols, prefix=cols)
 def norm_dataset(df, cols):
df = df.copy()
for c in cols:
df[c] =(df[c] - train_stats['mean'][c])/ train_stats['std'][c]
return df
def denorm_dataset(df, cols):
df = df.copy()
for c in cols:
df[c] =(df[c] * train_stats['std'][c])+ train_stats['mean'][c]
return df
def clean_dataset(df: pd.DataFrame, is_training=True)-> pd.DataFrame:
df = df.copy()
if is_training:
df = df[df['GrLivArea'] < 4600]
df = df[~(( df['GrLivArea'] > 3200)&(df['SalePrice'] < 300_000)) ]
df = df[df['GarageArea'] < 1200]
df = df[df['TotalBsmtSF'] < 4000]
df = df[df['1stFlrSF'] < 2800]
if is_training:
id_col = df.pop('Id')
 df = norm_dataset(df, [f for f in FEATURES_NUM if f in df.columns])
 if is_training:
df['SalePrice'] = df['SalePrice'].astype('float64')
 df = one_hot_encode_columns(df, FEATURES['categorical'].keys())
 for col in FEATURES['ordinal'].keys() :
df[col].fillna('None', inplace=True)
 df[col] = df[col].astype(str)
 df[col] = lbl_enc.fit_transform(df[col])
 for col in FEATURES['binary'].keys() :
def_val = FEATURES['binary'][col][0]
df[col] = df[col].apply(lambda x: 1 if x == def_val else 0 ).astype('uint8')
 df = df.fillna(df.mean())
 return df
clean_train_set = clean_dataset(train_csv_no)
 clean_test_set = clean_dataset(test_csv, is_training=False)
 clean_train_set.info(verbose=True, null_counts=True )
def get_model(use_model):
base_model = use_model(weights='imagenet',
include_top=False, pooling='avg',
input_shape=(*IMAGE_SIZE, 3))
x = base_model.output
predictions = Dense(104, activation='softmax' )(x)
 return Model(inputs=base_model.input, outputs=predictions)
 with strategy.scope() :
model = get_model(MODEL_CLASS)
 model.compile(
 optimizer='nadam',
loss = 'sparse_categorical_crossentropy',
metrics=['sparse_categorical_accuracy'] 
)
<train_model>
print("Number of nulls in Dataset:", clean_train_set.isnull().sum().sum() )
history = model.fit(get_training_dataset() ,
steps_per_epoch=STEPS_PER_EPOCH,
epochs=EPOCHS,
callbacks=[lr_callback, ModelCheckpoint(filepath='my_denceNet_201.h5', monitor='val_loss',
save_best_only=True)],
validation_data=get_validation_dataset() ,
workers = 3 )<load_pretrained>
x = clean_train_set.drop(['SalePrice'], axis=1)
 y = clean_train_set['SalePrice']
print(f"len(x)={len(x)}, len(y)={len(y)}, shape(x)={x.shape}" )
model = tf.keras.models.load_model('my_denceNet_201.h5' )<predict_on_test>
lr_schedule = tf.keras.optimizers.schedules.InverseTimeDecay(
 0.001,
decay_steps=2000,
decay_rate=1,
staircase=False)
 def get_optimizer() :
return keras.optimizers.Adam(lr_schedule)
 LAYERS = 3
model = keras.Sequential([
Input(x.iloc[0].shape),
*deepflatten([
[
Dense(64, activation=keras.activations.tanh),
Dropout(1/LAYERS),
]
for _ in range(LAYERS)
 ]),
Dense(1),
])
 model.compile(
 optimizer=get_optimizer() ,
loss=keras.losses.MeanSquaredError() , 
)
 model.summary()
try:
history = model.fit(
 x, y,
epochs=1000,
validation_split=.2,
verbose=0,
callbacks=[
keras.callbacks.ModelCheckpoint("best_val_loss.h5", monitor='val_loss'),
keras.callbacks.EarlyStopping(monitor='val_loss', patience=100, min_delta=0.0005),
tfdocs.modeling.EpochDots() ,
], 
)
 except KeyboardInterrupt:
pass
print('
-------------- Training Done --------------')
 print(f"Last: loss={history.history['loss'][-1]}, val_loss={history.history['val_loss'][-1]}")
test_ds = get_test_dataset(ordered=True)
 print('Вычисляем предсказания...')
 test_images_ds = test_ds.map(lambda image, idnum: image)
 probabilities = model.predict(test_images_ds)
 predictions = np.argmax(probabilities, axis=-1)
 print(predictions)
 print('Создание файла submission.csv...')
 test_ids_ds = test_ds.map(lambda image, idnum: idnum ).unbatch()
test_ids = next(iter(test_ids_ds.batch(NUM_TEST_IMAGES)) ).numpy().astype('U')
 np.savetxt('submission.csv', np.rec.fromarrays([test_ids, predictions]), fmt=['%s', '%d'], delimiter=',', header='id,label', comments='' )<set_options>
x_test = clean_test_set.drop(['Id'], axis=1)
 x_test.sample(10 )
%matplotlib inline
print("Tensorflow version " + tf.__version__ )<define_variables>
y_test_predictions = model.predict(x_test)
 y_test_predictions =(y_test_predictions * train_stats['std']['SalePrice'])+ train_stats['mean']['SalePrice']
y_test_predictions[:10]
GCS_DS_PATH = KaggleDatasets().get_gcs_path("tpu-getting-started" )<define_variables>
submission = clean_test_set[['Id']]
submission['SalePrice'] = y_test_predictions
submission.to_csv("submission.csv", index=False)
 submission