Bangkit Sharing Session ML Hands On
- Clone the repository:
git clone https://github.com/putuwaw/bangkit-ss-hands-on.git
- Install dependencies:
pip install -r requirements.txt
- [Optional] Train the model:
python training.py
- Run the Flask web server:
flask run --debug --port 8000
- Try it out:
Imagine you're observing an iris flower with the following characteristics:
Sepal length: 5 cm
Sepal width: 3 cm
Petal length: 1 cm
Petal width: 0.5 cm
Curious about which species this might be?
You can easily predict the species using cURL. Simply run the following command in your terminal (Linux, Mac, or WSL):
curl --location 'http://localhost:8000/predict' --header 'Content-Type: application/json' --data '[[5,3,1,0.5]]'
Or using Command Propt (CMD) & PowerShell:
curl.exe --location "http://localhost:8000/predict" --header "Content-Type: application/json" --data "[[5,3,1,0.5]]"
Then you can see the result:
{
"code": 200,
"data": {
"prediction": "setosa",
"probabilty": 0.9401243925094604
},
"message": "OK",
"status": true
}