def run_csv(fin, uid_feature, label_feature, clfs=DBG_std_clfs): """ Turn a CSV into an Experiment then turn the Experiment into models""" sa = open_csv_as_sa(fin) labels = sa[label_feature] M = remove_cols(sa, label_feature) exp = Experiment(M, labels, clfs=clfs) register_exp(exp, uid_feature)
def run_csv(fin, uid_feature, label_feature): sa = open_csv_as_sa(fin) labels = sa[label_feature] M = remove_cols(sa, label_feature) exp = Experiment(M, labels, clfs=DBG_std_clfs) exp.run() last_experiments[current_user.id] = exp clear_models(current_user.id) for trial in exp.trials: for subset in trial.runs: for run in subset: register_model(current_user.id, run.clf, dt.now(), run.M[run.train_indices], run.M[run.test_indices], run.labels[run.train_indices], run.labels[run.test_indices], run.col_names, uid_feature)
def run_csv(fin, uid_feature, label_feature): sa = open_csv_as_sa(fin) labels = sa[label_feature] M = remove_cols(sa, label_feature) exp = Experiment(M, labels, clfs=DBG_std_clfs) exp.run() last_experiments[current_user.id] = exp clear_models(current_user.id) for trial in exp.trials: for subset in trial.runs: for run in subset: register_model( current_user.id, run.clf, dt.now(), run.M[run.train_indices], run.M[run.test_indices], run.labels[run.train_indices], run.labels[run.test_indices], run.col_names, uid_feature)
plot_kernel_density, plot_box_plot) from diogenes.grid_search import Experiment from diogenes.grid_search import std_clfs as std_clfs from diogenes.utils import remove_cols data = open_csv_url( 'http://archive.ics.uci.edu/ml/machine-learning-databases/wine-quality/winequality-white.csv', delimiter=';') y = data['quality'] M = remove_cols(data, 'quality') y = y < np.average(y) 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 = Experiment(M, y, clfs=std_clfs) exp.make_csv()
from diogenes.read import open_csv_url from diogenes.display import (plot_correlation_scatter_plot, plot_correlation_matrix, plot_kernel_density, plot_box_plot) from diogenes.grid_search import Experiment from diogenes.grid_search import std_clfs as std_clfs from diogenes.utils import remove_cols data = open_csv_url( 'http://archive.ics.uci.edu/ml/machine-learning-databases/wine-quality/winequality-white.csv', delimiter=';') y = data['quality'] M = remove_cols(data, 'quality') y = y < np.average(y) 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 = Experiment(M, y, clfs=std_clfs) exp.make_csv()