ag update
This commit is contained in:
18
README.md
18
README.md
@@ -1,8 +1,24 @@
|
||||
|
||||
|
||||
|
||||
# PID
|
||||
|
||||
Libreria per allenare modello xgboost di classificazione su valori india.
|
||||
Nel file `main.py` si trova il workflow completo nei paragrafi qui sotto vengono descritte alcune funzionalita'.
|
||||
|
||||
## per fare una cosa veloce
|
||||
```
|
||||
conda create -n pid
|
||||
conda install pip
|
||||
pip install --no-cache-dir -r requirements.txt
|
||||
cd scr
|
||||
python main.py ## wait until finish
|
||||
cp test/model.json ../service/app/
|
||||
cp test/metadata.pkl ../service/app/
|
||||
cd ../service
|
||||
docker build -t myimage .
|
||||
docker run --rm -it -p 80:80 myimage
|
||||
|
||||
## retrive_data
|
||||
|
||||
Permette di scarcare i dati dal db, sistema i campi nested (tipologia di veicolo utilizzato) e, per ogni colonna, calcola la percentuale di ogni variabile categorica. Visto che alcuni samples sono abbastanza unici, per evitare overfitting e' possibile aggregare questi valori. Di default tutte le classi con meno del 0.5% di rappresentazna vengnono convogliate nella classe other. Restituisce due dataset: uno con le classi accorpate (chiamato small) uno no (per essere sicuri che rappresentino le stesse informazioni)
|
||||
@@ -57,7 +73,7 @@ Una volta scelto il modello in base alle performances si devono spostare i files
|
||||
Accedere alla cartella service ed eseguire i seguenti comandi:
|
||||
```
|
||||
docker build -t myimage .
|
||||
docker run -d --name mycontainer -p 80:80 myimage
|
||||
docker run --rm -it -p 80:80 myimage
|
||||
```
|
||||
Questo copia tutto il contenuto di app e builda il container (non ci sono volumi montati).
|
||||
Per testare:
|
||||
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
@@ -2,7 +2,7 @@ processing:
|
||||
skiarea_test: 'Klausberg' ##you can put it to None
|
||||
season_test_skiarea : 'Kronplatz' ##you can put it to None
|
||||
season_test_year: 2023 ##you can put it to None
|
||||
weight_type: 'sqrt'
|
||||
weight_type: 'sum'
|
||||
use_small: True ## condensate underrepresented classes (no destination!)
|
||||
reload_data: False
|
||||
use_smote: False ##I don't like to use it, leave to False
|
||||
|
||||
@@ -96,6 +96,7 @@ def retrive_data(reload_data:bool,threshold_under_represented:float,path:str)->(
|
||||
#import pdb
|
||||
#pdb.set_trace()
|
||||
df = df[df.year>2011]
|
||||
df = df[df.year>2015] ##maby better?
|
||||
## these columns can lead to overfit!
|
||||
|
||||
df.drop(columns=['dateandtime','skiarea_id','day_of_year','minute_of_day','year'], inplace=True)
|
||||
|
||||
Reference in New Issue
Block a user