Comments (3)
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.
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.
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)
- Question: is there a fast method for `dcor.independence.distance_covariance_test` HOT 2
- OSError: [Errno 36] File name too long when importing dcor HOT 5
- Is there a fast way of doing pairwise distance correlation (dcor.distance_correlation) HOT 8
- __version__ returns 0.0. Version number is on a separate file HOT 6
- AttributeError: 'float' object has no attribute 'dtype' HOT 1
- Process killed due to very large array HOT 2
- FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\domin\\PycharmProjects\\Trading_Backtesting_ML\\venv\\lib\\site-packages\\dcor\\__pycache__\\_fast_dcov_mergesort._generate_distance_covariance_sqr_mergesort_generic_impl.locals._distance_covariance_sqr_mergesort_generic_impl-163.py38.nbi.tmp.4ae6be2f415b45ff' HOT 2
- Improve performance of pairwise distances computation
- Add goodness-of-fit tests
- Add distance skewness and symmetry test
- Implement distance components (DISCO)
- Study and implement energy-based clustering
- Implement energy distance in terms of distance covariance
- Adding support for python 3.7 HOT 1
- Question about the shape of the input array HOT 3
- Can dcor with method 'AVL' or 'megresort' is applicable between two data types float and integer, respectively or it always has to be float? HOT 13
- Can distance correlation-based t test is theoretically correct to implement for "uni"-dimensional data? HOT 2
- Seemingly incorrect results with `int` datatype HOT 3
- Incorrect documentation about arbitrary dimensions HOT 2
- Range of distance correlation HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dcor.