This module is responsible for estimating the location of the Beacon devices.
It uses data from the database gathered through room calibration.
Model trained after every new room calibartion and every room deletion to ensure data consitency.
We used KNN (k-nearest neighbours) algorithm to estimate the location of the Beacon devices. The KNN algorithm is a simple and effective machine learning algorithm used for classification and regression tasks. In our implementation number of neighbours is equal 2.
- Python (version: 3.12.4)
- SciKit-Learn
This server provides communication between the main server and the machine learning module.
- Python (version: 3.12.4)
- Uvicorn
- FastAPI
It is not recommended to run the server alone. Be sure to run the whole Deployment.
pip install virtualenv
virtualenv .venv
source ./.venv/Scripts/activate
pip install -r requirements.txt
uvicorn Server:app --host 0.0.0.0 --port 8083 --reload
Returns the identifier of the predicted location based on the received data. If the model has not been previously trained, an error with code 503
will be returned as a response.
scan_results
: NetworkInfo[] - Information about networks scanned by the Beacon.
- Room identifier string.
Allows clearing the currently saved model, and then initiates retraining using the latest information stored in the database.