# M is multi class, we want to remove those rows. keep_index = np.where(labels != 2) labels = labels[keep_index] M = M[keep_index] if False: for x in describe_cols(M): print x if False: plot_correlation_scatter_plot(M) plot_correlation_matrix(M) plot_kernel_density(M["f0"]) # no designation of col name plot_box_plot(M["f0"]) # no designation of col name if False: from eights.generate import val_between, where_all_are_true, append_cols # val_btwn, where # generate a composite rule M = where_all_are_true( M, [ {"func": val_between, "col_name": "f0", "vals": (3.5, 5.0)}, {"func": val_between, "col_name": "f1", "vals": (2.7, 3.1)}, ], "a new col_name", )
def test_plot_kernel_density(self): np.random.seed(0) data = np.random.normal(size=(1000,)) fig = comm.plot_kernel_density(data, verbose=False) self.add_fig_to_report(fig, 'plot_kernel_density')
M = cast_np_nd_to_sa(M) #M is multi class, we want to remove those rows. keep_index = np.where(labels != 2) labels = labels[keep_index] M = M[keep_index] if False: for x in describe_cols(M): print x if False: plot_correlation_scatter_plot(M) plot_correlation_matrix(M) plot_kernel_density(M['f0']) #no designation of col name plot_box_plot(M['f0']) #no designation of col name if False: from eights.generate import val_between, where_all_are_true, append_cols #val_btwn, where #generate a composite rule M = where_all_are_true(M, [{ 'func': val_between, 'col_name': 'f0', 'vals': (3.5, 5.0) }, { 'func': val_between, 'col_name': 'f1', 'vals': (2.7, 3.1) }], 'a new col_name')
def test_plot_kernel_density(self): np.random.seed(0) data = np.random.normal(size=(1000, )) fig = comm.plot_kernel_density(data, verbose=False) self.add_fig_to_report(fig, 'plot_kernel_density')
#make this problem binary labels = np.array([0 if x < np.average(labels) else 1 for x in labels]) dtype = np.dtype({'names': col_names,'formats': [float] * (len(col_names)+1)}) M = cast_np_nd_to_sa(np.array([x[:-1] for x in data[1:]],dtype='float'), dtype) import pdb; pdb.set_trace() if False: for x in describe_cols(M): print x if False: plot_correlation_scatter_plot(M) plot_correlation_matrix(M) plot_kernel_density(M['f0']) #no designation of col name plot_box_plot(M['f0']) #no designation of col name exp = run_std_classifiers(M,labels) exp.make_csv() import pdb; pdb.set_trace()