neulab/docprompting-conala huggingface dataset:
sklearn.datasets.load_wine  
sklearn.datasets.load_wine(*, return_X_y=False, as_frame=False) [source]
 
Load and return the wine dataset (classification).  New in version 0.18.  The wine dataset is a classic and very easy multi-class classification dataset.  
Classes 3  
Samples per class [59,71,48]  
Samples total 178  
Dimensionality 13  
Features real, positive   Read more in the User Guide.  Parameters 
 
return_X_ybool, default=False 

If True, returns (data, target) instead of a Bunch object. See below for more information about the data and target object.  
as_framebool, default=False 

If True, the data is a pandas DataFrame including columns with appropriate dtypes (numeric). The target is a pandas DataFrame or Series depending on the number of target columns. If return_X_y is True, then (data, target) will be pandas DataFrames or Series as described below.  New in version 0.23.     Returns 
 
dataBunch 

Dictionary-like object, with the following attributes.  
data{ndarray, dataframe} of shape (178, 13) 

The data matrix. If as_frame=True, data will be a pandas DataFrame.  target: {ndarray, Series} of shape (178,)

The classification target. If as_frame=True, target will be a pandas Series.  feature_names: list

The names of the dataset columns.  target_names: list

The names of target classes.  frame: DataFrame of shape (178, 14)

Only present when as_frame=True. DataFrame with data and target.  New in version 0.23.   DESCR: str

The full description of the dataset.    
(data, target)tuple if return_X_y is True 
The copy of UCI ML Wine Data Set dataset is downloaded and modified to fit
standard format from:
https://archive.ics.uci.edu/ml/machine-learning-databases/wine/wine.data
   Examples Let’s say you are interested in the samples 10, 80, and 140, and want to know their class name. >>> from sklearn.datasets import load_wine
>>> data = load_wine()
>>> data.target[[10, 80, 140]]
array([0, 1, 2])
>>> list(data.target_names)
['class_0', 'class_1', 'class_2']
 
 Examples using sklearn.datasets.load_wine
 
  Outlier detection on a real data set  

  ROC Curve with Visualization API  

  Importance of Feature Scaling
sklearn.datasets.make_biclusters  
sklearn.datasets.make_biclusters(shape, n_clusters, *, noise=0.0, minval=10, maxval=100, shuffle=True, random_state=None) [source]
 
Generate an array with constant block diagonal structure for biclustering. Read more in the User Guide.  Parameters 
 
shapeiterable of shape (n_rows, n_cols) 

The shape of the result.  
n_clustersint 

The number of biclusters.  
noisefloat, default=0.0 

The standard deviation of the gaussian noise.  
minvalint, default=10 

Minimum value of a bicluster.  
maxvalint, default=100 

Maximum value of a bicluster.  
shufflebool, default=True 

Shuffle the samples.  
random_stateint, RandomState instance or None, default=None 

Determines random number generation for dataset creation. Pass an int for reproducible output across multiple function calls. See Glossary.    Returns 
 
Xndarray of shape shape 

The generated array.  
rowsndarray of shape (n_clusters, X.shape[0]) 

The indicators for cluster membership of each row.  
colsndarray of shape (n_clusters, X.shape[1]) 

The indicators for cluster membership of each column.      See also  
make_checkerboard

  References  
1  
Dhillon, I. S. (2001, August). Co-clustering documents and words using bipartite spectral graph partitioning. In Proceedings of the seventh ACM SIGKDD international conference on Knowledge discovery and data mining (pp. 269-274). ACM.   
 Examples using sklearn.datasets.make_biclusters
 
  A demo of the Spectral Co-Clustering algorithm
sklearn.datasets.make_checkerboard  
sklearn.datasets.make_checkerboard(shape, n_clusters, *, noise=0.0, minval=10, maxval=100, shuffle=True, random_state=None) [source]
 
Generate an array with block checkerboard structure for biclustering. Read more in the User Guide.  Parameters 
 
shapetuple of shape (n_rows, n_cols) 

The shape of the result.  
n_clustersint or array-like or shape (n_row_clusters, n_column_clusters) 

The number of row and column clusters.  
noisefloat, default=0.0 

The standard deviation of the gaussian noise.  
minvalint, default=10 

Minimum value of a bicluster.  
maxvalint, default=100 

Maximum value of a bicluster.  
shufflebool, default=True 

Shuffle the samples.  
random_stateint, RandomState instance or None, default=None 

Determines random number generation for dataset creation. Pass an int for reproducible output across multiple function calls. See Glossary.    Returns 
 
Xndarray of shape shape 

The generated array.  
rowsndarray of shape (n_clusters, X.shape[0]) 

The indicators for cluster membership of each row.  
colsndarray of shape (n_clusters, X.shape[1]) 

The indicators for cluster membership of each column.      See also  
make_biclusters

  References  
1  
Kluger, Y., Basri, R., Chang, J. T., & Gerstein, M. (2003). Spectral biclustering of microarray data: coclustering genes and conditions. Genome research, 13(4), 703-716.   
 Examples using sklearn.datasets.make_checkerboard
 
  A demo of the Spectral Biclustering algorithm
sklearn.datasets.make_circles  
sklearn.datasets.make_circles(n_samples=100, *, shuffle=True, noise=None, random_state=None, factor=0.8) [source]
 
Make a large circle containing a smaller circle in 2d. A simple toy dataset to visualize clustering and classification algorithms. Read more in the User Guide.  Parameters 
 
n_samplesint or tuple of shape (2,), dtype=int, default=100 

If int, it is the total number of points generated. For odd numbers, the inner circle will have one point more than the outer circle. If two-element tuple, number of points in outer circle and inner circle.  Changed in version 0.23: Added two-element tuple.   
shufflebool, default=True 

Whether to shuffle the samples.  
noisefloat, default=None 

Standard deviation of Gaussian noise added to the data.  
random_stateint, RandomState instance or None, default=None 

Determines random number generation for dataset shuffling and noise. Pass an int for reproducible output across multiple function calls. See Glossary.  
factorfloat, default=.8 

Scale factor between inner and outer circle in the range (0, 1).    Returns 
 
Xndarray of shape (n_samples, 2) 

The generated samples.  
yndarray of shape (n_samples,) 

The integer labels (0 or 1) for class membership of each sample.     
 Examples using sklearn.datasets.make_circles
 
  Classifier comparison  

  Comparing different hierarchical linkage methods on toy datasets  

  Comparing different clustering algorithms on toy datasets  

  Kernel PCA  

  Hashing feature transformation using Totally Random Trees  

  t-SNE: The effect of various perplexity values on the shape  

  Compare Stochastic learning strategies for MLPClassifier  

  Varying regularization in Multi-layer Perceptron  

  Feature discretization  

  Label Propagation learning a complex structure
sklearn.datasets.make_friedman1  
sklearn.datasets.make_friedman1(n_samples=100, n_features=10, *, noise=0.0, random_state=None) [source]
 
Generate the “Friedman #1” regression problem. This dataset is described in Friedman [1] and Breiman [2]. Inputs X are independent features uniformly distributed on the interval [0, 1]. The output y is created according to the formula: y(X) = 10 * sin(pi * X[:, 0] * X[:, 1]) + 20 * (X[:, 2] - 0.5) ** 2 + 10 * X[:, 3] + 5 * X[:, 4] + noise * N(0, 1).
 Out of the n_features features, only 5 are actually used to compute y. The remaining features are independent of y. The number of features has to be >= 5. Read more in the User Guide.  Parameters 
 
n_samplesint, default=100 

The number of samples.  
n_featuresint, default=10 

The number of features. Should be at least 5.  
noisefloat, default=0.0 

The standard deviation of the gaussian noise applied to the output.  
random_stateint, RandomState instance or None, default=None 

Determines random number generation for dataset noise. Pass an int for reproducible output across multiple function calls. See Glossary.    Returns 
 
Xndarray of shape (n_samples, n_features) 

The input samples.  
yndarray of shape (n_samples,) 

The output values.     References  
1  
J. Friedman, “Multivariate adaptive regression splines”, The Annals of Statistics 19 (1), pages 1-67, 1991.  
2  
L. Breiman, “Bagging predictors”, Machine Learning 24, pages 123-140, 1996.
sklearn.datasets.make_friedman2  
sklearn.datasets.make_friedman2(n_samples=100, *, noise=0.0, random_state=None) [source]
 
Generate the “Friedman #2” regression problem. This dataset is described in Friedman [1] and Breiman [2]. Inputs X are 4 independent features uniformly distributed on the intervals: 0 <= X[:, 0] <= 100,
40 * pi <= X[:, 1] <= 560 * pi,
0 <= X[:, 2] <= 1,
1 <= X[:, 3] <= 11.
 The output y is created according to the formula: y(X) = (X[:, 0] ** 2 + (X[:, 1] * X[:, 2]  - 1 / (X[:, 1] * X[:, 3])) ** 2) ** 0.5 + noise * N(0, 1).
 Read more in the User Guide.  Parameters 
 
n_samplesint, default=100 

The number of samples.  
noisefloat, default=0.0 

The standard deviation of the gaussian noise applied to the output.  
random_stateint, RandomState instance or None, default=None 

Determines random number generation for dataset noise. Pass an int for reproducible output across multiple function calls. See Glossary.    Returns 
 
Xndarray of shape (n_samples, 4) 

The input samples.  
yndarray of shape (n_samples,) 

The output values.     References  
1  
J. Friedman, “Multivariate adaptive regression splines”, The Annals of Statistics 19 (1), pages 1-67, 1991.  
2  
L. Breiman, “Bagging predictors”, Machine Learning 24, pages 123-140, 1996.
sklearn.datasets.make_friedman3  
sklearn.datasets.make_friedman3(n_samples=100, *, noise=0.0, random_state=None) [source]
 
Generate the “Friedman #3” regression problem. This dataset is described in Friedman [1] and Breiman [2]. Inputs X are 4 independent features uniformly distributed on the intervals: 0 <= X[:, 0] <= 100,
40 * pi <= X[:, 1] <= 560 * pi,
0 <= X[:, 2] <= 1,
1 <= X[:, 3] <= 11.
 The output y is created according to the formula: y(X) = arctan((X[:, 1] * X[:, 2] - 1 / (X[:, 1] * X[:, 3])) / X[:, 0]) + noise * N(0, 1).
 Read more in the User Guide.  Parameters 
 
n_samplesint, default=100 

The number of samples.  
noisefloat, default=0.0 

The standard deviation of the gaussian noise applied to the output.  
random_stateint, RandomState instance or None, default=None 

Determines random number generation for dataset noise. Pass an int for reproducible output across multiple function calls. See Glossary.    Returns 
 
Xndarray of shape (n_samples, 4) 

The input samples.  
yndarray of shape (n_samples,) 

The output values.     References  
1  
J. Friedman, “Multivariate adaptive regression splines”, The Annals of Statistics 19 (1), pages 1-67, 1991.  
2  
L. Breiman, “Bagging predictors”, Machine Learning 24, pages 123-140, 1996.
sklearn.datasets.make_gaussian_quantiles  
sklearn.datasets.make_gaussian_quantiles(*, mean=None, cov=1.0, n_samples=100, n_features=2, n_classes=3, shuffle=True, random_state=None) [source]
 
Generate isotropic Gaussian and label samples by quantile. This classification dataset is constructed by taking a multi-dimensional standard normal distribution and defining classes separated by nested concentric multi-dimensional spheres such that roughly equal numbers of samples are in each class (quantiles of the \(\chi^2\) distribution). Read more in the User Guide.  Parameters 
 
meanndarray of shape (n_features,), default=None 

The mean of the multi-dimensional normal distribution. If None then use the origin (0, 0, …).  
covfloat, default=1.0 

The covariance matrix will be this value times the unit matrix. This dataset only produces symmetric normal distributions.  
n_samplesint, default=100 

The total number of points equally divided among classes.  
n_featuresint, default=2 

The number of features for each sample.  
n_classesint, default=3 

The number of classes  
shufflebool, default=True 

Shuffle the samples.  
random_stateint, RandomState instance or None, default=None 

Determines random number generation for dataset creation. Pass an int for reproducible output across multiple function calls. See Glossary.    Returns 
 
Xndarray of shape (n_samples, n_features) 

The generated samples.  
yndarray of shape (n_samples,) 

The integer labels for quantile membership of each sample.     Notes The dataset is from Zhu et al [1]. References  
1  
 Zhu, H. Zou, S. Rosset, T. Hastie, “Multi-class AdaBoost”, 2009.    
 Examples using sklearn.datasets.make_gaussian_quantiles
 
  Plot randomly generated classification dataset  

  Two-class AdaBoost  

  Multi-class AdaBoosted Decision Trees
sklearn.datasets.make_hastie_10_2  
sklearn.datasets.make_hastie_10_2(n_samples=12000, *, random_state=None) [source]
 
Generates data for binary classification used in Hastie et al. 2009, Example 10.2. The ten features are standard independent Gaussian and the target y is defined by: y[i] = 1 if np.sum(X[i] ** 2) > 9.34 else -1
 Read more in the User Guide.  Parameters 
 
n_samplesint, default=12000 

The number of samples.  
random_stateint, RandomState instance or None, default=None 

Determines random number generation for dataset creation. Pass an int for reproducible output across multiple function calls. See Glossary.    Returns 
 
Xndarray of shape (n_samples, 10) 

The input samples.  
yndarray of shape (n_samples,) 

The output values.      See also  
make_gaussian_quantiles


A generalization of this dataset approach.    References  
1  
T. Hastie, R. Tibshirani and J. Friedman, “Elements of Statistical Learning Ed. 2”, Springer, 2009.   
 Examples using sklearn.datasets.make_hastie_10_2
 
  Gradient Boosting regularization  

  Discrete versus Real AdaBoost  

  Early stopping of Gradient Boosting  

  Demonstration of multi-metric evaluation on cross_val_score and GridSearchCV
sklearn.datasets.make_low_rank_matrix  
sklearn.datasets.make_low_rank_matrix(n_samples=100, n_features=100, *, effective_rank=10, tail_strength=0.5, random_state=None) [source]
 
Generate a mostly low rank matrix with bell-shaped singular values. Most of the variance can be explained by a bell-shaped curve of width effective_rank: the low rank part of the singular values profile is: (1 - tail_strength) * exp(-1.0 * (i / effective_rank) ** 2)
 The remaining singular values’ tail is fat, decreasing as: tail_strength * exp(-0.1 * i / effective_rank).
 The low rank part of the profile can be considered the structured signal part of the data while the tail can be considered the noisy part of the data that cannot be summarized by a low number of linear components (singular vectors).  This kind of singular profiles is often seen in practice, for instance:

 gray level pictures of faces TF-IDF vectors of text documents crawled from the web    Read more in the User Guide.  Parameters 
 
n_samplesint, default=100 

The number of samples.  
n_featuresint, default=100 

The number of features.  
effective_rankint, default=10 

The approximate number of singular vectors required to explain most of the data by linear combinations.  
tail_strengthfloat, default=0.5 

The relative importance of the fat noisy tail of the singular values profile. The value should be between 0 and 1.  
random_stateint, RandomState instance or None, default=None 

Determines random number generation for dataset creation. Pass an int for reproducible output across multiple function calls. See Glossary.    Returns 
 
Xndarray of shape (n_samples, n_features) 

The matrix.
sklearn.datasets.make_moons  
sklearn.datasets.make_moons(n_samples=100, *, shuffle=True, noise=None, random_state=None) [source]
 
Make two interleaving half circles. A simple toy dataset to visualize clustering and classification algorithms. Read more in the User Guide.  Parameters 
 
n_samplesint or tuple of shape (2,), dtype=int, default=100 

If int, the total number of points generated. If two-element tuple, number of points in each of two moons.  Changed in version 0.23: Added two-element tuple.   
shufflebool, default=True 

Whether to shuffle the samples.  
noisefloat, default=None 

Standard deviation of Gaussian noise added to the data.  
random_stateint, RandomState instance or None, default=None 

Determines random number generation for dataset shuffling and noise. Pass an int for reproducible output across multiple function calls. See Glossary.    Returns 
 
Xndarray of shape (n_samples, 2) 

The generated samples.  
yndarray of shape (n_samples,) 

The integer labels (0 or 1) for class membership of each sample.     
 Examples using sklearn.datasets.make_moons
 
  Classifier comparison  

  Comparing different hierarchical linkage methods on toy datasets  

  Comparing different clustering algorithms on toy datasets  

  Comparing anomaly detection algorithms for outlier detection on toy datasets  

  Statistical comparison of models using grid search  

  Compare Stochastic learning strategies for MLPClassifier  

  Varying regularization in Multi-layer Perceptron  

  Feature discretization
sklearn.datasets.make_multilabel_classification  
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.  For each sample, the generative process is:

 pick the number of labels: n ~ Poisson(n_labels) n times, choose a class c: c ~ Multinomial(theta) pick the document length: k ~ Poisson(length) k times, choose a word: w ~ Multinomial(theta_c)    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_samplesint, default=100 

The number of samples.  
n_featuresint, default=20 

The total number of features.  
n_classesint, default=5 

The number of classes of the classification problem.  
n_labelsint, default=2 

The average number of labels per instance. More precisely, the number of labels per sample is drawn from a Poisson distribution with n_labels as its expected value, but samples are bounded (using rejection sampling) by n_classes, and must be nonzero if allow_unlabeled is False.  
lengthint, default=50 

The sum of the features (number of words if documents) is drawn from a Poisson distribution with this expected value.  
allow_unlabeledbool, default=True 

If True, some instances might not belong to any class.  
sparsebool, default=False 

If True, return a sparse feature matrix  New in version 0.17: parameter to allow sparse output.   
return_indicator{‘dense’, ‘sparse’} or False, default=’dense’ 

If 'dense' return Y in the dense binary indicator format. If 'sparse' return Y in the sparse binary indicator format. False returns a list of lists of labels.  
return_distributionsbool, default=False 

If True, return the prior class probability and conditional probabilities of features given classes, from which the data was drawn.  
random_stateint, RandomState instance or None, default=None 

Determines random number generation for dataset creation. Pass an int for reproducible output across multiple function calls. See Glossary.    Returns 
 
Xndarray of shape (n_samples, n_features) 

The generated samples.  
Y{ndarray, sparse matrix} of shape (n_samples, n_classes) 

The label sets. Sparse matrix should be of CSR format.  
p_cndarray of shape (n_classes,) 

The probability of each class being drawn. Only returned if return_distributions=True.  
p_w_cndarray of shape (n_features, n_classes) 

The probability of each feature being drawn given each class. Only returned if return_distributions=True.     
 Examples using sklearn.datasets.make_multilabel_classification
 
  Plot randomly generated multilabel dataset  

  Multilabel classification
sklearn.datasets.make_regression  
sklearn.datasets.make_regression(n_samples=100, n_features=100, *, n_informative=10, n_targets=1, bias=0.0, effective_rank=None, tail_strength=0.5, noise=0.0, shuffle=True, coef=False, random_state=None) [source]
 
Generate a random regression problem. The input set can either be well conditioned (by default) or have a low rank-fat tail singular profile. See make_low_rank_matrix for more details. The output is generated by applying a (potentially biased) random linear regression model with n_informative nonzero regressors to the previously generated input and some gaussian centered noise with some adjustable scale. Read more in the User Guide.  Parameters 
 
n_samplesint, default=100 

The number of samples.  
n_featuresint, default=100 

The number of features.  
n_informativeint, default=10 

The number of informative features, i.e., the number of features used to build the linear model used to generate the output.  
n_targetsint, default=1 

The number of regression targets, i.e., the dimension of the y output vector associated with a sample. By default, the output is a scalar.  
biasfloat, default=0.0 

The bias term in the underlying linear model.  
effective_rankint, default=None 

 if not None:

The approximate number of singular vectors required to explain most of the input data by linear combinations. Using this kind of singular spectrum in the input allows the generator to reproduce the correlations often observed in practice.  if None:

The input set is well conditioned, centered and gaussian with unit variance.    
tail_strengthfloat, default=0.5 

The relative importance of the fat noisy tail of the singular values profile if effective_rank is not None. When a float, it should be between 0 and 1.  
noisefloat, default=0.0 

The standard deviation of the gaussian noise applied to the output.  
shufflebool, default=True 

Shuffle the samples and the features.  
coefbool, default=False 

If True, the coefficients of the underlying linear model are returned.  
random_stateint, RandomState instance or None, default=None 

Determines random number generation for dataset creation. Pass an int for reproducible output across multiple function calls. See Glossary.    Returns 
 
Xndarray of shape (n_samples, n_features) 

The input samples.  
yndarray of shape (n_samples,) or (n_samples, n_targets) 

The output values.  
coefndarray of shape (n_features,) or (n_features, n_targets) 

The coefficient of the underlying linear model. It is returned only if coef is True.     
 Examples using sklearn.datasets.make_regression
 
  Release Highlights for scikit-learn 0.23  

  Prediction Latency  

  Plot Ridge coefficients as a function of the L2 regularization  

  Robust linear model estimation using RANSAC  

  HuberRegressor vs Ridge on dataset with strong outliers  

  Lasso on dense and sparse data  

  Effect of transforming the targets in regression model
sklearn.datasets.make_sparse_coded_signal  
sklearn.datasets.make_sparse_coded_signal(n_samples, *, n_components, n_features, n_nonzero_coefs, random_state=None) [source]
 
Generate a signal as a sparse combination of dictionary elements. Returns a matrix Y = DX, such as D is (n_features, n_components), X is (n_components, n_samples) and each column of X has exactly n_nonzero_coefs non-zero elements. Read more in the User Guide.  Parameters 
 
n_samplesint 

Number of samples to generate  
n_componentsint 

Number of components in the dictionary  
n_featuresint 

Number of features of the dataset to generate  
n_nonzero_coefsint 

Number of active (non-zero) coefficients in each sample  
random_stateint, RandomState instance or None, default=None 

Determines random number generation for dataset creation. Pass an int for reproducible output across multiple function calls. See Glossary.    Returns 
 
datandarray of shape (n_features, n_samples) 

The encoded signal (Y).  
dictionaryndarray of shape (n_features, n_components) 

The dictionary with normalized components (D).  
codendarray of shape (n_components, n_samples) 

The sparse code such that each column of this matrix has exactly n_nonzero_coefs non-zero items (X).     
 Examples using sklearn.datasets.make_sparse_coded_signal
 
  Orthogonal Matching Pursuit