-
Notifications
You must be signed in to change notification settings - Fork 229
[MRG] Add documentation for supervised classes and add __init__ docstrings to doc #115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MRG] Add documentation for supervised classes and add __init__ docstrings to doc #115
Conversation
Docstrings in |
doc/index.rst
Outdated
Supervised Algorithms | ||
--------------------- | ||
Supervised metric learning algorithms take as inputs points `X` and targets | ||
`y`, and learn to make points from the same class close to each other, and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
target class labels
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe "target labels" only, to include MLKR
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just realized the rest of the sentence ("[...]from the same class[...]") didn't include MLKR
so I'll update this too
+1 for telling Sphinx to include the |
According to this comment there are several ways to do that, I went for the one that includes the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM apart from a few nitpicks. Since the documentation will need to be adapted when we incorporate the new API, it is probably not worth spending too much time on improving the doc right now.
doc/index.rst
Outdated
metric_learn.nca | ||
metric_learn.lfda | ||
metric_learn.mlkr | ||
|
||
Semi-Supervised Algorithms |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather use something like "Weakly supervised algorithms" to avoid confusion with the classic semi-supervised setting (i.e., a subset of points are labeled and other are not).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree
Done
doc/index.rst
Outdated
Supervised Algorithms | ||
--------------------- | ||
Supervised metric learning algorithms take as inputs points `X` and target | ||
labels `y`, and learn to make points from the same class (for classification) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
learn a distance metric that makes points...
doc/index.rst
Outdated
|
||
Semi-Supervised Algorithms | ||
-------------------------- | ||
Semi-supervised algorithms do the same, but work on a weaker information about |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe avoid "do the same" to have a more self consistent section
quick suggestion: "Weakly supervised algorithms work on weaker information about the data points than supervised algorithms. Rather than labeled points, they take as input similarity judgments on tuples of data points, for instance pairs of similar and dissimilar points. Refer to the documentation of each algorithm for its particular form of input data."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I agree this is clearer
Done
metric_learn/itml.py
Outdated
num_labeled : int, optional | ||
number of labels to preserve for training | ||
num_labeled : int, optional (default=np.inf) | ||
number of labels to preserve for training. If np.inf (default), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is meant by "preserve for training" needs to be clarified?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about: "number of labeled points to keep for building pairs. Extra
labeled points will be considered unlabeled, and ignored as such.
Use np.inf (default) to use all labeled points." ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact IMO this parameter is useless. I will open an issue
metric_learn/lsml.py
Outdated
|
||
`LSML_Supervised` creates quadruplets from labeled samples by taking two | ||
samples from the same class, and two samples from different classes, and | ||
concatenating them. This way it builds quadruplets where the two first |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
", and concatenating them" seems useless
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed
Done
doc/index.rst
Outdated
|
||
Each metric supports the following methods: | ||
Note that each semi-supervised algorithm has a supervised version of the form |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
weakly
Fixes #22
Here is a small proposal for adding some documentation for supervised classes.