# Path: skmultilearn/utils.py
# def get_matrix_in_format(original_matrix, matrix_format):
#     """Converts matrix to format
# 
#     Parameters
#     ----------
# 
#     original_matrix : np.matrix or scipy matrix or np.array of np. arrays
#         matrix to convert
# 
#     matrix_format : string
#         format
# 
#     Returns
#     -------
# 
#     matrix : scipy matrix
#         matrix in given format
#     """
#     if isinstance(original_matrix, np.ndarray):
#         return SPARSE_FORMAT_TO_CONSTRUCTOR[matrix_format](original_matrix)
# 
#     if original_matrix.getformat() == matrix_format:
#         return original_matrix
# 
#     return original_matrix.asformat(matrix_format)


from builtins import object
from ..utils import get_matrix_in_format
from sklearn.base import BaseEstimator
        if include_self_edges and (normalize_self_edges not in [True, False]):
            raise ValueError("Decision whether to normalize self edges needs to be a boolean")

        if normalize_self_edges and not include_self_edges:
            raise ValueError("Include self edges must be set to true if normalization is true")

        if normalize_self_edges and not weighted:
            raise ValueError("Normalizing self-edge weights_ does not make sense in an unweighted graph")

        self.is_weighted = weighted
        self.include_self_edges = include_self_edges
        self.normalize_self_edges = normalize_self_edges

    def transform(self, y):
        """Generate adjacency matrix from label matrix

        This function generates a weighted or unweighted co-occurence Label Graph adjacency matrix in dictionary of keys
        format based on input binary label vectors

        Parameters
        ----------
        y : numpy.ndarray or scipy.sparse
            dense or sparse binary matrix with shape
            :code:`(n_samples, n_labels)`

        Returns
        -------
        Dict[(int, int), float]
            weight map with a tuple of label indexes as keys and a the number of samples in which the two co-occurred
        """

# Path: skmultilearn/utils.py
# def get_matrix_in_format(original_matrix, matrix_format):
#     """Converts matrix to format
# 
#     Parameters
#     ----------
# 
#     original_matrix : np.matrix or scipy matrix or np.array of np. arrays
#         matrix to convert
# 
#     matrix_format : string
#         format
# 
#     Returns
#     -------
# 
#     matrix : scipy matrix
#         matrix in given format
#     """
#     if isinstance(original_matrix, np.ndarray):
#         return SPARSE_FORMAT_TO_CONSTRUCTOR[matrix_format](original_matrix)
# 
#     if original_matrix.getformat() == matrix_format:
#         return original_matrix
# 
#     return original_matrix.asformat(matrix_format)


# Path: skmultilearn/cluster/base.py
from builtins import object
from ..utils import get_matrix_in_format
from sklearn.base import BaseEstimator

        if include_self_edges and (normalize_self_edges not in [True, False]):
            raise ValueError("Decision whether to normalize self edges needs to be a boolean")

        if normalize_self_edges and not include_self_edges:
            raise ValueError("Include self edges must be set to true if normalization is true")

        if normalize_self_edges and not weighted:
            raise ValueError("Normalizing self-edge weights_ does not make sense in an unweighted graph")

        self.is_weighted = weighted
        self.include_self_edges = include_self_edges
        self.normalize_self_edges = normalize_self_edges

    def transform(self, y):
        """Generate adjacency matrix from label matrix

        This function generates a weighted or unweighted co-occurence Label Graph adjacency matrix in dictionary of keys
        format based on input binary label vectors

        Parameters
        ----------
        y : numpy.ndarray or scipy.sparse
            dense or sparse binary matrix with shape
            :code:`(n_samples, n_labels)`

        Returns
        -------
        Dict[(int, int), float]
            weight map with a tuple of label indexes as keys and a the number of samples in which the two co-occurred
        """

        label_data = get_matrix_in_format(y, 'lil')