コード例 #1
0
 def test_sexmachine_classifier(self):
     s = DameSexmachine()
     classifier = s.classifier(locale="us")
     n = s.features("David")
     guess = classifier.classify(n)
     self.assertTrue(1, n)
コード例 #2
0
            fo.write(m+"\n")
        fo.close()
        fo2 = open(pathfemales, "w")
        for f in females:
            fo2.write(f+"\n")
        fo2.close()


if (args.dataset):
    print(args.dataset)
    create_file(args.dataset)

if (args.ml):
    s = DameSexmachine()
    if (args.ml == "nltk"):
        s.classifier()
    elif (args.ml == "sgd"):
        s.sgd()
    elif (args.ml == "svc"):
        s.svc()
    elif (args.ml == "gaussianNB"):
        s.gaussianNB()
    elif (args.ml == "multinomialNB"):
        s.multinomialNB()
    elif (args.ml == "bernoulliNB"):
        s.bernoulliNB()
    elif (args.ml == "forest"):
        s.forest()
    elif (args.ml == "adaboost"):
        s.adaboost()
    elif (args.ml == "tree"):