Price predictions for 3DHubs
Project description
Price Prediction
Start Predicting
-
Install the package:
pip install hubs-predictor
-
How to Use:
from hubs_predictor import predict_batch, predict_from_csv # IP = 'localhost' if the container is running locally IP = '164.52.192.139' # Hosted in my private server for quick testing # Predict using CSV file: csv_path = '/PATH/TO/YOUR/CSV/FILE.csv' result = predict_from_csv(csv_path, ip=IP) # Predict as list batches # input format should be list of list [[], []] # eg: data = [['2015-01-09 23:15:03.308', 'cart__4', '27.917', '86.632', '11.022', '247384.01', ....., 'supplier__054'], # ['2015-01-10 24:15:03.308', 'cart__5', '17.917', '76.632', '10.022', '147384.01', ....., 'supplier__055']] data = [[value1, value2, ...., value16], [value1, value2, ...., value16]] result = predict_batch(data, ip=IP) # NOTE: The input data both `csv_file` and `data` should be in the same feature sequence provided in the 'assignment-data.csv' # i.e: ['timestamp', 'cart', 'geometry/bounding_box/depth', 'geometry/bounding_box/width', ......., 'sourcing/supplier_country', 'sourcing/supplier'] # which is 16 columns excluding `target/price`, if `target/price` is provided, it will be ignored internally.
Check Example script:
test_package_example.py
for more clarification.To build and setup local container please check Replicate / Reproduce Whole Process see below.
Replicate / Reproduce Whole Process
Training Process
-
Pre-requirements:
- Install conda: link
- Install MLFlow:
pip install mlflow
-
Extract Data:
assignment-data.zip
totrain/data/
unzip assignment-data.zip -d train/data/
-
Run Mlflow UI server to track the training experiments:
cd train/ mlflow server --backend-store-uri ./mlruns/ & # open 'http://localhost:5000/' to see the experiments # To stop mlflow server use `pkill -f mlflow`
-
Train:
# working dir: "ml-engineer-assignment-bendangnuksung/train/" # (OPTIONAL) modify "train/MLproject" file, update parameters such as: # 'datapath' -> path to your data CSV file # 'kfolds' -> N kfolds you want # 'lr' -> Set your own learning rate # Run training mlflow run --experiment-name hubs_price_prediction .
Deployment Process
-
Pre-requirements:
- Install Docker. Link
- Install Docker Compose:
pip install docker-compose
-
Build and Start Docker:
# working dir: "ml-engineer-assignment-bendangnuksung/" # (OPTIONAL) Modify "docker-compose.yml" if: # 1. Wants to change PORT # 2. Change the volumes if model stored in different directory. (Default is: "./train/models" because models are stored there after training) docker-compose up
-
Building package (Optional):
# modify setup.py accordingly python setup.py sdist python setup.py bdist_wheel twine check dist/* twine upload dist/*
Now the docker container is Up and Running, you can run the models locally. Just assign IP = 'localhost'
from hubs_predictor import predict_batch, predict_from_csv
IP = 'localhost'
csv_path = '/PATH/TO/YOUR/CSV/FILE.csv'
result = predict_from_csv(csv_path, ip=IP)
result = predict_batch(data, ip=IP)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file hubs_predictor-0.1.2.tar.gz
.
File metadata
- Download URL: hubs_predictor-0.1.2.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 949c88a1337b1b54134d04e67303d94bbdad8ae5501c6706d9ce580873c31be7 |
|
MD5 | 538d772fd5523483d809190aa7cea302 |
|
BLAKE2b-256 | 5d550b806f004ddd54c15dcdcbff6507d7b042ef4b8834dbd8036bd89cecbc00 |
File details
Details for the file hubs_predictor-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: hubs_predictor-0.1.2-py3-none-any.whl
- Upload date:
- Size: 3.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37c3fa6bac279504618f29f2dbbe6c0140f2630432dbcf8e4133dcf574c4ddea |
|
MD5 | d2e1a807453d9c9f5bbe5f1ca59bef64 |
|
BLAKE2b-256 | 9062cf07e347ed1f84ce7654a003af8ae48ad2161b550c2f6bdec8ac20613121 |