def __init__(self, max_iter=100, max_proj=10000, convergence_threshold=1e-6,
               num_labeled='deprecated', num_constraints=None, A0=None,
               diagonal=False, diagonal_c=1.0, verbose=False,
               preprocessor=None):
    """Initialize the supervised version of `MMC`.

    `MMC_Supervised` creates pairs of similar sample by taking same class
    samples, and pairs of dissimilar samples by taking different class
    samples. It then passes these pairs to `MMC` for training.

    Parameters
    ----------
    max_iter : int, optional
    max_proj : int, optional
    convergence_threshold : float, optional
    num_labeled : Not used
      .. deprecated:: 0.5.0
         `num_labeled` was deprecated in version 0.5.0 and will
         be removed in 0.6.0.
    num_constraints: int, optional
        number of constraints to generate
    A0 : (d x d) matrix, optional
        initial metric, defaults to identity
        only the main diagonal is taken if `diagonal == True`
    diagonal : bool, optional
        if True, a diagonal metric will be learned,
        i.e., a simple scaling of dimensions
    diagonal_c : float, optional
        weight of the dissimilarity constraint for diagonal
        metric learning
    verbose : bool, optional
        if True, prints information while learning
    preprocessor : array-like, shape=(n_samples, n_features) or callable
        The preprocessor to call to get tuples from indices. If array-like,
        tuples will be formed like this: X[indices].
    """
    _BaseMMC.__init__(self, max_iter=max_iter, max_proj=max_proj,
                      convergence_threshold=convergence_threshold,
                      A0=A0, diagonal=diagonal, diagonal_c=diagonal_c,
                      verbose=verbose, preprocessor=preprocessor)
    self.num_labeled = num_labeled
    self.num_constraints = num_constraints
def __init__ ( self , max_iter = 100 , max_proj = 10000 , convergence_threshold = 1e-6 , num_labeled = 'deprecated' , num_constraints = None , A0 = None , diagonal = False , diagonal_c = 1.0 , verbose = False , preprocessor = None ) : _BaseMMC . __init__ ( self , max_iter = max_iter , max_proj = max_proj , convergence_threshold = convergence_threshold , A0 = A0 , diagonal = diagonal , diagonal_c = diagonal_c , verbose = verbose , preprocessor = preprocessor ) self . num_labeled = num_labeled self . num_constraints = num_constraints
Initialize the supervised version of `MMC`.

    `MMC_Supervised` creates pairs of similar sample by taking same class
    samples, and pairs of dissimilar samples by taking different class
    samples. It then passes these pairs to `MMC` for training.

    Parameters
    ----------
    max_iter : int, optional
    max_proj : int, optional
    convergence_threshold : float, optional
    num_labeled : Not used
      .. deprecated:: 0.5.0
         `num_labeled` was deprecated in version 0.5.0 and will
         be removed in 0.6.0.
    num_constraints: int, optional
        number of constraints to generate
    A0 : (d x d) matrix, optional
        initial metric, defaults to identity
        only the main diagonal is taken if `diagonal == True`
    diagonal : bool, optional
        if True, a diagonal metric will be learned,
        i.e., a simple scaling of dimensions
    diagonal_c : float, optional
        weight of the dissimilarity constraint for diagonal
        metric learning
    verbose : bool, optional
        if True, prints information while learning
    preprocessor : array-like, shape=(n_samples, n_features) or callable
        The preprocessor to call to get tuples from indices. If array-like,
        tuples will be formed like this: X[indices].