Coder Social home page Coder Social logo

Negative weights for KDE about kalepy HOT 2 OPEN

lzkelley avatar lzkelley commented on June 8, 2024
Negative weights for KDE

from kalepy.

Comments (2)

lzkelley avatar lzkelley commented on June 8, 2024

Hi, in principle it seems like this should be possible, but I've never explored negative weights. There will be some points in the code that need modification, for example, how does one calculate covariances using negative weights?

You're welcome to try implementing this in the code. If you disable the error message you're getting, it will allow negative weights, but then I think some numpy functions will probably throw errors.

from kalepy.

Pablobala avatar Pablobala commented on June 8, 2024

Hi, just to let you know. I didn't find a way to handle negative weights because of the errors numpy throws when trying to calculate the covariances. So what I did is to split my sample into positive and negative weights, apply the KDE to both samples, and then rest the weights from "negative" sample renormalizing them by the sum of the sWeights. This seems to work but there are some downsides. If someone could find a way for handling negative weights it would be better.
Regards!

from kalepy.

Related Issues (14)

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.