Kaggle competition: Mercari Price Suggestion Challenge
<SOS> metric: RMSLE Kaggle data source: mercari-price-suggestion-challenge<save_to_csv>
pd.set_option('display.max_rows', 100)
 pd.set_option('display.max_columns', 500)
 pd.set_option('display.max_colwidth', None)
 pd.set_option('display.float_format', lambda x: '%.5f' % x)
 for dirname, _, filenames in os.walk('/kaggle/input'):
for filename in filenames:
print(os.path.join(dirname, filename))
submission = pd.DataFrame({'image_id': image_names, 'label': test_preds})
 submission.to_csv('submission.csv', index=False)
 display(submission.head() )<install_modules>
!apt-get install p7zip
!p7zip -d -f -k /kaggle/input/mercari-price-suggestion-challenge/train.tsv.7z
!unzip -o /kaggle/input/mercari-price-suggestion-challenge/sample_submission_stg2.csv.zip
!unzip -o /kaggle/input/mercari-price-suggestion-challenge/test_stg2.tsv.zip
!pip install --quiet.. /input/kerasapplications/keras-team-keras-applications-3b180cb
!pip install --quiet /kaggle/input/efficientnet-git<import_modules>
train = pd.read_csv("train.tsv", low_memory=False, sep='\t')
 test = pd.read_csv("test_stg2.tsv", low_memory=False, sep='\t')
 train.info(memory_usage="deep" )
Flatten,GlobalAveragePooling2D,BatchNormalization, Activation
print(tf.__version__ )<find_best_params>
df = pd.concat([train.drop(["train_id", "price"], axis=1 ).nunique() , test.drop(["test_id"], axis=1 ).nunique() ], axis=1)
 df.columns = ["Train", "Test"]
df.T
try:
tpu = tf.distribute.cluster_resolver.TPUClusterResolver()
print(f'Running on TPU {tpu.master() }')
 except ValueError:
tpu = None
if tpu:
tf.config.experimental_connect_to_cluster(tpu)
 tf.tpu.experimental.initialize_tpu_system(tpu)
 strategy = tf.distribute.experimental.TPUStrategy(tpu)
 else:
strategy = tf.distribute.get_strategy()
AUTO = tf.data.experimental.AUTOTUNE
REPLICAS = strategy.num_replicas_in_sync
print(f'REPLICAS: {REPLICAS}' )<define_variables>
train["name"].value_counts() [:5], test["name"].value_counts() [:5]
SEED = 100
DEBUG = False
WANDB = False
VALIDATION_SIZE = 0.2
BATCH_SIZE = 32 *REPLICAS
LEARNING_RATE = 3e-5 * REPLICAS
EPOCHS=40
MODEL_NAME = "EfficentNetB4"
N_FOLDS = 5
TTA = True
N_TTA = 7
T_1 = 0.2
T_2 = 1.2
SMOOTH_FRACTION = 0.01
N_ITER = 5
HEIGHT = 512
WIDTH = 512
HEIGHT_RS = 512
WIDTH_RS = 512
CHANNELS = 3
N_CLASSES = 5
MODEL_SAVE_PATH = ""
if DEBUG:
EPOCHS = 2 
<normalization>
train["brand_name"].value_counts() [:5], test["brand_name"].value_counts() [:5]
def transform_rotation(image, height, rotation):
DIM = height
XDIM = DIM%2
rotation = rotation * tf.random.uniform([1],dtype='float32')
 rotation = math.pi * rotation / 180.
 c1 = tf.math.cos(rotation)
 s1 = tf.math.sin(rotation)
 one = tf.constant([1],dtype='float32')
 zero = tf.constant([0],dtype='float32')
 rotation_matrix = tf.reshape(tf.concat([c1,s1,zero, -s1,c1,zero, zero,zero,one],axis=0),[3,3])
 x = tf.repeat(tf.range(DIM//2,-DIM//2,-1), DIM)
 y = tf.tile(tf.range(-DIM//2,DIM//2),[DIM])
 z = tf.ones([DIM*DIM],dtype='int32')
 idx = tf.stack([x,y,z])
 idx2 = K.dot(rotation_matrix,tf.cast(idx,dtype='float32'))
idx2 = K.cast(idx2,dtype='int32')
 idx2 = K.clip(idx2,-DIM//2+XDIM+1,DIM//2)
 idx3 = tf.stack([DIM//2-idx2[0,], DIM//2-1+idx2[1,]])
 d = tf.gather_nd(image, tf.transpose(idx3))
return tf.reshape(d,[DIM,DIM,3])
 def transform_shear(image, height, shear):
DIM = height
XDIM = DIM%2
shear = shear * tf.random.uniform([1],dtype='float32')
 shear = math.pi * shear / 180.
 one = tf.constant([1],dtype='float32')
 zero = tf.constant([0],dtype='float32')
 c2 = tf.math.cos(shear)
 s2 = tf.math.sin(shear)
 shear_matrix = tf.reshape(tf.concat([one,s2,zero, zero,c2,zero, zero,zero,one],axis=0),[3,3])
 x = tf.repeat(tf.range(DIM//2,-DIM//2,-1), DIM)
 y = tf.tile(tf.range(-DIM//2,DIM//2),[DIM])
 z = tf.ones([DIM*DIM],dtype='int32')
 idx = tf.stack([x,y,z])
 idx2 = K.dot(shear_matrix,tf.cast(idx,dtype='float32'))
idx2 = K.cast(idx2,dtype='int32')
 idx2 = K.clip(idx2,-DIM//2+XDIM+1,DIM//2)
 idx3 = tf.stack([DIM//2-idx2[0,], DIM//2-1+idx2[1,]])
 d = tf.gather_nd(image, tf.transpose(idx3))
return tf.reshape(d,[DIM,DIM,3])
 def data_augment_cutout(image, min_mask_size=(int(HEIGHT *.1), int(HEIGHT *.1)) ,
max_mask_size=(int(HEIGHT *.125), int(HEIGHT *.125))):
p_cutout = tf.random.uniform([], 0, 1.0, dtype=tf.float32)
 if p_cutout >.85:
n_cutout = tf.random.uniform([], 10, 15, dtype=tf.int32)
 image = random_cutout(image, HEIGHT, WIDTH,
min_mask_size=min_mask_size, max_mask_size=max_mask_size, k=n_cutout)
 elif p_cutout >.6:
n_cutout = tf.random.uniform([], 5, 10, dtype=tf.int32)
 image = random_cutout(image, HEIGHT, WIDTH,
min_mask_size=min_mask_size, max_mask_size=max_mask_size, k=n_cutout)
 elif p_cutout >.25:
n_cutout = tf.random.uniform([], 2, 5, dtype=tf.int32)
 image = random_cutout(image, HEIGHT, WIDTH,
min_mask_size=min_mask_size, max_mask_size=max_mask_size, k=n_cutout)
 else:
image = random_cutout(image, HEIGHT, WIDTH,
min_mask_size=min_mask_size, max_mask_size=max_mask_size, k=1)
 return image
def random_cutout(image, height, width, channels=3, min_mask_size=(10, 10), max_mask_size=(80, 80), k=1):
assert height > min_mask_size[0]
assert width > min_mask_size[1]
assert height > max_mask_size[0]
assert width > max_mask_size[1]
for i in range(k):
mask_height = tf.random.uniform(shape=[], minval=min_mask_size[0], maxval=max_mask_size[0], dtype=tf.int32)
 mask_width = tf.random.uniform(shape=[], minval=min_mask_size[1], maxval=max_mask_size[1], dtype=tf.int32)
 pad_h = height - mask_height
pad_top = tf.random.uniform(shape=[], minval=0, maxval=pad_h, dtype=tf.int32)
 pad_bottom = pad_h - pad_top
pad_w = width - mask_width
pad_left = tf.random.uniform(shape=[], minval=0, maxval=pad_w, dtype=tf.int32)
 pad_right = pad_w - pad_left
cutout_area = tf.zeros(shape=[mask_height, mask_width, channels], dtype=tf.uint8)
 cutout_mask = tf.pad([cutout_area], [[0,0],[pad_top, pad_bottom], [pad_left, pad_right], [0,0]], constant_values=1)
 cutout_mask = tf.squeeze(cutout_mask, axis=0)
 image = tf.multiply(tf.cast(image, tf.float32), tf.cast(cutout_mask, tf.float32))
return image<define_search_space>
train["category_name"].value_counts() [:5], test["category_name"].value_counts() [:5]
def data_augment(image, label):
p_rotation = tf.random.uniform([], 0, 1.0, dtype=tf.float32)
 p_spatial = tf.random.uniform([], 0, 1.0, dtype=tf.float32)
 p_rotate = tf.random.uniform([], 0, 1.0, dtype=tf.float32)
 p_pixel_1 = tf.random.uniform([], 0, 1.0, dtype=tf.float32)
 p_pixel_2 = tf.random.uniform([], 0, 1.0, dtype=tf.float32)
 p_pixel_3 = tf.random.uniform([], 0, 1.0, dtype=tf.float32)
 p_shear = tf.random.uniform([], 0, 1.0, dtype=tf.float32)
 p_crop = tf.random.uniform([], 0, 1.0, dtype=tf.float32)
 p_cutout = tf.random.uniform([], 0, 1.0, dtype=tf.float32)
 flip_left = tf.random.uniform([], 0, 1.0, dtype=tf.float32)
 flip_right = tf.random.uniform([], 0, 1.0, dtype=tf.float32)
 if p_rotation >.2:
if p_rotation >.6:
image = transform_rotation(image, HEIGHT, rotation=10.)
else:
image = transform_rotation(image, HEIGHT, rotation=-10.)
if flip_left>0.5:
image = tf.image.random_flip_left_right(image)
 if flip_right>0.5 :
image = tf.image.random_flip_up_down(image)
 image = tf.image.resize(image, size=[HEIGHT, WIDTH])
 return image, label<define_variables>
train["item_description"].value_counts() [:5], test["item_description"].value_counts() [:5]
copyfile(src = ".. /input/bitempered-logistic-loss-tensorflow-v2/bi_tempered_loss.py", dst = ".. /working/loss.py")
<compute_train_metric>
train.drop(train[train["price"] <= 0].index, inplace=True)
 train.reset_index(inplace=True, drop=True )
with strategy.scope() :
class BiTemperedLogisticLoss(tf.keras.losses.Loss):
def __init__(self, t1, t2, lbl_smth, n_iter):
super(BiTemperedLogisticLoss, self ).__init__()
self.t1 = t1
self.t2 = t2
self.lbl_smth = lbl_smth
self.n_iter = n_iter
def call(self, y_true, y_pred):
return bi_tempered_logistic_loss(y_pred, y_true, self.t1, self.t2, self.lbl_smth, self.n_iter )<define_variables>
def process_data(df):
df[["First_category", "Second_category", "Third_category"]] = df["category_name"].str.split('/', 2, expand=True)
 df.drop("category_name", axis=1, inplace=True)
 df["item_description"] = df["item_description"].replace({"No description yet": np.nan})
 df["Category_was_missing"] = df["First_category"].isna()
df["Brand_was_missing"] = df["brand_name"].isna()
df["Description_was_missing"] = df["item_description"].isna()
for i in ["brand_name", "First_category", "Second_category", "Third_category", "item_description"]:
df[i] = df[i].fillna("missing")
 df["Price_was_in_description"] = df["item_description"].str.contains("\[rm\]")
 df["Price_was_in_name"] = df["name"].str.contains("\[rm\]")
 df["descr_len"] = df["item_description"].str.len()
df["descr_len"] = pd.cut(df["descr_len"], np.arange(0, 1055, 5), right=False)
 df["descr_len"] = df["descr_len"].astype("string")
 stop_words = set(stopwords.words("english"))
for column in ["item_description", "brand_name", "name"]:
processed_column = []
for text_row in df[column]:
text_row = text_row.replace('[rm]', '')
 text_row = re.sub('[^A-Za-z0-9]+', ' ', text_row)
 if column != "brand_name":
text_row = ' '.join(word for word in text_row.lower().split() if word not in stop_words)
 processed_column.append(text_row.strip())
 df[column] = processed_column
for column in ["First_category", "Second_category", "Third_category"]:
processed_column = []
for text_row in df[column]:
text_row = text_row.replace(' ','')
 text_row = text_row.replace('&','_')
 text_row = re.sub('[^A-Za-z0-9_]+', ' ', text_row)
 processed_column.append(text_row.lower().strip())
 df[column] = processed_column
return df
files_path = '.. /input/cassava-leaf-disease-classification/test_images'
TEST_FILENAMES = tf.io.gfile.glob('.. /input/cassava-leaf-disease-classification/test_tfrecords/*')
 model_base_path = '.. /input/cassava-efficientnetb4'
model_path_list = os.listdir(model_base_path)
 model_path_list = ['EfficentNet4_best_btl_fold_0_.h5',
'EfficentNet4_best_btl_fold_1_.h5',
'EfficentNet4_best_btl_fold_2_.h5',
]
test_preds = np.zeros(( len(os.listdir(files_path)) , N_CLASSES))
for model_path in model_path_list:
print("Model: ", model_path)
 tf.keras.backend.clear_session()
model = tf.keras.models.load_model(os.path.join(model_base_path,model_path),
custom_objects={'loss': BiTemperedLogisticLoss(t1=T_1, t2=T_2, lbl_smth=SMOOTH_FRACTION, n_iter=N_ITER)},
compile=False)
 if TTA:
for step in range(N_TTA):
print(f"TTA step: {step+1}/{N_TTA}")
 test_ds = get_dataset(TEST_FILENAMES, labeled=False, ordered=True, augment = True)
 x_test = test_ds.map(lambda image, image_name: image)
 test_preds += model.predict(x_test)/len(model_path_list)
 else:
test_ds = get_dataset(TEST_FILENAMES, labeled=False, ordered=True)
 x_test = test_ds.map(lambda image, image_name: image)
 test_preds += model.predict(x_test)/len(model_path_list )<save_to_csv>
train = process_data(train )
test_preds = np.argmax(test_preds, axis=-1)
 image_names = [img_name.numpy().decode('utf-8')for img, img_name in iter(test_ds.unbatch())]
submission = pd.DataFrame({'image_id': image_names, 'label': test_preds})
 submission.to_csv('submission.csv', index=False)
 display(submission.head() )<define_variables>
def make_tokens_count_plot(count_vercorizer, matrix, column_name, set_name="train"):
if set_name == "train":
color = "lightcoral"
else:
color = "steelblue"
df = pd.DataFrame()
df["tokens"] = count_vercorizer.get_feature_names()
df["counts"] = np.asarray(matrix.sum(axis=0)) [0]
x = df.sort_values("counts", axis=0, ascending=False ).head(50)["tokens"]
y = df.sort_values("counts", axis=0, ascending=False ).head(50)["counts"]
fig, ax = plt.subplots(figsize=(15, 6))
ax.bar(x, y, color=color, edgecolor="black")
 ax.set_title(f"Most popular words in the {column_name} column of the {set_name} dataset", fontsize=20, pad=15)
 ax.set_ylabel("Count", fontsize=14, labelpad=15)
 ax.set_xlabel("Word", fontsize=14, labelpad=10)
 ax.set_xticks(x)
 ax.set_xticklabels(x, rotation = 60, ha="right", rotation_mode='anchor')
 ax.tick_params(axis="x", labelsize=14)
 ax.tick_params(axis="y", labelsize=14)
 ax.grid(axis="y")
 ax.margins(0.025, 0.05)
 plt.show() ;
sys.path = [
'.. /input/efficientnet-pytorch/EfficientNet-PyTorch/EfficientNet-PyTorch-master',
] + sys.path
sys.path = [
'.. /input/ttach-kaggle/ttach/',
] + sys.path 
<set_options>
def get_transformed_train_valid_data(df, y, cat_features):

 X_train, X_valid, y_train, y_valid = train_test_split(df, y, test_size=0.2, random_state=42)
 label_binarizers = []
binarized_columns = []
count_vercorizers = []
vectorized_columns = []
for column in cat_features:
binarizer = LabelBinarizer(sparse_output=True)
 binarized_column = binarizer.fit_transform(X_train[column])
 label_binarizers.append(binarizer)
 binarized_columns.append(binarized_column)
 vectorizer = CountVectorizer(min_df=7, max_features=20000)
 vectorized_column = vectorizer.fit_transform(X_train["name"])
 count_vercorizers.append(vectorizer)
 vectorized_columns.append(vectorized_column)
 make_tokens_count_plot(vectorizer, vectorized_column, "name", "train")
 vectorizer = CountVectorizer(min_df=15, ngram_range=(1, 2), max_features=60000)
 vectorized_column = vectorizer.fit_transform(X_train["item_description"])
 count_vercorizers.append(vectorizer)
 vectorized_columns.append(vectorized_column)
 make_tokens_count_plot(vectorizer, vectorized_column, "item_description", "train")
 vectorizer = CountVectorizer(min_df=30, ngram_range=(3, 3), max_features=10000)
 vectorized_column = vectorizer.fit_transform(X_train["item_description"])
 count_vercorizers.append(vectorizer)
 vectorized_columns.append(vectorized_column)
 make_tokens_count_plot(vectorizer, vectorized_column, "item_description", "train")
 print(f"Name columns vectorized shape is {vectorized_columns[0].shape}")
 print(f"Item_description columns vectorized shape is {vectorized_columns[1].shape}")
 print(f"Item_description columns vectorized(1,3)shape is {vectorized_columns[2].shape}")
 X_train_stack = hstack(( binarized_columns[0], binarized_columns[1], binarized_columns[2],
binarized_columns[3], binarized_columns[4], binarized_columns[5],
binarized_columns[6], binarized_columns[7], binarized_columns[8],
binarized_columns[9], binarized_columns[10], binarized_columns[11],
vectorized_columns[0], vectorized_columns[1], vectorized_columns[2])).tocsr()
X_valid_stack = get_transformed_test_data(X_valid, cat_features, label_binarizers, count_vercorizers)
 return X_train_stack, X_valid_stack, y_train, y_valid, label_binarizers, count_vercorizers
def get_transformed_test_data(df, cat_features, label_binarizers, count_vercorizers):

 binarized_columns = []
vectorized_columns = []
for num, column in enumerate(cat_features):
binarizer = label_binarizers[num]
binarized_column = binarizer.transform(df[column])
 binarized_columns.append(binarized_column)
 vectorizer = count_vercorizers[0]
vectorized_column = vectorizer.transform(df["name"])
 vectorized_columns.append(vectorized_column)
 make_tokens_count_plot(vectorizer, vectorized_column, "name", "valid/test")
 vectorizer = count_vercorizers[1]
vectorized_column = vectorizer.transform(df["item_description"])
 vectorized_columns.append(vectorized_column)
 make_tokens_count_plot(vectorizer, vectorized_column, "item_description", "valid/test")
 vectorizer = count_vercorizers[2]
vectorized_column = vectorizer.transform(df["item_description"])
 vectorized_columns.append(vectorized_column)
 make_tokens_count_plot(vectorizer, vectorized_column, "item_description", "valid/test")
 print(f"Name columns vectorized shape is {vectorized_columns[0].shape}")
 print(f"Item_description columns vectorized shape is {vectorized_columns[1].shape}")
 print(f"Item_description columns vectorized(1,3)shape is {vectorized_columns[2].shape}")
 X_test_stack = hstack(( binarized_columns[0], binarized_columns[1], binarized_columns[2],
binarized_columns[3], binarized_columns[4], binarized_columns[5],
binarized_columns[6], binarized_columns[7], binarized_columns[8],
binarized_columns[9], binarized_columns[10], binarized_columns[11],
vectorized_columns[0], vectorized_columns[1], vectorized_columns[2])).tocsr()
return X_test_stack
def get_transformed_train_data(df, cat_features):

 label_binarizers = []
binarized_columns = []
count_vercorizers = []
vectorized_columns = []
for column in cat_features:
binarizer = LabelBinarizer(sparse_output=True)
 binarized_column = binarizer.fit_transform(df[column])
 label_binarizers.append(binarizer)
 binarized_columns.append(binarized_column)
 vectorizer = CountVectorizer(min_df=7, max_features=20000)
 vectorized_column = vectorizer.fit_transform(df["name"])
 count_vercorizers.append(vectorizer)
 vectorized_columns.append(vectorized_column)
 make_tokens_count_plot(vectorizer, vectorized_column, "name", "train")
 vectorizer = CountVectorizer(min_df=15, ngram_range=(1, 2), max_features=60000)
 vectorized_column = vectorizer.fit_transform(df["item_description"])
 count_vercorizers.append(vectorizer)
 vectorized_columns.append(vectorized_column)
 make_tokens_count_plot(vectorizer, vectorized_column, "item_description", "train")
 vectorizer = CountVectorizer(min_df=30, ngram_range=(3, 3), max_features=10000)
 vectorized_column = vectorizer.fit_transform(df["item_description"])
 count_vercorizers.append(vectorizer)
 vectorized_columns.append(vectorized_column)
 make_tokens_count_plot(vectorizer, vectorized_column, "item_description", "train")
 print(f"Name columns vectorized shape is {vectorized_columns[0].shape}")
 print(f"Item_description columns vectorized shape is {vectorized_columns[1].shape}")
 print(f"Item_description columns vectorized(1,3)shape is {vectorized_columns[2].shape}")
 X_train_stack = hstack(( binarized_columns[0], binarized_columns[1], binarized_columns[2],
binarized_columns[3], binarized_columns[4], binarized_columns[5],
binarized_columns[6], binarized_columns[7], binarized_columns[8],
binarized_columns[9], binarized_columns[10], binarized_columns[11],
vectorized_columns[0], vectorized_columns[1], vectorized_columns[2])).tocsr()
return X_train_stack, label_binarizers, count_vercorizers
warnings.filterwarnings('ignore' )<define_variables>
cat_features = ["item_condition_id", "First_category", "Second_category", "Third_category",
"shipping", "brand_name", "Description_was_missing", "Price_was_in_name",
"Price_was_in_description", "Brand_was_missing", "Category_was_missing",
"descr_len"]
X_train, label_binarizers, count_vercorizers = get_transformed_train_data(train.drop(["train_id", "price"], axis=1), cat_features)
 y_train = np.log1p(train["price"] )
DIR_INPUT = '/kaggle/input/cassava-leaf-disease-classification'
DIR_WEIGHTS = '/kaggle/input/cassava-pytorch-starter-train'
SEED = 42
N_FOLDS = 1
BATCH_SIZE = 16
SIZE = 512
CROP = 512
init_lr = 5e-5
n_epochs = 5<categorify>
for column in train.columns:
train.drop(column, axis=1, inplace=True)
 del train
gc.collect()
modelname="efficientnet-b0"
modelname2="efficientnet-b2"
class enetv2(nn.Module):
def __init__(self, out_dim=1, ModelName="efficientnet-b0"):
super(enetv2, self ).__init__()
self.basemodel = EfficientNet.from_name(ModelName)
 self.myfc = nn.Linear(self.basemodel._fc.in_features, out_dim)
 self.basemodel._fc = nn.Identity()
def extract(self, x):
return self.basemodel(x)
 def forward(self, x):
x = self.basemodel(x)
 x = self.myfc(x)
 return x<concatenate>
def rmsle(y_true, y_preds):
return np.sqrt(mean_squared_log_error(y_true, y_preds))
def get_scores(model, X_train, X_valid, y_train, y_valid):
train_preds = model.predict(X_train)
 val_preds = model.predict(X_valid)
 scores = {"Training MAE": mean_absolute_error(y_train, train_preds),
"Validation MAE": mean_absolute_error(y_valid, val_preds),
"Training RMSLE": rmsle(y_train, train_preds),
"Validation RMSLE": rmsle(y_valid, val_preds),
"Training R^2": model.score(X_train, y_train),
"Validation R^2": model.score(X_valid, y_valid)}
return scores
transforms_test = A.Compose([
A.Resize(height=SIZE, width=SIZE, p=1.0),
] )<load_from_csv>
%%time
model = SGDRegressor(alpha=0.000001,
penalty="l2",
random_state=42,
loss="epsilon_insensitive",
max_iter=50000)
 model.fit(X_train, y_train )
submission_df = pd.read_csv(DIR_INPUT + '/sample_submission.csv')
 submission_df.iloc[:, 1] = 0
submission_df.head()<prepare_output>
del X_train, y_train
gc.collect()
if submission_df.shape[0] == 1:
submission_df = pd.DataFrame([{'image_id': '2216849948.jpg', 'label': 0},{'image_id': '2216849948.jpg', 'label': 0}])
 submission_df.reset_index(drop=True, inplace=True)
 commit = True
else:
commit = False
submission_df.head()<load_pretrained>
preds = pd.DataFrame(columns = ["test_id", "price"])
 preds["test_id"] = test["test_id"]
dataset_test = CassavaDataset(df=submission_df, dataset='test', transforms=transforms_test)
 dataloader_test = DataLoader(dataset_test, batch_size=BATCH_SIZE, num_workers=4, shuffle=False )<load_pretrained>
test = process_data(test.drop("test_id", axis=1))
X_test = get_transformed_test_data(test, cat_features, label_binarizers, count_vercorizers )
<feature_engineering><EOS> 
preds["price"] = np.expm1(model.predict(X_test))
preds.to_csv('submission.csv', index=False)
 preds.head()