예제 #1
0
def SVM(X, y, sp, word_=False, samp_method=None):
    svm = SVC(class_weight='balanced')
    return cross_val(svm,
                     X,
                     y,
                     sp,
                     cv=5,
                     word_=word_,
                     svm=True,
                     samp_method=samp_method)
예제 #2
0
def KNN(X, y, sp, word_=False):
    knn = KNeighborsClassifier(n_neighbors=5)
    return cross_val(knn, X, y, sp, word_=word_, samp_method=samp_method)
예제 #3
0
def SVM(X, y, sp, word_=False, samp_method=None):
    svm = SVC(class_weight='balanced')
    return cross_val(svm, X, y, sp, cv=5, word_=word_, svm=True, samp_method=samp_method)
예제 #4
0
def ran_forest(X, y, sp, word_=False, samp_method=None):
    rf = RandomForestClassifier()
    return cross_val(rf, X, y, sp, word_=word_, samp_method=samp_method)
예제 #5
0
def GB(X, y, sp, word_=False, samp_method=None):
    gb = GradientBoostingClassifier()
    return cross_val(gb, X, y, sp, word_=word_, samp_method=samp_method)
예제 #6
0
def ran_forest(X, y, sp, word_=False, samp_method=None):
    rf = RandomForestClassifier()
    return cross_val(rf, X, y, sp, word_=word_, samp_method=samp_method)
예제 #7
0
def GB(X, y, sp, word_=False, samp_method=None):
    gb = GradientBoostingClassifier()
    return cross_val(gb, X, y, sp, word_=word_, samp_method=samp_method)
예제 #8
0
def KNN(X, y, sp, word_=False):
    knn = KNeighborsClassifier(n_neighbors=5)
    return cross_val(knn, X, y, sp, word_=word_, samp_method=samp_method)