Exemplo n.º 1
0
    #print(yesornot)

    if ((yesornot == "Yes") | (yesornot == "yes") | (yesornot == "Y") | (yesornot == "y")):
        print("We are creating files/names/nam_dict_list.txt")
        g.namdict2file()
        print("We are creating .sav files data models in files/datamodels")
        print("This process take a long time, you can rest.")
        s = DameSexmachine()
        s.classifier()
        s.gaussianNB()
        s.svc()
        s.sgd()
        s.multinomialNB()
        s.bernoulliNB()
        s.tree()
        s.mlp()
        print("This process has finished. You have the models in files/datamodels/*.sav")

        du = DameUtils()

        print("Creating the file files/names/allnoundefined.csv from files/names/all.csv")
        with open('files/names/all.csv') as csvfile:
            reader = csv.reader(csvfile, delimiter=',', quotechar='|')
            filenou = open('files/names/allnoundefined.csv','w+')
            for row in reader:
                g = du.drop_quotes(row[4])
                if ((g == "m") | (g == "f")):
                    filenou.write(row[0]+','+row[1]+','+row[2]+','+row[3]+','+row[4]+','+row[5]+'\n')
            filenou.close()
Exemplo n.º 2
0
 def test_drop_quotes_method_returns_correct_result(self):
     u = DameUtils()
     self.assertEqual('Hola Mexico', u.drop_quotes('Hola "Mexico'))
     self.assertEqual("Hola Mexico", u.drop_quotes("Hola' 'Mexico"))
Exemplo n.º 3
0
 def test_drop_quotes(self):
     u = DameUtils()
     self.assertEqual('Hola Mexico', u.drop_quotes('Hola "Mexico'))
     self.assertEqual("Hola Mexico", u.drop_quotes("Hola' 'Mexico"))