• R/O
  • SSH

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

File Info

修訂. 288bcd53147b6850c6b35071063c64fb1b2b8f34
大小 465 bytes
時間 2014-02-11 06:18:13
作者 Lorenzo Isella
Log Message

A code to read and run a random forest model for the Kaggle loan competition.

Content

#!/usr/bin/env python
import scipy as s
import numpy as n
import string

import pandas as pd

import pickle


from sklearn.externals import joblib

from sklearn.ensemble import RandomForestRegressor

test = n.loadtxt('test_data_fixed.dat',dtype="float")

print("Test data loaded")

pkl_file = open('rf_model.txt', 'rb')

clf = pickle.load(pkl_file)


pkl_file.close()

prediction=clf.predict(test)


n.savetxt("prediction.dat", prediction)


print "So far so good"