original_docstring: Create identity matrix representing
          different classes and map it with a target vector y.
  
          >>> MLTools.answers_to_matrix(np.array([0, 1, 1, 0]))
          array([[1., 0.],
                 [0., 1.],
                 [0., 1.],
                 [1., 0.]])
          
docstring: Create identity matrix representing
  different classes and map it with a target vector y.
  
  
docstring_tokens: Create identity matrix representing different classes and map it with a target vector y .
code: def answers_to_matrix(target_vector):
          """Create identity matrix representing
          different classes and map it with a target vector y.
  
          >>> MLTools.answers_to_matrix(np.array([0, 1, 1, 0]))
          array([[1., 0.],
                 [0., 1.],
                 [0., 1.],
                 [1., 0.]])
          """
          number_of_classes = len(np.unique(target_vector))
          eye = np.identity(number_of_classes)
          target_vector = target_vector.astype(int)
  
          return eye[target_vector, :]
code_tokens: def answers_to_matrix ( target_vector ) : number_of_classes = len ( np . unique ( target_vector ) ) eye = np . identity ( number_of_classes ) target_vector = target_vector . astype ( int ) return eye [ target_vector , : ]
short_docstring: Create identity matrix representing
  different classes and map it with a target vector y.
short_docstring_tokens: Create identity matrix representing different classes and map it with a target vector y .
comment: """Create identity matrix representing
          different classes and map it with a target vector y.
  
          >>> MLTools.answers_to_matrix(np.array([0, 1, 1, 0]))
          array([[1., 0.],
                 [0., 1.],
                 [0., 1.],
                 [1., 0.]])
          """