You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
runOptimization provide the all the functions of optimization and interface to run optimization
fromrunOptimizationimport*
Initialization
Step 1: Specify a input data stored in csv file
fn="GermanCredit_Age35.csv"
Step 2: Specify the target attribute to rank on
If specify target attribute as col(fn)-1, it will generate a score for each user by summing all attributes with equally weight to rank on. col(fn) is the number of attributes in the input data.
Target attribute can be value from [0,col(fn)-1] while col(fn)-1 represents using weighted summation score as target attribute
target_att=6
Step 3: Specify which value of sentitive attribute represents the protected group
sensi_att=1
Step 4: Specify size of K
K represents size of intermediate layer in optimization neural network. Higher K represents more accurate prediction. Also takes more time to converge.
opt_k=4
Step 5: Choose the accuracy measure will be used in the optimization process
Choose from ["scoreDiff", "positionDiff", "kendallDis", "spearmanDis", "pearsonDis"].
scoreDiff represents the score difference between two rankings.
positionDiff represents the rank position difference between two rankings.
kendallDis represents the kendall distance between two rankings.
spearmanDis represents spearman correlation between two rankings. Only used the correlation and ignore the p-value in this case.
pearsonDis represents pearson correlation between two rankings. Only used the correlation and ignore the p-value in this case.
acc_measure="scoreDiff"
Step 6: Set the cut point at where to compute the fairness measure
cut_point=10
Step 7: Specify the file to output optimization results
out_fn="testOptimization.csv"
Test optimization process using above setting
main(fn, target_att, sensi_att, opt_k, acc_measure, cut_point, out_fn)
print"Finished optimization"print"OPT result stores in "+out_fn