def test_dame_gender_features_list_no_categorical(self): g = Gender() flnc = g.features_list_no_categorical('files/names/partial.csv') self.assertTrue(len(flnc[0]) > 25) self.assertTrue(flnc[0], [ 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3 ])
# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301 USA, import numpy as np import pandas as pd import matplotlib.pyplot as plt from app.dame_gender import Gender import argparse parser = argparse.ArgumentParser() parser.add_argument('--csv') args = parser.parse_args() g = Gender() if (args.csv == 'nocategorical'): g.features_list_no_categorical("files/names/all.csv") g.features_list2csv(csv="nocategorical") data = pd.read_csv('files/features_list_no_cat.csv', index_col=0) elif (args.csv == 'categorical'): g.features_list_categorical("files/names/all.csv") g.features_list2csv(csv="categorical") data = pd.read_csv('files/features_list_cat.csv', index_col=0) else: g.features_list2csv("files/names/all.csv") data = pd.read_csv('files/features_list.csv', index_col=0) #data = pd.read_csv('files/features_list_cat.csv', index_col=0) #data = pd.read_csv('files/features_list.csv', index_col=0) corr = data.corr() fig = plt.figure() ax = fig.add_subplot(111)