sklearn.datasets.make_multilabel_classification(n_samples=100, n_features=20, n_classes=5, n_labels=2, length=50, allow_unlabeled=True, sparse=False, return_indicator=’dense’, return_distributions=False, random_state=None)
[source]
Generate a random multilabel classification problem.
In the above process, rejection sampling is used to make sure that n is never zero or more than n_classes
, and that the document length is never zero. Likewise, we reject classes which have already been chosen.
Read more in the User Guide.
Parameters: |
n_samples : int, optional (default=100) The number of samples. n_features : int, optional (default=20) The total number of features. n_classes : int, optional (default=5) The number of classes of the classification problem. n_labels : int, optional (default=2) The average number of labels per instance. More precisely, the number of labels per sample is drawn from a Poisson distribution with length : int, optional (default=50) The sum of the features (number of words if documents) is drawn from a Poisson distribution with this expected value. allow_unlabeled : bool, optional (default=True) If sparse : bool, optional (default=False) If New in version 0.17: parameter to allow sparse output. return_indicator : ‘dense’ (default) | ‘sparse’ | False If return_distributions : bool, optional (default=False) If random_state : int, RandomState instance or None, optional (default=None) If int, random_state is the seed used by the random number generator; If RandomState instance, random_state is the random number generator; If None, the random number generator is the RandomState instance used by |
---|---|
Returns: |
X : array of shape [n_samples, n_features] The generated samples. Y : array or sparse CSR matrix of shape [n_samples, n_classes] The label sets. p_c : array, shape [n_classes] The probability of each class being drawn. Only returned if p_w_c : array, shape [n_features, n_classes] The probability of each feature being drawn given each class. Only returned if |
sklearn.datasets.make_multilabel_classification
© 2007–2017 The scikit-learn developers
Licensed under the 3-clause BSD License.
http://scikit-learn.org/stable/modules/generated/sklearn.datasets.make_multilabel_classification.html