python-scikit-learnHow to generate dataset for classification
import numpy as np
from sklearn import datasets
X, y = datasets.make_classification(100, 5, n_classes=2)ctrl + c| from sklearn importimport module from scikit-learn | import numpyimport Numpy module | 
| X, yloaded features data ( | datasetspredefined datasets to play with | 
| make_classificationgenerates dataset for classification models | 100number of generated objects | 
| 5number of features | n_classesnumber of generated classes | 
Usage example
import numpy as np
from sklearn import datasets
X, y = datasets.make_classification(100, 5, n_classes=2)
print(X.shape)
print(y)output
(100, 5)
[1 1 1 1 0 0 1 1 0 0 0 0 1 0 1 1 1 1 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0
 0 1 1 1 0 1 1 1 0 1 1 1 1 1 0 1 0 1 1 0 1 0 1 0 1 1 1 0 1 1 0 1 1 0 1 1 1
 0 1 0 0 0 1 0 1 0 0 0 1 1 1 1 0 1 0 0 0 0 0 1 0 1 1]
More of Python Scikit Learn
- How to get best parameters from grid search CV
- How to inverse transformed data with PowerTransformer
- Feature selection using KBest and chi2
- Using LDA classifier example
- Using resample example
- How to get model homogeneity score
- Using quantile regression
- Using Ridge regression model example
- Grid search CV example
- Using dbscan clustering example
See more codes...