def train(features): X, Y = ordered_dict_to_x_y(features) pd.DataFrame(X).to_csv('features.csv') clf = get_classification() clf.fit(X, Y) pd.to_pickle(clf, 'classification.pkl') return clf