- Spark 2.x
Create BHPApp application on PredictionIO:
pio app new --access-key BHP_TOKEN BHPApp
Import data from boston_house_prices.csv.
python data/import_eventserver.py
Build this template:
pio build
Launch Jupyter notebook and open eda.ipynb. (or you can create a new notebook to analyze data)
PYSPARK_PYTHON=$PYENV_ROOT/shims/python PYSPARK_DRIVER_PYTHON=$PYENV_ROOT/shims/jupyter PYSPARK_DRIVER_PYTHON_OPTS="notebook" pio-shell --with-pyspark
Download Python code from eda.ipynb and put it to train.py.
To execute it on Spark, run pio train
with --main-py-file option.
pio train --main-py-file train.py
Run PredictionIO API server:
pio deploy
Check predictions from deployed model:
curl -s -H "Content-Type: application/json" -d '{"AGE":26.3, "B":390.49, "CHAS":0.0, "CRIM":0.08664, "DIS":6.4798, "INDUS":3.44, "LSTAT":2.87, "NOX":0.43700000000000006, "PTRATIO":15.2, "RAD":5.0, "RM":7.178, "TAX":398.0, "ZN":45.0}' http://localhost:8000/queries.json