Kaggle competition: NFL Big Data Bowl
<SOS> metric: CRPS Kaggle data source: nfl-big-data-bowl<train_model>
import numpy as np
import pandas as pd
from tqdm import tqdm_notebook
import matplotlib.pyplot as plt
from kaggle.competitions import nflrush
mt = MainTransformer()
ft = FeatureTransformer()
transformers = {'ft': ft}
regressor_model2 = RegressorModel(model_wrapper=LGBWrapper_regr())
 regressor_model2.fit(X=X, y=y, folds=folds, params=params, preprocesser=mt, transformers=transformers,
eval_metric='cappa', cols_to_drop=cols_to_drop )<prepare_x_and_y>
train_df = pd.read_csv('/kaggle/input/nfl-big-data-bowl-2020/train.csv', low_memory=False )
Xtest = pd.DataFrame(pca.transform(reduce_test.drop(columns=["installation_id"],inplace=False)))
 Xtest["installation_id"] = reduce_test["installation_id"]<find_best_model_class>
y_train = train_df.loc[range(0, 509762, 22), "Yards"]
%%time
pr1 = regressor_model2.predict(X)
 optR = OptimizedRounder()
optR.fit(pr1.reshape(-1,), y)
 coefficients = optR.coefficients()<predict_on_test>
y_pred, y_true = np.zeros(( len(y_train), 199)) , np.zeros(( len(y_train), 199))
for i in range(len(y_train)) :
y_pred[i, :] = sigmoid(0.42 *(np.arange(-99, 100)- MEDIAN_YARDS))
for i, p in enumerate(y_train):
for j in range(-99, 100):
if j >= p:
y_true[i, j + 99] = 1
print("Validation score:", np.sum(np.power(y_pred - y_true, 2)) /(199 * len(y_train)) )
<save_to_csv><EOS> 
env = nflrush.make_env()
for(test_df, sample_prediction_df)in tqdm_notebook(env.iter_test()):
y_test_pred = sigmoid(0.42 *(np.arange(-99, 100)- MEDIAN_YARDS))
env.predict(pd.DataFrame(data=[y_test_pred], columns=sample_prediction_df.columns))
env.write_submission_file()