예제 #1
0
파일: test.py 프로젝트: rj08-97/DSCI-633
def test(data):
    y = data["fraudulent"]
    X = data.drop(['fraudulent'], axis=1)
    split_point = int(0.8 * len(y))
    X_train = X.iloc[:split_point]
    X_test = X.iloc[split_point:]
    y_train = y.iloc[:split_point]
    y_test = y.iloc[split_point:]
    clf = my_model()
    clf.fit(X_train, y_train)
    predictions = clf.predict(X_test)
    eval = my_evaluation(predictions, y_test)
    f1 = eval.f1(target=1)
    return f1
예제 #2
0
파일: A9.py 프로젝트: ra9118/DSCI-633
def obj_func2(predictions, actuals, pred_proba=None):
    # One objectives: higher f1 score
    eval = my_evaluation(predictions, actuals, pred_proba)
    return [eval.f1()]
예제 #3
0
파일: A9.py 프로젝트: ra9118/DSCI-633
def obj_func1(predictions, actuals, pred_proba=None):
    # Two objectives: higher recall and higher precision
    eval = my_evaluation(predictions, actuals, pred_proba)
    return [eval.recall(), eval.precision()]
예제 #4
0
파일: A9.py 프로젝트: rigved/fds
def obj_func2(predictions, actuals, pred_proba=None):
    # Two objectives: higher recall and lower false positive rate
    eval = my_evaluation(predictions, actuals, pred_proba)
    return eval.f1()