Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error during unit testing #4

Open
LMeynent opened this issue Mar 15, 2021 · 1 comment
Open

Error during unit testing #4

LMeynent opened this issue Mar 15, 2021 · 1 comment

Comments

@LMeynent
Copy link

Hello,

With the same setup as described in #3 , I encounter another error during unit testing:

======================================================================
ERROR: test_logreg (tests.test_attacks.TestAttacks)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/leo/Documents/GitHub/synthetic_data_release/tests/test_attacks.py", line 144, in test_logreg
    Attack.train(self.synA, self.labelsSynA)
  File "/Users/leo/Documents/GitHub/synthetic_data_release/synthetic_data/privacy_attacks/membership_inference.py", line 76, in train
    self.AttackClassifier.fit(synA, labels)
  File "/Users/leo/opt/anaconda3/envs/spring/lib/python3.7/site-packages/sklearn/linear_model/_logistic.py", line 1601, in fit
    for class_, warm_start_coef_ in zip(classes_, warm_start_coef))
  File "/Users/leo/opt/anaconda3/envs/spring/lib/python3.7/site-packages/joblib/parallel.py", line 1041, in __call__
    if self.dispatch_one_batch(iterator):
  File "/Users/leo/opt/anaconda3/envs/spring/lib/python3.7/site-packages/joblib/parallel.py", line 859, in dispatch_one_batch
    self._dispatch(tasks)
  File "/Users/leo/opt/anaconda3/envs/spring/lib/python3.7/site-packages/joblib/parallel.py", line 777, in _dispatch
    job = self._backend.apply_async(batch, callback=cb)
  File "/Users/leo/opt/anaconda3/envs/spring/lib/python3.7/site-packages/joblib/_parallel_backends.py", line 208, in apply_async
    result = ImmediateResult(func)
  File "/Users/leo/opt/anaconda3/envs/spring/lib/python3.7/site-packages/joblib/_parallel_backends.py", line 572, in __init__
    self.results = batch()
  File "/Users/leo/opt/anaconda3/envs/spring/lib/python3.7/site-packages/joblib/parallel.py", line 263, in __call__
    for func, args, kwargs in self.items]
  File "/Users/leo/opt/anaconda3/envs/spring/lib/python3.7/site-packages/joblib/parallel.py", line 263, in <listcomp>
    for func, args, kwargs in self.items]
  File "/Users/leo/opt/anaconda3/envs/spring/lib/python3.7/site-packages/sklearn/linear_model/_logistic.py", line 940, in _logistic_regression_path
    extra_warning_msg=_LOGISTIC_SOLVER_CONVERGENCE_MSG)
  File "/Users/leo/opt/anaconda3/envs/spring/lib/python3.7/site-packages/sklearn/utils/optimize.py", line 243, in _check_optimize_result
    ).format(solver, result.status, result.message.decode("latin1"))
AttributeError: 'str' object has no attribute 'decode'
@LMeynent
Copy link
Author

Update: this error seems to come from scipy update 1.6 that was released in December 2020.
Putting scipy<1.6.0,>=1.3.2 in the requirements.txt fixes this, but I do not know whether this represents a durable solution.

Two warnings remain during unit testing of LogReg:

STOP: TOTAL NO. of ITERATIONS REACHED LIMIT.

Increase the number of iterations (max_iter) or scale the data as shown in:
    https://scikit-learn.org/stable/modules/preprocessing.html
Please also refer to the documentation for alternative solver options:
    https://scikit-learn.org/stable/modules/linear_model.html#logistic-regression
extra_warning_msg=_LOGISTIC_SOLVER_CONVERGENCE_MSG)

These can be solved by adding the max_iter=1000 argument in the LogisticRegression() during attack construction

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant