readme and actual default model
This commit is contained in:
parent
ca83a72e6d
commit
f134b58a49
|
|
@ -1 +1,5 @@
|
|||
*.pyc
|
||||
*.pyc
|
||||
*.zip
|
||||
actual_model/
|
||||
tcalc_model/
|
||||
test.py
|
||||
57
README.MD
57
README.MD
|
|
@ -0,0 +1,57 @@
|
|||
# 1. Description
|
||||
|
||||
The model for determining the spot price of transportation from point A to point B (only for direct routes).
|
||||
|
||||
The model is based on geographical coordinates, prices are predicted in rubles.
|
||||
|
||||
Prices are valid only for transportation across the territory of the Russian Federation, the affiliation of specific coordinates to the territory of the Russian Federation is poorly controlled (see the config/dataset.yaml file, *coordinates_thr* parameter), and remains on the conscience of the user of the model.
|
||||
|
||||
### Load the model
|
||||
|
||||
```python
|
||||
from tcalc.model import TCalcPredictor
|
||||
from tcalc.utils import read_yaml
|
||||
|
||||
|
||||
predictor = TCalcPredictor(dataset_config=read_yaml("config/dataset.yaml"))
|
||||
|
||||
# predictor can load models from links
|
||||
predictor.load_models("https://storage.yandexcloud.net/data-monsters/sber/actual_model.zip")
|
||||
|
||||
# or from local folders (models will be loaded as ensemble)
|
||||
predictor.load_models("default_model")
|
||||
|
||||
# and files (single model)
|
||||
predictor.load_models("default_model/default_model.onnx")
|
||||
|
||||
```
|
||||
|
||||
|
||||
### Inference
|
||||
|
||||
```python
|
||||
data = [
|
||||
{
|
||||
"created_at": "2024-01-01 12:03:03", # when the order is created, i.e. the moment of determining the price
|
||||
"pick_at": "2024-01-10 09:00:00", # when the cargo needs to be picked up
|
||||
# geographical coordinates of loading and unloading locations
|
||||
"from_lat": 55.751,
|
||||
"from_lon": 37.618,
|
||||
"to_lat": 52.139,
|
||||
"to_lon": 104.21,
|
||||
# load capacity and volume of the truck
|
||||
"weight": 20000,
|
||||
"volume": 82,
|
||||
|
||||
# 2 - refrigerator, 1 - all other types, 1 by default and can be skipped
|
||||
"car_type_id": 1
|
||||
}
|
||||
]
|
||||
|
||||
output = predictor(data)
|
||||
print(output)
|
||||
print(output.shape)
|
||||
|
||||
>> [125048.414]
|
||||
>> (1,)
|
||||
```
|
||||
Binary file not shown.
Loading…
Reference in New Issue