ViCCo-Group / frrsa

Python package to conduct feature-reweighted representational similarity analysis.
https://www.sciencedirect.com/science/article/pii/S105381192200413X
GNU Affero General Public License v3.0
27 stars 3 forks source link

RDM and RSM #32

Closed hahahannes closed 2 years ago

hahahannes commented 2 years ago

I think right now it is a bit tricky to handle RSMs. E.g if one uses a RSM as target and chooses pearson as distance, then while performing classical RSA, a RDM gets produced and the score will be negative. I think we discussed the possibility to check this in the code. For example by checking the diagonal and comparing it with the choosen distance function but decided that it is the user responsibilty. In this case, I would propose to maybe rename the possible values for the distance function.

pearson_similarity -> pearson() -> RSM
pearson_distance -> 1 - pearson() -> RDM
sqeuclidean_distance ->  sqeuclidean()  -> RDM
sqeuclidean_similarity -> max value? - sqeuclidean() -> RSM

with regard to #25 it could be named

multi_dim_distance:
pearson_similarity -> pearson() -> RSM
pearson_distance -> 1 - pearson() -> RDM
sqeuclidean_distance ->  sqeuclidean()  -> RDM
sqeuclidean_similarity -> max value? - sqeuclidean() -> RSM

single_dim_distance:
dot_similarity -> dot() -> RSM
dot_distance -> 1 - dot() -> RDM
sqeuclidean_distance ->  sqeuclidean()  -> RDM
sqeuclidean_similarity -> max value? - sqeuclidean() -> RSM

An alternative could be to use a parameter that sets similarity or dissimilarity and to then choose the matching distance/similarity function