<s> import pandas as pd <EOL> import numpy as np <EOL> import csv as csv <EOL> from sklearn . ensemble import RandomForestClassifier <EOL> train_df = pd . read_csv ( '<STR_LIT>' , header = <NUM_LIT:0> ) <EOL> test_df = pd . read_csv ( '<STR_LIT>' , header = <NUM_LIT:0> ) <EOL> train_data = train_df . values <EOL> test_data = test_df . values <EOL> ids = list ( range ( <NUM_LIT:1> , len ( test_data ) + <NUM_LIT:1> ) ) <EOL> print '<STR_LIT>' <EOL> forest = RandomForestClassifier ( n_estimators = <NUM_LIT:1000> ) <EOL> forest = forest . fit ( train_data [ <NUM_LIT:0> : : , <NUM_LIT:1> : : ] , train_data [ <NUM_LIT:0> : : , <NUM_LIT:0> ] ) <EOL> print '<STR_LIT>' <EOL> output = forest . predict ( test_data ) . astype ( int ) <EOL> predictions_file = open ( "<STR_LIT>" , "<STR_LIT:wb>" ) <EOL> open_file_object = csv . writer ( predictions_file ) <EOL> open_file_object . writerow ( [ "<STR_LIT>" , "<STR_LIT>" ] ) <EOL> open_file_object . writerows ( zip ( ids , output ) ) <EOL> predictions_file . close ( ) <EOL> print '<STR_LIT>' </s>
