def main():
    data_set = 'alex_fc6'
    X_train, X_test, Y_train, Y_test = util.load_movie_data(data_set)
    prediction = Y_test * 0

    filename = data_set + '_output_dumb.txt'
    util.output_to_file(data_set, filename, Y_test, prediction)
예제 #2
0
def main():
    for data_set in tqdm(util.feature_sets):
        X_train, X_test, Y_train, Y_test = util.load_movie_data(data_set)
        model = OneVsRestClassifier(QuadraticDiscriminantAnalysis(), n_jobs=-1)
        model.fit(X_train, Y_train)
        prediction = model.predict(X_test)
        filename = data_set + '_output_one_vs_rest_qda.txt'
        util.output_to_file(data_set, filename, Y_test, prediction)

        util.write_model(model, data_set + '_one_vs_rest_qda')
예제 #3
0
def main():
    for data_set in tqdm(util.feature_sets):
        X_train, X_test, Y_train, Y_test = util.load_movie_data(data_set)
        model = KNeighborsClassifier()
        model.fit(X_train, Y_train)
        prediction = model.predict(X_test)
        filename = data_set + '_output_kneighbors.txt'
        util.output_to_file(data_set, filename, Y_test, prediction)

        util.write_model(model, data_set + '_kneighbors')
예제 #4
0
def main():
    for data_set in tqdm(util.feature_sets):
        X_train, X_test, Y_train, Y_test = util.load_movie_data(data_set)
        model = RandomForestClassifier(n_estimators=100, n_jobs=-1)
        model.fit(X_train, Y_train)
        prediction = model.predict(X_test)
        filename = data_set + '_output_random_forest.txt'
        util.output_to_file(data_set, filename, Y_test, prediction)

        util.write_model(model, data_set + '_random_forest')
예제 #5
0
def main():
    for data_set in tqdm(util.feature_sets):    
        X_train, X_test, Y_train, Y_test = util.load_movie_data(data_set)
        model = OneVsRestClassifier(DecisionTreeClassifier(max_depth=100), n_jobs = -1)
        model.fit(X_train, Y_train)
        prediction = model.predict(X_test)
        filename = data_set + '_output_one_vs_rest_tree.txt'
        util.output_to_file(data_set, filename, Y_test, prediction)
        
        util.write_model(model, data_set + '_one_vs_rest_tree')
예제 #6
0
def main():
    for data_set in tqdm(util.feature_sets):
        X_train, X_test, Y_train, Y_test = util.load_movie_data(data_set)
        model = OneVsRestClassifier(GaussianNB(), n_jobs=-1)
        model.fit(X_train, Y_train)
        prediction = model.predict(X_test)
        filename = data_set + '_output_one_vs_rest_gasussian_bayes.txt'
        util.output_to_file(data_set, filename, Y_test, prediction)

        util.write_model(model, data_set + '_one_vs_rest_gasussian_bayes')
예제 #7
0
def main():
    for data_set in tqdm(util.feature_sets):
        X_train, X_test, Y_train, Y_test = util.load_movie_data(data_set)
        model = OneVsRestClassifier(SGDClassifier(max_iter=1000, tol=1e-3),
                                    n_jobs=-1)
        model.fit(X_train, Y_train)
        prediction = model.predict(X_test)
        filename = data_set + '_output_one_vs_rest_svm.txt'
        util.output_to_file(data_set, filename, Y_test, prediction)

        util.write_model(model, data_set + '_one_vs_rest_svm')