Kaggle competition: NBA Rookies
<SOS> metric: categorizationaccuracy Kaggle data source: nba-rookies<save_to_csv>
print(os.listdir(".. /input"))
submission = pd.DataFrame({"key": keys, "fare_amount": preds})
 submission.to_csv(f'{PATH_WORKING}submission.csv', index=False )<define_variables>
train = pd.read_csv(".. /input/train.csv")
 test = pd.read_csv(".. /input/test.csv")
preTrainedModel = False
loadOnlyWeights = False
useBestModel = True
EPOCH = 32
BATCH_SIZE = 1024
VALIDATION_SIZE = 500000
TRAINING_SIZE = 6000000
INTEL_AI_DEV_CLOUD = False 
<set_options>
if INTEL_AI_DEV_CLOUD:
config = tf.ConfigProto(intra_op_parallelism_threads = 6,
inter_op_parallelism_threads = 2,
allow_soft_placement = True,
device_count = {'CPU': 6 })
 session = tf.Session(config = config)
 K.set_session(session)
 os.environ["OMP_NUM_THREADS"] = "6"
os.environ["KMP_BLOCKTIME"] = "30"
os.environ["KMP_SETTINGS"] = "1"
os.environ["KMP_AFFINITY"]= "granularity=fine,verbose,compact,1,0" 
<import_modules>
X = train.values[:,2:20]
y = train.values[:,21]
y = y.astype('int')
print(keras.__version__)
<define_variables>
imputer = Imputer(missing_values = 'NaN', strategy = 'mean', axis = 0)
 imputer = imputer.fit(X)
 X = imputer.transform(X)
JFK =(-73.7822222222, 40.6441666667)
 NYC =(-74.0063889, 40.7141667)
 EWR =(-74.175, 40.6897222222)
 LGA =(-73.8739659, 40.7769271 )<compute_test_metric>
Xt = test.values[:,2:20]
imputer = Imputer(missing_values = 'NaN', strategy = 'mean', axis = 0)
 imputer = imputer.fit(Xt)
 Xt = imputer.transform(Xt)
def minkowski_distance(x1, x2, y1, y2, p):
return(( abs(x2 - x1)** p)+(abs(y2 - y1)) ** p)**(1 / p )<compute_test_metric>
sc = StandardScaler()
sct = StandardScaler()
X = sc.fit_transform(X)
 Xt = sc.transform(Xt)
def minkowski_distance_3D(x1, x2, y1, y2, z1, z2, p):
return(( abs(x2 - x1)** p)+(abs(y2 - y1)** p)+(abs(z2 - z1)** p)) **(1 / p )<feature_engineering>
clf = RandomForestClassifier(n_estimators = 200 , criterion = 'entropy')
 clf.fit(X, y)
 cols = { 'PlayerID': [i+901 for i in range(440)] , 'TARGET_5Yrs': [clf.predict([Xt[i]])[0] for i in range(440)] }
submission = pd.DataFrame(cols)
 print(submission)
 submission.to_csv("submission.csv", index=False)