Classification template for Iris (Python)
创建应用
$ pio app new --access-key IRIS_TOKEN IrisApp
下载项目
$ git clone https://github.com/jpioug/predictionio-template-iris.git MyIris
导入更多的数据,导入数据的方式可以通过import_eventserver.py定义。
$ python data/import_eventserver.py
注意event server是否启动,可以通过下面命令查看
$ curl -i -X GET http://localhost:7070
构建应用
$ pio build --verbose
训练模型
$ pio train --main-py-file train.py
发布服务
$ pio deploy
验证rest服务
curl -s -H "Content-Type: application/json" -d '{"attr0":5.1,"attr1":3.5,"attr2":1.4,"attr3":0.2}' http://localhost:8000/queries.json