Exemplo n.º 1
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun May 13 21:54:12 2018

@author: junshuaizhang
"""

import helper
import submission as submission
test_data = './test_data.txt'
strategy_instance = submission.fool_classifier(test_data)
Exemplo n.º 2
0
    'gamma': 0.0001220703125,
    'C': 32,
    'kernel': 'poly',
    'degree': 2,
    'coef0': 100
}

clf = train_our_svm(parameters, training_idf, training_labels)

#print(clf)

classify_file('class-0.txt', 0, count_vect, tfidf_transformer, clf)

classify_file('test_data.txt', 1, count_vect, tfidf_transformer, clf)

submission.fool_classifier('test_data.txt')

classify_file('modified_data.txt', 1, count_vect, tfidf_transformer, clf)


def example_create():
    word_count0 = {
        'iraq': -1.3428719720634539,
        'of': -1.2931977466056304,
        'more': -1.087766429439081,
        'be': -0.9334012972832332,
        'city': -0.8863224943158301,
        'three': -0.8862499580632779,
        'bomb': -0.8396715420942247,
        'the': -0.8233782791047415,
        'nuclear': -0.7961775218152379,
Exemplo n.º 3
0
import submission as sb

sb.fool_classifier('./test_data.txt')