def get_training_data(): x_train = [] y_train = [] for record in Record.select(): x_train.append([record.weekday, record.monthday, record.special]) y_train.append(record.result) return (np.array(x_train), y_train)
def get_records(): return jsonify([model_to_dict(record) for record in Record.select()])