class_docstr: Class to build constraints from labeled data.
  
  See more in the :ref:`User Guide <supervised_version>`.
  
  Parameters
  ----------
  partial_labels : `numpy.ndarray` of ints, shape=(n_samples,)
    Array of labels, with -1 indicating unknown label.
  
  Attributes
  ----------
  partial_labels : `numpy.ndarray` of ints, shape=(n_samples,)
    Array of labels, with -1 indicating unknown label.
class_docstr_tok: ["Class","to","build","constraints","from","labeled","data",".","See","more","in","the",":","ref",":","`","User","Guide","<","supervised_version",">","`",".","Parameters","--","--","--","--","--","partial_labels",":","`","numpy.ndarray","`","of","ints",",","shape=","(","n_samples",",",")","Array","of","labels",",","with","-1","indicating","unknown","label",".","Attributes","--","--","--","--","--","partial_labels",":","`","numpy.ndarray","`","of","ints",",","shape=","(","n_samples",",",")","Array","of","labels",",","with","-1","indicating","unknown","label","."]
code: def __init__(self, partial_labels):
      partial_labels = np.asanyarray(partial_labels, dtype=int)
      self.partial_labels = partial_labels
  
file_path: metric-learn/metric_learn/constraints.py
imports: import numpy
  import warnings
  from sklearn.utils import check_random_state
  from sklearn.neighbors import NearestNeighbors
label_desc: Use image node_id 1 to create a new Constraints object from inherited base classes: object with example: obj = Constraints(partial_labels)