Beispiel #1
0
def func_main(fe):
    df = pd.read_csv('Datasets/GermanCredit.csv')
    model_job = load('adf_baseline/TestCases/NBCredit.joblib')

    #Calling the random testing approach to test strong group monotonicity
    fair_score = symbolic_generation.sg_main(model_job, fe)
    return fair_score
Beispiel #2
0
def func_main(sensitive_param):

    #Reading the dataset
    X, Y, shape, nb_classes = credit.credit_data()

    model = DecisionTreeClassifier(class_weight=None,
                                   criterion='gini',
                                   max_depth=None,
                                   max_features=None,
                                   max_leaf_nodes=None,
                                   min_impurity_decrease=0.0,
                                   min_impurity_split=None,
                                   min_samples_leaf=1,
                                   min_samples_split=2,
                                   min_weight_fraction_leaf=0.0,
                                   random_state=None,
                                   splitter='best')

    #Fitting the model with the dataset
    model = model.fit(X, Y)

    #Computing time
    start_time = time.time()
    #Calling the random testing approach to test strong group monotonicity
    model_job = load('adf_baseline/TestCases/DecTreeCredit.joblib')
    fair_score = symbolic_generation.sg_main(model_job, sensitive_param)

    return fair_score
Beispiel #3
0
def func_main(sensitive_param):

    #Reading the dataset

    X, Y, shape, nb_classes = census.census_data()

    model = LogisticRegression(penalty='l2',
                               dual=False,
                               tol=0.0001,
                               C=1.0,
                               fit_intercept=True,
                               intercept_scaling=1,
                               class_weight=None,
                               random_state=10,
                               solver='lbfgs',
                               max_iter=5000,
                               multi_class='auto',
                               verbose=0,
                               warm_start=False,
                               n_jobs=None,
                               l1_ratio=None)

    #Fitting the model with the dataset
    model = model.fit(X, Y)

    #Computing time
    start_time = time.time()
    #Calling the random testing approach to test strong group monotonicity
    model_job = load('adf_baseline/TestCases/LogRegAdult.joblib')
    fair_score = symbolic_generation.sg_main(model_job, sensitive_param)

    return fair_score
Beispiel #4
0
def func_main(sensitive_param):

    #Reading the dataset
    X, Y, shape, nb_classes = credit.credit_data()

    model = MultinomialNB()

    #Fitting the model with the dataset
    model = model.fit(X, Y)

    #Computing time
    start_time = time.time()
    #Calling the random testing approach to test strong group monotonicity
    model_job = load('adf_baseline/TestCases/NBAdult.joblib')
    fair_score = symbolic_generation.sg_main(model_job, sensitive_param)

    return fair_score