Code Monkey home page Code Monkey logo

Comments (1)

ljcc0930 avatar ljcc0930 commented on September 26, 2024

Thanks for making the code public.

I have a question on this line of code:

acc_train = clf.predict(X_target_train).mean()

Wouldn't the accuracy be calculated by comparing the predictions with the ground truth? Did I missing something.

Thanks for the good question! Here we're doing binary classification. Thus, we split the positive (L65-68) and negative (L70-73) classes and get an average to balance the impact of the two classes when they have different data points.

if n_target_train > 0:
X_target_train = target_train.cpu().numpy().reshape(n_target_train, -1)
acc_train = clf.predict(X_target_train).mean()
accs.append(acc_train)
if n_target_test > 0:
X_target_test = target_test.cpu().numpy().reshape(n_target_test, -1)
acc_test = 1 - clf.predict(X_target_test).mean()
accs.append(acc_test)
return np.mean(accs)

In our paper, Appendix C.3, clarifies the implementation of our MIA metric. Here we count the true negatives predicted by our MIA predictor, i.e. how much data in the forgetting set would be classified as a training example. So only the positive one has been activated here.

Please feel free to let me know if you have further questions!

from unlearn-sparse.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.