Orange Forum • View topic - Correlation Modules on Distance Widgets

Correlation Modules on Distance Widgets

A place to ask questions about methods in Orange and how they are used and other general support.

Correlation Modules on Distance Widgets

Postby PauloXavier » Sun Jan 06, 2013 18:58

The Distance widgets, consider for continuous variables Pearson & Spearmans correlations. Frquently the sign of a correlation is irrelevant as long as the correlation is high.
Is there a way to obtain a distance matrix for the Module of those correlations? I am not interested in theyr sign but only in theyr strength.
(PS Having those options in the widget woud be very nice !! )

Re: Correlation Modules on Distance Widgets

Postby Ales » Wed Jan 09, 2013 11:24

PauloXavier wrote:Is there a way to obtain a distance matrix for the Module of those correlations? I am not interested in theyr sign but only in theyr strength.

You can run this in the Python Script widget
Code: Select all
from Orange import distance

#matrix = distance.distance_matrix(in_data, distance.SpearmanRAbsolute)
matrix = distance.distance_matrix(in_data, distance.PearsonRAbsolute)
matrix.setattr("items", in_data)

out_distance = matrix
This will only work for computing the distances between example instances (rows).

PauloXavier wrote:Having those options in the widget woud be very nice

I agree. Maybe an extra option "Use absolute values" when correlation measures are chosen.

Re: Correlation Modules on Distance Widgets

Postby PauloXavier » Thu Jan 17, 2013 0:07

It works! Thanks a lot.
Is there nobody interested in implementing that change on the widgets?
I don't have the skills, and it looks like a quick winn!

Re: Correlation Modules on Distance Widgets

Postby Ales » Mon Feb 18, 2013 10:31

The option for absolute correlations has been added to the widget in the latest daily snapshot.


Return to Questions & Support