Kaggle competition: Forest Cover Type Prediction
<SOS> metric: CategorizationAccuracy Kaggle data source: forest-cover-type-prediction<import_modules>
import pandas as pd
from sklearn import ensemble
from fastai.vision import *
from fastai import *
from fastai.metrics import error_rate
import pandas as pd
import torch<load_from_csv>
file_train = ".. /input/train.csv"
file_test = ".. /input/test.csv"
df_train = pd.read_csv(file_train)
 df_test = pd.read_csv(file_test)
 df_train.head()
path =".. /input/"
train_df=pd.read_csv(path+"train.csv")
 test_df=pd.read_csv(path+"sample_submission.csv" )<load_from_csv>
feature_cols = [col for col in df_train.columns if col not in ['Cover_Type','Id']]
X_train = df_train[feature_cols]
X_test = df_test[feature_cols]
y = df_train['Cover_Type']
test_ids = df_test['Id']
bs = 128
data = ImageDataBunch.from_csv(path=path, folder='train/train', csv_labels='train.csv', ds_tfms=get_transforms() , size=32, bs=bs ).normalize(imagenet_stats )<define_variables>
clf = ensemble.RandomForestClassifier(n_estimators=200,n_jobs=-1,random_state=0)
 clf.fit(X_train, y )
<find_best_params><EOS> 
file_submission = "rf200.submission.csv"
with open(file_submission, "w")as outfile:
outfile.write("Id,Cover_Type
")
 for e, val in enumerate(list(clf.predict(X_test))):
outfile.write("%s,%s
"%(test_ids[e],val))