Commit 2d65c59b authored by Nishtha Jain's avatar Nishtha Jain
Browse files

removed eval scores and plots

parent 44fcf751
......@@ -31,9 +31,8 @@ gdown https://drive.google.com/uc?id=1Lj_RteEF_wAEsENZBLQYGBLMY99VfI5j
install requirements.txt
config.py - contains constants
evaluation.py - contains evaluation metrics
config.py - contains constants
model.py - contains model descriptions and training and prediction modules
......@@ -43,6 +42,9 @@ sampling.py - contains data extraction and sampling tasks
train.py - contains the runnable flow of the project
predict.py - contains functions to predict the occupation of given bios
bios_bias.ipynb - contains results, evaluation metrics and plots
`python train.py --no-load_data_from_saved --embedding_train --model_train --predict --evaluate --masking --class_group medical --sampling random --embedding cv --model svm --test_size 0.2`
`python train.py --no-load_data_from_saved --embedding_train --model_train --predict --masking --class_group medical --sampling random --embedding cv --model svm --test_size 0.2`
,embedding,class weights,mask,accuracy,physician,nurse,psychologist,dentist,surgeon,dietitian,chiropractor
0,count,of,females,-->,0.4919950738916256,0.9087269815852682,0.62991704575863,0.35664819944598336,0.15646004480955938,0.9312101910828026,0.29739776951672864
1,w2v,random,raw,0.7430130643294195,-0.07711058505496898,0.1875261664543887,-0.002291094254795567,-0.00927283052235045,-0.11608947408805992,0.14745608572105165,-0.037320687746448054
2,w2v,random,bio,0.7402017529353399,-0.021738935358875833,0.01983636995271043,0.003228539475669645,-0.00015574230315107407,-0.043235296958883174,0.0821889446585844,-0.0014793883167357608
3,w2v,balanced,raw,0.7097734413758888,0.026192557600457245,0.17605295713218438,-0.014512775350983664,-0.004637646078028745,-0.16779706511046513,0.1534755440701968,-0.1747388134281174
4,w2v,balanced,bio,0.7057218455432446,0.023767797917308042,-0.008295613678115488,-0.006678442347280655,-0.0036994379688975454,-0.0653264566741687,0.06142767683336875,-0.028931965152262762
5,cv,random,raw,0.8022986604928064,-0.012325924839015123,0.09885392177895036,-0.002945084752607796,0.00023840209770892296,-0.09622267355031178,0.1523960869999107,-0.07652259991681765
6,cv,random,bio,0.7998594344302961,-0.0009954260305025109,0.030198181921443024,-0.0027471472543653674,-0.006053585944579165,-0.046779161487583876,0.10470610569737004,-0.019485889332777062
7,cv,balanced,raw,0.8013891185711923,0.002170466938717308,0.1014363225571982,0.0016899256999826084,0.00034348342633122586,-0.1120906279104592,0.13577086246358439,-0.07301861950619781
8,cv,balanced,bio,0.7979576649578304,0.02101006660839233,0.03125649872558639,0.0015409571746137773,-0.006038640087954905,-0.054570440205420845,0.1019347852483633,-0.02981002535628996
9,self_w2v,random,raw,0.7886141888539772,-0.039285145132834653,0.14098385883461423,0.003520399705910726,-0.01465166703667542,-0.1261323925814044,0.13263887541708613,-0.07794804903125588
10,self_w2v,random,bio,0.7898131304779229,-0.015991411441528436,0.0333789694558686,0.0029060461406560933,-0.0016240949827929785,-0.05539584862771585,0.067052345577714,-0.013835490407776818
11,self_w2v,balanced,raw,0.7646766991896808,0.025171785167408645,0.14653936721409683,-0.007956810982815199,-0.007999655916489656,-0.14439563454650148,0.12181258832936909,-0.11794638656502637
12,self_w2v,balanced,bio,0.760749131800893,0.021685879971503896,0.014041159011062343,-0.003900679499601045,-0.0018862528395346967,-0.06571497090662343,0.07944568474651459,-0.021210951761171326
13,d_w2v,random,raw,0.7957251529684141,-0.02896376438066145,0.06052272382083784,0.0007674360009033432,-0.01053594627912946,-0.06652398209783045,0.09808043901875729,-0.023613465176348547
14,d_w2v,random,bio,0.7944848685298496,-0.013165514211736784,0.03509779177699124,0.0016028602470000708,-0.011337464753553461,-0.06565794239683853,0.1088836971906561,-0.002922895689611349
15,d_w2v,balanced,raw,0.7705060360509344,0.024676392735017316,0.06522739170836322,-0.004995591133175992,-0.0053802218466564855,-0.07470867246147062,0.06883443569744113,-0.05333542576492306
16,d_w2v,balanced,bio,0.7680254671738052,0.020532824171352326,0.02457061956795381,0.0001676547406930795,-0.003908659529759939,-0.0669553504829219,0.06770810928030963,-0.023617262252286775
17,d_self_w2v,random,raw,0.7550851661981147,-0.06441448560834961,0.14705241828648458,0.0005306742706401302,-0.003580070837693461,-0.13237546374322987,0.085739494550168,-0.05645937721004711
18,d_self_w2v,random,bio,0.7659169836282455,-0.020332764044602547,0.016907645636120128,0.01054868623127847,0.0024209393766552734,-0.05228191233828977,0.06378866205640177,0.008824996216437425
19,d_self_w2v,balanced,raw,0.7209773441375888,0.014103976435933696,0.14655827716370645,-0.009298583012431305,0.016519971648617404,-0.15777814225030573,0.09957111181292483,-0.08292713254415007
20,d_self_w2v,balanced,bio,0.7344137588887052,0.012773834976968101,0.005475920404334034,0.00830563947399543,0.017964105611416537,-0.06254007312726573,0.058736216454037316,-0.014734038565518193
......@@ -1235,8 +1235,6 @@
" row_list = [embedding,sampling,mask,acc]+y_females\n",
" row_dict = {columns[i]:val for i,val in enumerate(row_list)}\n",
" df_aod = df_aod.append(row_dict,ignore_index=True)\n",
"df_aod.to_csv('aod_model_scores.csv')\n",
"df_tgp.to_csv('tgp_model_scores.csv')\n",
"df_tgp"
]
},
......
......@@ -154,78 +154,3 @@ PREDICTED_DATASET = {
('svm','elmo','medical','balanced',0.2,'bio') : 'predicted_datasets/pred_sv_ev_med_bal_0.2_b'
}
EVALUATION_SCORES = {
('svm','cv','trial','random',0.2,'bio') : 'eval_scores/eval_sv_cv_tri_ran_0.2_b',
('svm','cv','trial','balanced',0.2,'bio') : 'eval_scores/eval_sv_cv_tri_bal_0.2_b',
('svm','cv','medical','random',0.2,'raw') : 'eval_scores/eval_sv_cv_med_ran_0.2_r',
('svm','cv','medical','random',0.2,'bio') : 'eval_scores/eval_sv_cv_med_ran_0.2_b',
('svm','w2v','medical','random',0.2,'raw') : 'eval_scores/eval_sv_wv_med_ran_0.2_r',
('svm','w2v','medical','random',0.2,'bio') : 'eval_scores/eval_sv_wv_med_ran_0.2_b',
('svm','self_w2v','medical','random',0.2,'raw') : 'eval_scores/eval_sv_tv_med_ran_0.2_r',
('svm','self_w2v','medical','random',0.2,'bio') : 'eval_scores/eval_sv_tv_med_ran_0.2_b',
('svm','elmo','medical','random',0.2,'raw') : 'eval_scores/eval_sv_ev_med_ran_0.2_r',
('svm','elmo','medical','random',0.2,'bio') : 'eval_scores/eval_sv_ev_med_ran_0.2_b',
('svm','cv','medical','balanced',0.2,'raw') : 'eval_scores/eval_sv_cv_med_bal_0.2_r',
('svm','cv','medical','balanced',0.2,'bio') : 'eval_scores/eval_sv_cv_med_bal_0.2_b',
('svm','w2v','medical','balanced',0.2,'raw') : 'eval_scores/eval_sv_wv_med_bal_0.2_r',
('svm','w2v','medical','balanced',0.2,'bio') : 'eval_scores/eval_sv_wv_med_bal_0.2_b',
('svm','self_w2v','medical','balanced',0.2,'raw') : 'eval_scores/eval_sv_tv_med_bal_0.2_r',
('svm','self_w2v','medical','balanced',0.2,'bio') : 'eval_scores/eval_sv_tv_med_bal_0.2_b',
('svm','elmo','medical','balanced',0.2,'raw') : 'eval_scores/eval_sv_ev_med_bal_0.2_r',
('svm','elmo','medical','balanced',0.2,'bio') : 'eval_scores/eval_sv_ev_med_bal_0.2_b'
}
PLOT_NAMES = {
# Naming convention : plot_[tgp|aod]_[M|F]_[sv|rf|nn]_[cv|wv|tv]_[tri|med]_[ran|bal]_[test_spit]_[b|r]
('tgp','svm','cv','trial','balanced',0.2,'bio') : 'plots_and_graphs/plot_tgp_sv_cv_tri_bal_0.2_b',
('aod','svm','cv','trial','balanced',0.2,'bio') : 'plots_and_graphs/plot_aod_sv_cv_tri_bal_0.2_b',
('tgp','svm','self_w2v','trial','balanced',0.2,'bio') : 'plots_and_graphs/plot_tgp_sv_tv_tri_bal_0.2_b',
('aod','svm','self_w2v','trial','balanced',0.2,'bio') : 'plots_and_graphs/plot_aod_sv_tv_tri_bal_0.2_b',
('tgp','svm','elmo','trial','balanced',0.2,'bio') : 'plots_and_graphs/plot_tgp_sv_ev_tri_bal_0.2_b',
('aod','svm','elmo','trial','balanced',0.2,'bio') : 'plots_and_graphs/plot_aod_sv_ev_tri_bal_0.2_b',
('tgp','svm','cv','medical','random',0.2,'raw') : 'plots_and_graphs/plot_tgp_sv_cv_med_ran_0.2_r',
('tgp','svm','cv','medical','random',0.2,'bio') : 'plots_and_graphs/plot_tgp_sv_cv_med_ran_0.2_b',
('tgp','svm','w2v','medical','random',0.2,'raw') : 'plots_and_graphs/plot_tgp_sv_wv_med_ran_0.2_r',
('tgp','svm','w2v','medical','random',0.2,'bio') : 'plots_and_graphs/plot_tgp_sv_wv_med_ran_0.2_b',
('tgp','svm','self_w2v','medical','random',0.2,'raw') : 'plots_and_graphs/plot_tgp_sv_tv_med_ran_0.2_r',
('tgp','svm','self_w2v','medical','random',0.2,'bio') : 'plots_and_graphs/plot_tgp_sv_tv_med_ran_0.2_b',
('tgp','svm','elmo','medical','random',0.2,'raw') : 'plots_and_graphs/plot_tgp_sv_ev_med_ran_0.2_r',
('tgp','svm','elmo','medical','random',0.2,'bio') : 'plots_and_graphs/plot_tgp_sv_ev_med_ran_0.2_b',
('tgp','svm','cv','medical','balanced',0.2,'raw') : 'plots_and_graphs/plot_tgp_sv_cv_med_bal_0.2_r',
('tgp','svm','cv','medical','balanced',0.2,'bio') : 'plots_and_graphs/plot_tgp_sv_cv_med_bal_0.2_b',
('tgp','svm','w2v','medical','balanced',0.2,'raw') : 'plots_and_graphs/plot_tgp_sv_wv_med_bal_0.2_r',
('tgp','svm','w2v','medical','balanced',0.2,'bio') : 'plots_and_graphs/plot_tgp_sv_wv_med_bal_0.2_b',
('tgp','svm','self_w2v','medical','balanced',0.2,'raw') : 'plots_and_graphs/plot_tgp_sv_tv_med_bal_0.2_r',
('tgp','svm','self_w2v','medical','balanced',0.2,'bio') : 'plots_and_graphs/plot_tgp_sv_tv_med_bal_0.2_b',
('tgp','svm','elmo','medical','balanced',0.2,'raw') : 'plots_and_graphs/plot_tgp_sv_ev_med_bal_0.2_r',
('tgp','svm','elmo','medical','balanced',0.2,'bio') : 'plots_and_graphs/plot_tgp_sv_ev_med_bal_0.2_b',
('aod','svm','cv','medical','random',0.2,'raw') : 'plots_and_graphs/plot_aod_sv_cv_med_ran_0.2_r',
('aod','svm','cv','medical','random',0.2,'bio') : 'plots_and_graphs/plot_aod_sv_cv_med_ran_0.2_b',
('aod','svm','w2v','medical','random',0.2,'raw') : 'plots_and_graphs/plot_aod_sv_wv_med_ran_0.2_r',
('aod','svm','w2v','medical','random',0.2,'bio') : 'plots_and_graphs/plot_aod_sv_wv_med_ran_0.2_b',
('aod','svm','self_w2v','medical','random',0.2,'raw') : 'plots_and_graphs/plot_aod_sv_tv_med_ran_0.2_r',
('aod','svm','self_w2v','medical','random',0.2,'bio') : 'plots_and_graphs/plot_aod_sv_tv_med_ran_0.2_b',
('aod','svm','elmo','medical','random',0.2,'raw') : 'plots_and_graphs/plot_aod_sv_ev_med_ran_0.2_r',
('aod','svm','elmo','medical','random',0.2,'bio') : 'plots_and_graphs/plot_aod_sv_ev_med_ran_0.2_b',
('aod','svm','cv','medical','balanced',0.2,'raw') : 'plots_and_graphs/plot_aod_sv_cv_med_bal_0.2_r',
('aod','svm','cv','medical','balanced',0.2,'bio') : 'plots_and_graphs/plot_aod_sv_cv_med_bal_0.2_b',
('aod','svm','w2v','medical','balanced',0.2,'raw') : 'plots_and_graphs/plot_aod_sv_wv_med_bal_0.2_r',
('aod','svm','w2v','medical','balanced',0.2,'bio') : 'plots_and_graphs/plot_aod_sv_wv_med_bal_0.2_b',
('aod','svm','self_w2v','medical','balanced',0.2,'raw') : 'plots_and_graphs/plot_aod_sv_tv_med_bal_0.2_r',
('aod','svm','self_w2v','medical','balanced',0.2,'bio') : 'plots_and_graphs/plot_aod_sv_tv_med_bal_0.2_b',
('aod','svm','elmo','medical','balanced',0.2,'raw') : 'plots_and_graphs/plot_aod_sv_ev_med_bal_0.2_r',
('aod','svm','elmo','medical','balanced',0.2,'bio') : 'plots_and_graphs/plot_aod_sv_ev_med_bal_0.2_b'
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment