Skip to content

Commit

Permalink
flake8 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AshishShukla-1992 committed Jul 23, 2024
1 parent ae17a07 commit 821c6e4
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 19 deletions.
Binary file added __pycache__/main.cpython-38.pyc
Binary file not shown.
Binary file added __pycache__/test_app.cpython-38-pytest-8.2.2.pyc
Binary file not shown.
Binary file not shown.
7 changes: 5 additions & 2 deletions logs/log
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
INFO:root:Train Test data split done
INFO:root:Precision: 0.7242169595110771, Recall: 0.6192031352057479, Fbeta: 0.6676056338028168
INFO:root:slice_metrics: {'HS-grad': {'precision': 0.6093023255813953, 'recall': 0.3887240356083086, 'fbeta': 0.4746376811594203}, '9th': {'precision': 1.0, 'recall': 0.0, 'fbeta': 0.0}, 'Some-college': {'precision': 0.6889952153110048, 'recall': 0.5353159851301115, 'fbeta': 0.6025104602510459}, 'Masters': {'precision': 0.7863636363636364, 'recall': 0.8277511961722488, 'fbeta': 0.8065268065268065}, 'Bachelors': {'precision': 0.7375886524822695, 'recall': 0.7482014388489209, 'fbeta': 0.7428571428571428}, 'Assoc-voc': {'precision': 0.5967741935483871, 'recall': 0.5522388059701493, 'fbeta': 0.5736434108527133}, '11th': {'precision': 0.8, 'recall': 0.2857142857142857, 'fbeta': 0.4210526315789473}, '10th': {'precision': 0.5, 'recall': 0.2222222222222222, 'fbeta': 0.30769230769230765}, 'Assoc-acdm': {'precision': 0.6666666666666666, 'recall': 0.42857142857142855, 'fbeta': 0.5217391304347826}, 'Doctorate': {'precision': 0.8723404255319149, 'recall': 0.8367346938775511, 'fbeta': 0.8541666666666667}, '12th': {'precision': 1.0, 'recall': 0.25, 'fbeta': 0.4}, 'Prof-school': {'precision': 0.9047619047619048, 'recall': 0.926829268292683, 'fbeta': 0.9156626506024096}, '5th-6th': {'precision': 1.0, 'recall': 0.5, 'fbeta': 0.6666666666666666}, '1st-4th': {'precision': 1.0, 'recall': 0.0, 'fbeta': 0.0}, '7th-8th': {'precision': 1.0, 'recall': 0.2222222222222222, 'fbeta': 0.3636363636363636}, 'Preschool': {'precision': 1.0, 'recall': 1.0, 'fbeta': 1.0}}
INFO:root:Training model
INFO:root:Saving model
INFO:root:Precision: 0.7184905660377359, Recall: 0.6292134831460674, Fbeta: 0.6708949964763918
INFO:root:Processing slices
INFO:root:slice_metrics: {'Bachelors': {'precision': 0.7382075471698113, 'recall': 0.7597087378640777, 'fbeta': 0.7488038277511962}, 'HS-grad': {'precision': 0.5919282511210763, 'recall': 0.39759036144578314, 'fbeta': 0.47567567567567576}, 'Assoc-voc': {'precision': 0.5970149253731343, 'recall': 0.5405405405405406, 'fbeta': 0.5673758865248227}, '1st-4th': {'precision': 1.0, 'recall': 0.5, 'fbeta': 0.6666666666666666}, '9th': {'precision': 1.0, 'recall': 0.0, 'fbeta': 0.0}, 'Assoc-acdm': {'precision': 0.5277777777777778, 'recall': 0.5588235294117647, 'fbeta': 0.5428571428571428}, 'Some-college': {'precision': 0.7188940092165899, 'recall': 0.5288135593220339, 'fbeta': 0.609375}, 'Prof-school': {'precision': 0.8780487804878049, 'recall': 0.935064935064935, 'fbeta': 0.9056603773584906}, 'Masters': {'precision': 0.8219895287958116, 'recall': 0.8486486486486486, 'fbeta': 0.8351063829787233}, '7th-8th': {'precision': 0.0, 'recall': 0.0, 'fbeta': 1.0}, '12th': {'precision': 1.0, 'recall': 0.14285714285714285, 'fbeta': 0.25}, '5th-6th': {'precision': 1.0, 'recall': 0.4, 'fbeta': 0.5714285714285715}, '11th': {'precision': 0.8333333333333334, 'recall': 0.4166666666666667, 'fbeta': 0.5555555555555556}, 'Doctorate': {'precision': 0.7692307692307693, 'recall': 0.8771929824561403, 'fbeta': 0.819672131147541}, '10th': {'precision': 0.5, 'recall': 0.3333333333333333, 'fbeta': 0.4}, 'Preschool': {'precision': 1.0, 'recall': 1.0, 'fbeta': 1.0}}
Binary file added ml/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file added ml/__pycache__/clean_data.cpython-38.pyc
Binary file not shown.
Binary file added ml/__pycache__/data.cpython-38.pyc
Binary file not shown.
Binary file added ml/__pycache__/model.cpython-38.pyc
Binary file not shown.
Binary file modified model/trained_model.joblib
Binary file not shown.
28 changes: 14 additions & 14 deletions slice_metrix.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
HS-grad:{'precision': 0.6093023255813953, 'recall': 0.3887240356083086, 'fbeta': 0.4746376811594203}
Bachelors:{'precision': 0.7382075471698113, 'recall': 0.7597087378640777, 'fbeta': 0.7488038277511962}
HS-grad:{'precision': 0.5919282511210763, 'recall': 0.39759036144578314, 'fbeta': 0.47567567567567576}
Assoc-voc:{'precision': 0.5970149253731343, 'recall': 0.5405405405405406, 'fbeta': 0.5673758865248227}
1st-4th:{'precision': 1.0, 'recall': 0.5, 'fbeta': 0.6666666666666666}
9th:{'precision': 1.0, 'recall': 0.0, 'fbeta': 0.0}
Some-college:{'precision': 0.6889952153110048, 'recall': 0.5353159851301115, 'fbeta': 0.6025104602510459}
Masters:{'precision': 0.7863636363636364, 'recall': 0.8277511961722488, 'fbeta': 0.8065268065268065}
Bachelors:{'precision': 0.7375886524822695, 'recall': 0.7482014388489209, 'fbeta': 0.7428571428571428}
Assoc-voc:{'precision': 0.5967741935483871, 'recall': 0.5522388059701493, 'fbeta': 0.5736434108527133}
11th:{'precision': 0.8, 'recall': 0.2857142857142857, 'fbeta': 0.4210526315789473}
10th:{'precision': 0.5, 'recall': 0.2222222222222222, 'fbeta': 0.30769230769230765}
Assoc-acdm:{'precision': 0.6666666666666666, 'recall': 0.42857142857142855, 'fbeta': 0.5217391304347826}
Doctorate:{'precision': 0.8723404255319149, 'recall': 0.8367346938775511, 'fbeta': 0.8541666666666667}
12th:{'precision': 1.0, 'recall': 0.25, 'fbeta': 0.4}
Prof-school:{'precision': 0.9047619047619048, 'recall': 0.926829268292683, 'fbeta': 0.9156626506024096}
5th-6th:{'precision': 1.0, 'recall': 0.5, 'fbeta': 0.6666666666666666}
1st-4th:{'precision': 1.0, 'recall': 0.0, 'fbeta': 0.0}
7th-8th:{'precision': 1.0, 'recall': 0.2222222222222222, 'fbeta': 0.3636363636363636}
Assoc-acdm:{'precision': 0.5277777777777778, 'recall': 0.5588235294117647, 'fbeta': 0.5428571428571428}
Some-college:{'precision': 0.7188940092165899, 'recall': 0.5288135593220339, 'fbeta': 0.609375}
Prof-school:{'precision': 0.8780487804878049, 'recall': 0.935064935064935, 'fbeta': 0.9056603773584906}
Masters:{'precision': 0.8219895287958116, 'recall': 0.8486486486486486, 'fbeta': 0.8351063829787233}
7th-8th:{'precision': 0.0, 'recall': 0.0, 'fbeta': 1.0}
12th:{'precision': 1.0, 'recall': 0.14285714285714285, 'fbeta': 0.25}
5th-6th:{'precision': 1.0, 'recall': 0.4, 'fbeta': 0.5714285714285715}
11th:{'precision': 0.8333333333333334, 'recall': 0.4166666666666667, 'fbeta': 0.5555555555555556}
Doctorate:{'precision': 0.7692307692307693, 'recall': 0.8771929824561403, 'fbeta': 0.819672131147541}
10th:{'precision': 0.5, 'recall': 0.3333333333333333, 'fbeta': 0.4}
Preschool:{'precision': 1.0, 'recall': 1.0, 'fbeta': 1.0}
6 changes: 3 additions & 3 deletions train_model.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Script to train machine learning model.

from sklearn.model_selection import train_test_split
import ml.clean_data
from ml.clean_data import cleaned_data
from ml.data import process_data
from ml.model import train_model, inference,compute_model_metrics,process_slices
import logging
import joblib

# log config
logging.basicConfig(filename='../logs/log',level=logging.INFO,filemode='w')
logging.basicConfig(filename='logs/log',level=logging.INFO,filemode='w')

# Add code to load in the data.
data = clean_data.cleaned_data()
data = cleaned_data()

# Optional enhancement, use K-fold cross validation instead of a train-test split.
train, test = train_test_split(data, test_size=0.20)
Expand Down

0 comments on commit 821c6e4

Please sign in to comment.