scikit-learn-contrib / metric-learn

Metric learning algorithms in Python
http://contrib.scikit-learn.org/metric-learn/
MIT License
1.38k stars 231 forks source link

SCML: Raise ValueError if n_features larger than n_triplets #350

Closed nikosmichas closed 2 years ago

nikosmichas commented 2 years ago

Related discussion https://github.com/scikit-learn-contrib/metric-learn/issues/348 cc @grudloff

nikosmichas commented 2 years ago

Thanks for the work @nikosmichas ! This looks good to me, except that I realize that the docstring entry for the ‘triplet_diffs’ option says:

The basis set is constructed from the differences between points of n_basis positive or negative pairs taken from the triplets constrains.

Shoudn't it be something like:

Each basis is constructed from the differences between points of n_features positive or negative pairs taken randomly from the triplets constraints.

@bellet not sure about the exact wording. I can make the docstring change if you think that it's better. Do you thing that the change is related to this PR ?

perimosocordiae commented 2 years ago

Merging now, we can fix the docstring separately.

bellet commented 2 years ago

Opened a separate PR for #351

bellet commented 2 years ago

Thanks @nikosmichas !