Kaggle competition: Einfhrung in Kaggle InClass Competitions</title>
<SOS> metric: mse Kaggle data source: OED19-Regression<define_search_space>
%matplotlib inline
aptos19_stats =([0.42, 0.22, 0.075], [0.27, 0.15, 0.081] )<load_from_csv>
dftrain = pd.read_csv('.. /input/train.csv',index_col='Id')
 xtest = pd.read_csv('.. /input/Xtest.csv',index_col='Id')
 dftrain.head()
test_labels = pd.read_csv(path/'sample_submission.csv')
 test = ImageList.from_df(test_labels, path = path_test, suffix = '.png' )<split>
xtrain = dftrain.x.values.reshape(-1,1)
 ytrain = dftrain.y.values.reshape(-1,1 )
src =(ImageList.from_df(labels, path = path_train, suffix = '.png')
.split_by_rand_pct(seed = 2019)
.label_from_df(cols = 'diagnosis')
.add_test(test))<normalization>
reg = LinearRegression()
data =(
 src.transform(
 tfms,
size = 446,
resize_method=ResizeMethod.SQUISH,
padding_mode='zeros' 
)
.databunch(bs=16)
.normalize(aptos19_stats))<choose_model_class>
reg.fit(xtrain,ytrain )
kappa = KappaScore("quadratic")
 kappa<compute_test_metric>
yhat_train = reg.predict(xtrain ).ravel()
yhat_test = reg.predict(xtest ).ravel()
def quadratic_kappa(y_hat, y):
return torch.tensor(cohen_kappa_score(torch.round(y_hat), y, weights='quadratic'),device='cuda:0' )<choose_model_class>
submission.to_csv('testsubmission.csv',header=True )