def train(xTrain, yTrain, metric): print 'RandomForestClassifier' global forest forest = RandomForestClassifier() forest.fit(xTrain, yTrain) global trainResults trainResults = forest.predict(xTrain) i.setSuccess(trainResults, metric)
def train(xTrain, yTrain, metric): print 'goosting' global gboost gboost = GBC() gboost.fit(xTrain,yTrain) global trainResults trainResults = gboost.predict_proba(xTrain)[:,1] i.setSuccess(trainResults, metric)
def train(xTrain, yTrain, metric): print 'adaboost' global boost boost = AdaBoostClassifier() boost.fit(xTrain,yTrain) global trainResults trainResults = boost.predict_proba(xTrain)[:,1] i.setSuccess(trainResults, metric)
def train(xTrain, yTrain, metric): print 'adaboost' global boost boost = AdaBoostClassifier() boost.fit(xTrain, yTrain) global trainResults trainResults = boost.predict_proba(xTrain)[:, 1] i.setSuccess(trainResults, metric)
def train(xTrain, yTrain, metric): print 'svm' global vector vector = SVC() vector.fit(xTrain, yTrain) global trainResults trainResults = vector.predict(xTrain) i.setSuccess(trainResults, metric)
def train(xTrain, yTrain, metric): print 'logistic' global logis logis = LogisticRegression() logis.fit(xTrain, yTrain) global trainResults trainResults = logis.predict_proba(xTrain)[:, 1] i.setSuccess(trainResults, metric)
def train(xTrain, yTrain, metric): print 'goosting' global gboost gboost = GBC() gboost.fit(xTrain, yTrain) global trainResults trainResults = gboost.predict_proba(xTrain)[:, 1] i.setSuccess(trainResults, metric)
def train(xTrain, yTrain, metric): print 'logistic' global logis logis = LogisticRegression() logis.fit(xTrain,yTrain) global trainResults trainResults = logis.predict_proba(xTrain)[:,1] i.setSuccess(trainResults, metric)