Changeset 16391


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

Database updated

Location:
internals/2016/aptoideimagesdetector/trunk/Source Code
Files:
4 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()
  • internals/2016/aptoideimagesdetector/trunk/Source Code/Text_categorization/Text_categorization.py

    r16387 r16391  
    2626
    2727
    28 class VoteClassifier(ClassifierI):
    29         def __init__(self, *classifiers):
    30                 self._classifiers = classifiers
    31 
    32         def classify(self, features):
    33                 votes = []
    34                 sumv = 0
    35                 for c in self._classifiers:
    36                         sumv += c.classify(features)
    37                 return sumv/len(self._classifiers)
    38 
    3928def text_cat(description):
    4029        # Step 0: Define parameters
     
    5746        filename, file_extension = os.path.splitext(os.path.realpath(__file__))
    5847        fn = os.path.dirname(os.path.abspath(os.path.join(filename, os.pardir)))
    59        
     48        print fn
    6049        db = sqlite3.connect(fn+'/API to download database/app_info_non_explicit.db')
    6150        c = db.cursor()
  • internals/2016/aptoideimagesdetector/trunk/Source Code/analyse_app.py

    r16385 r16391  
    5353        description = ""
    5454
    55         icons.append("../API to download database/images/Explicit search/icons_explicit/7883823.png")
    56         screenshots.append("../API to download database/images/Explicit search/screenshot_explicit/18966461_3_hd.jpg")
     55        icons.append("./API to download database/images/Explicit search/icons_explicit/7883823.png")
     56        screenshots.append("./API to download database/images/Explicit search/screenshot_explicit/18966461_3_hd.jpg")
    5757        description = "Are you looking for Porn Movies ? If yes, you are at right place. Enjoy porn movies. You can download porn movies also to enjoy later. Tag: Porn, Porno, Sex, Adult, Downloader, sex, xxx, xx"
    5858
Note: See TracChangeset for help on using the changeset viewer.