示例#1
0
文件: plot.py 项目: cjdalan/ml-test
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)
示例#2
0
文件: app.py 项目: cjdalan/ml-test
def get_records():
	return jsonify([model_to_dict(record) for record in Record.select()])