Kaggle competition: San Francisco Crime Classification
<SOS> metric: MulticlassLoss Kaggle data source: san-francisco-crime-classification<define_variables>
z = zipfile.ZipFile('.. /input/train.csv.zip')
 df = pd.read_csv(z.open('train.csv'))
z = zipfile.ZipFile('.. /input/test.csv.zip')
 test = pd.read_csv(z.open('test.csv'))
def hr_func(ts):
return(float )(ts[11:13])
 df['Dates'] = df['Dates'].apply(hr_func)
 df['HourCos']=0
df['HourSin']=0
def hourtocos(ts):
ts=ts*2*math.pi/24
return math.cos(ts)
 def hourtosin(ts):
ts=ts*2*math.pi/24
return math.sin(ts)
 df['HourCos']=df['Dates'].apply(hourtocos)
 df['HourSin']=df['Dates'].apply(hourtosin)
 X = df[['X','Y','HourCos','HourSin']]
Y=df[['Category']]
clf=RandomForestClassifier(n_estimators=100,min_samples_split=350)
 clf.fit(X,Y)
 outcomes = clf.predict_proba()
<feature_engineering><EOS> 
outcomes<0.01