a9979a8a54bae31a710eb4117cde5b8af4fbdb28,metric_learn/itml.py,ITML_Supervised,fit,#ITML_Supervised#Any#Any#Any#,212
Before Change
num_classes = len(np.unique(y))
num_constraints = 20 * num_classes**2
c = Constraints.random_subset(y, self.num_labeled,
random_state=random_state)
pos_neg = c.positive_negative_pairs(num_constraints,
random_state=random_state)
pairs, y = wrap_pairs(X, pos_neg)
return _BaseITML._fit(self, pairs, y, bounds=self.bounds)
After Change
random_state : numpy.random.RandomState, optional
If provided, controls random number generation.
if self.num_labeled != "deprecated":
warnings.warn(""num_labeled" parameter is not used."
" It has been deprecated in version 0.5.0 and will be"
"removed in 0.6.0", DeprecationWarning)
X, y = self._prepare_inputs(X, y, ensure_min_samples=2)
num_constraints = self.num_constraints
if num_constraints is None:
num_classes = len(np.unique(y))
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 6
Instances
Project Name: metric-learn/metric-learn
Commit Name: a9979a8a54bae31a710eb4117cde5b8af4fbdb28
Time: 2019-01-02
Author: 31916524+wdevazelhes@users.noreply.github.com
File Name: metric_learn/itml.py
Class Name: ITML_Supervised
Method Name: fit
Project Name: metric-learn/metric-learn
Commit Name: a9979a8a54bae31a710eb4117cde5b8af4fbdb28
Time: 2019-01-02
Author: 31916524+wdevazelhes@users.noreply.github.com
File Name: metric_learn/lsml.py
Class Name: LSML_Supervised
Method Name: fit
Project Name: metric-learn/metric-learn
Commit Name: a9979a8a54bae31a710eb4117cde5b8af4fbdb28
Time: 2019-01-02
Author: 31916524+wdevazelhes@users.noreply.github.com
File Name: metric_learn/mmc.py
Class Name: MMC_Supervised
Method Name: fit
Project Name: metric-learn/metric-learn
Commit Name: a9979a8a54bae31a710eb4117cde5b8af4fbdb28
Time: 2019-01-02
Author: 31916524+wdevazelhes@users.noreply.github.com
File Name: metric_learn/sdml.py
Class Name: SDML_Supervised
Method Name: fit