<s> import competition_utilities as cu <EOL> import features <EOL> from sklearn . ensemble import RandomForestClassifier <EOL> train_file = "<STR_LIT>" <EOL> full_train_file = "<STR_LIT>" <EOL> test_file = "<STR_LIT>" <EOL> submission_file = "<STR_LIT>" <EOL> feature_names = [ "<STR_LIT>" <EOL> , "<STR_LIT>" <EOL> , "<STR_LIT>" <EOL> , "<STR_LIT>" <EOL> , "<STR_LIT>" <EOL> , "<STR_LIT>" <EOL> ] <EOL> def main ( ) : <EOL> print ( "<STR_LIT>" ) <EOL> data = cu . get_dataframe ( train_file ) <EOL> print ( "<STR_LIT>" ) <EOL> fea = features . extract_features ( feature_names , data ) <EOL> print ( "<STR_LIT>" ) <EOL> rf = RandomForestClassifier ( n_estimators = <NUM_LIT:50> , verbose = <NUM_LIT:2> , compute_importances = True , n_jobs = - <NUM_LIT:1> ) <EOL> rf . fit ( fea , data [ "<STR_LIT>" ] ) <EOL> print ( "<STR_LIT>" ) <EOL> data = cu . get_dataframe ( test_file ) <EOL> test_features = features . extract_features ( feature_names , data ) <EOL> probs = rf . predict_proba ( test_features ) <EOL> print ( "<STR_LIT>" ) <EOL> new_priors = cu . get_priors ( full_train_file ) <EOL> old_priors = cu . get_priors ( train_file ) <EOL> probs = cu . cap_and_update_priors ( old_priors , probs , new_priors , <NUM_LIT> ) <EOL> print ( "<STR_LIT>" % submission_file ) <EOL> cu . write_submission ( submission_file , probs ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> main ( ) </s>
