Skip to content

7. How to Use

Arif Agustyawan edited this page Dec 24, 2023 · 4 revisions

Training the Model

To train the model, run the trainer.py script:

python trainer.py

This script orchestrates the entire training process, including data loading, preprocessing, model building, training, evaluation, and model saving.

Making Predictions

To make predictions using the trained model, run the wrapper.py script:

python wrapper.py

Run API

To run the FastAPI app go to services directory, then execute the following command:

uvicorn app:app --reload

The app will be accessible at http://127.0.0.1:8000. You can make predictions by sending POST requests to http://127.0.0.1:8000/predict with the required payload.

Request Sample

Screenshot 2023-12-24 at 7 41 49 PM

Response Sample

Screenshot 2023-12-24 at 7 42 03 PM

Run Simulation

To run the Streamlit app go to services directory, then execute the following command:

streamlit run app.py

The app will be accessible at http://localhost:8501 in your web browser. Enter a customer name, click the "Predict" button, and the predicted next item will be displayed.

Clone this wiki locally