Kaggle competition: [DM&PR WS18/19] Machine learning competition
print(test[["shop_id", "item_id"]].duplicated().sum() )<count_values>
import pandas as pd
import numpy as np
from sklearn.tree import DecisionTreeClassifier
test["shop_id"].value_counts().sort_values() [:10] 
<count_values>
df_train = pd.read_csv('.. /input/train.csv')
 df_test = pd.read_csv('.. /input/test.csv')
 sample_sub = pd.read_csv('.. /input/sampleSubmission.csv' )
test["shop_id"].value_counts().sort_values() [-5:]<count_values>
X = df_train.profession.values
y = df_train.target.values
X_test = df_test.profession.values
test["item_id"].value_counts().sort_values() [:10]<count_values>
model = DecisionTreeClassifier(max_depth=4)
 model.fit(X.reshape(-1,1),y)
 y_hat = model.predict_proba(X_test.reshape(-1,1)) [:,1]
test["item_id"].value_counts().sort_values() [-10:]<define_variables>
sample_sub['target'] = y_hat
mat = np.zeros(( shops.shape[0], shops.shape[0]))<compute_test_metric>
sample_sub.to_csv('v_01.csv', index=False )