Giter Site home page Giter Site logo

Comments (5)

e-rich avatar e-rich commented on August 25, 2024

if you just want to use the closest-to-hyperplane selection with a linear SVM, you could also write yourself a query strategy like:

 def closest_to_hyperplane_sampling(linearSVC_learner: BaseLearner, X_pool):
    y = linearSVC_learner.estimator.decision_function(X_pool)
    w_norm = np.linalg.norm(linearSVC_learner.estimator.coef_)
    dist = y / w_norm
    query_idx = np.argmin(np.abs(dist))
    return query_idx, X_pool[query_idx]

from modal.

lkurlandski avatar lkurlandski commented on August 25, 2024

This is great, thank you for the tip. Did not realize how simple it would be.

from modal.

lkurlandski avatar lkurlandski commented on August 25, 2024

I am curious why you normalize the confidence scores. I can't see how applying a linear scaling factor of (1 / w_norm) to the y vector would change the return value of the function. Is it simply to ensure all values are between 0 and 1?

from modal.

e-rich avatar e-rich commented on August 25, 2024

yes you are right. you do not need this step.

from modal.

lkurlandski avatar lkurlandski commented on August 25, 2024

Thought so. Cheers!

from modal.

Related Issues (20)

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.