Giter Site home page Giter Site logo

Implementation for custom distances? about dcor HOT 3 OPEN

vnmabus avatar vnmabus commented on September 25, 2024
Implementation for custom distances?

from dcor.

Comments (3)

vnmabus avatar vnmabus commented on September 25, 2024 1

Before performing any work, I advise you to research if that is a sound procedure, that is, if the good properties of distance correlation are conserved if the distance is not Euclidean. I am not aware if that is the case, and I would prefer not to offer any option that can mislead the users of the package.

from dcor.

vnmabus avatar vnmabus commented on September 25, 2024

Currently it is not possible. It could be done, at least for the naive algorithm, propagating the distance function until the point where pairwise_distances is called, calling the distance function instead. Currently I have no time for this, but I would review a PR if someone takes the time.

You have several options:

  • Use the R package energy, from the original authors of distance correlation. They allow you to pass a precomputed distance matrix.
  • Download this package and replace pairwise_distances by your function (the ugly, one-time solution, but may work for you).
  • Take a little more time to implement a robust solution (passing a distance callable through functions that need it) and propose a PR. I will review it, and if it is ok you would have help others with the same problem.

from dcor.

ninamiolane avatar ninamiolane commented on September 25, 2024

Thank you very much for your quick answer! I saw the energy package, but I was looking for something in Python.

Thanks also for the indication on how to implement it, I'll see if I can find time and if so will submit a PR.

from dcor.

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.