Kaggle competition: ML 4 Money
model1 = XGBRegressor(n_estimators=40000)
 model1.fit(X_train, y_train_confirm)
 y_pred_confirm = model1.predict(test_data )<train_model>
import pandas as pd
from pathlib import Path
from sklearn.preprocessing import StandardScaler
from sklearn.ensemble import RandomForestRegressor
from sklearn.linear_model import LinearRegression
model2 = XGBRegressor(n_estimators=20000)
 model2.fit(X_train,y_train_fatality)
 y_pred_fat = model2.predict(test_data )<save_to_csv>
data_dir = Path('.. /input')
 train_df = pd.read_csv(data_dir / 'train.csv')
 test_df = pd.read_csv(data_dir / 'test.csv')
 sample_submission = pd.read_csv(data_dir / 'sampleSubmission.csv' )
df_sub = pd.DataFrame()
df_sub['ForecastId'] = Test_id
df_sub['ConfirmedCases'] = y_pred_confirm
df_sub['Fatalities'] = y_pred_fat
df_sub.to_csv('submission.csv', index=False )<import_modules>
features = ['di_minus', 'rsi', 'cci']
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import datetime
import catboost
import tensorflow as tf<set_options>
X_train = train_df[features]
y_train = train_df['y']
X_test = test_df[features]
device_lib.list_local_devices()<set_options>
scaler = StandardScaler(with_std=False)
 X_train = scaler.fit_transform(X_train)
 X_test = scaler.transform(X_test )
tf.test.is_gpu_available(
 cuda_only=False,
min_cuda_compute_capability=None
)<load_from_disk>
regressor = RandomForestRegressor(n_estimators=200, random_state=42, n_jobs=-1,
max_depth=7)
 regressor.fit(X_train, y_train)
 y_rfr = regressor.predict(X_test)
 print('RandomForestRegressor')
 print(y_rfr.min())
 print(y_rfr.max() )
df=pd.read_json('.. /input/whats-cooking-kernels-only/train.json', orient='records', dtype={"id":int, "cuisine":str,"ingredients":list})
 df_test=pd.read_json('.. /input/whats-cooking-kernels-only/test.json', orient='records', dtype={"id":int, "ingredients":list} )<count_unique_values>
regressor = CatBoostRegressor(silent=True)
 regressor.fit(X_train, y_train)
 y_cbr = regressor.predict(X_test)
 print('CatBoostRegressor')
 print(y_cbr.min())
 print(y_cbr.max() )
df['cuisine'].unique() , len(df['cuisine'].unique() )<count_unique_values>
regressor = AdaBoostRegressor()
regressor.fit(X_train, y_train)
 y_abr = regressor.predict(X_test)
 print('AdaBoostRegressor')
 print(y_abr.min())
 print(y_abr.max() )
lists = [df['ingredients'].values[i] for i in range(len(df)) ]
unique_ingredients = list(set(list(np.concatenate(lists))))
d = dict(zip(np.arange(len(unique_ingredients)) , unique_ingredients))
inv_d = dict(zip(unique_ingredients, np.arange(len(unique_ingredients))))<sort_values>
regressor = BaggingRegressor()
regressor.fit(X_train, y_train)
 y_br = regressor.predict(X_test)
 print('BaggingRegressor')
 print(y_br.min())
 print(y_br.max() )
sorted(inv_d.items() )<sort_values>
regressor = LinearRegression()
regressor.fit(X_train, y_train)
 y_lr = regressor.predict(X_test)
 print('LinearRegressor')
 print(y_lr.min())
 print(y_lr.max() )
dict(sorted(inv_d.items() , key=lambda item: item[1], reverse=True))<import_modules>
regressor = BayesianRidge()
regressor.fit(X_train, y_train)
 y_bridge = regressor.predict(X_test)
 print('BayesianRidge')
 print(y_bridge.min())
 print(y_bridge.max() )
import string
from nltk.corpus import stopwords
import re<set_options>
regressor = GradientBoostingRegressor()
regressor.fit(X_train, y_train)
 y_gbr = regressor.predict(X_test)
 print('GradientBoostingRegressor')
 print(y_gbr.min())
 print(y_gbr.max() )
chars = re.escape(string.punctuation)
 chars<define_variables>
sample_submission['expected'] = y_test
<count_unique_values><EOS> 
sample_submission.to_csv('submission.csv', index=False )