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)
Exemple #2
0
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)
Exemple #3
0
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)
Exemple #4
0
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)
Exemple #5
0
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)
Exemple #6
0
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)
Exemple #7
0
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 'goosting'
    global gboost
    gboost = GBC()
    gboost.fit(xTrain, yTrain)
    global trainResults
    trainResults = gboost.predict_proba(xTrain)[:, 1]
    i.setSuccess(trainResults, metric)
Exemple #9
0
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)