Ignore:
Timestamp:
Jul 25, 2016, 11:54:24 AM (3 years ago)
Author:
dferreira
Message:

Database updated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • internals/2016/aptoideimagesdetector/trunk/Source Code/Text_categorization/Text_categorization-tests.py

    r16387 r16391  
    1212import nltk
    1313import os
     14import pickle
    1415import random
    1516import collections
     
    210211
    211212        print "Accuracy percent: ", (nltk.classify.accuracy(classifier, testing_set))*100
     213        return classifier
    212214
    213215print "\n****** NAIVE BAYES ************"
     
    224226results(SklearnClassifier(BernoulliNB()), testing_set, training_set)
    225227print "\n****** LOGISTIC REGRESSION ************"
    226 results(SklearnClassifier(LogisticRegression()), testing_set, training_set)
     228save_model = results(SklearnClassifier(LogisticRegression()), testing_set, training_set)
    227229print "\n****** SGD CLASSIFIER ************"
    228230results(SklearnClassifier(SGDClassifier()), testing_set, training_set)
     
    232234results(SklearnClassifier(LinearSVC()), testing_set, training_set)
    233235
     236save_model = open("./training_info.pickle", "wb")
     237pickle.dump(saving_model, save_model)
     238save_model.close()
Note: See TracChangeset for help on using the changeset viewer.