neulab/docprompting-conala huggingface dataset:
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.
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.
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(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.
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.
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.
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).
sklearn.datasets.make_sparse_spd_matrix(dim=1, *, alpha=0.95, norm_diag=False, smallest_coef=0.1, largest_coef=0.9, random_state=None) [source]
 
Generate a sparse symmetric definite positive matrix. Read more in the User Guide.  Parameters 
 
dimint, default=1 

The size of the random matrix to generate.  
alphafloat, default=0.95 

The probability that a coefficient is zero (see notes). Larger values enforce more sparsity. The value should be in the range 0 and 1.  
norm_diagbool, default=False 

Whether to normalize the output matrix to make the leading diagonal elements all 1  
smallest_coeffloat, default=0.1 

The value of the smallest coefficient between 0 and 1.  
largest_coeffloat, default=0.9 

The value of the largest coefficient 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 
 
precsparse matrix of shape (dim, dim) 

The generated matrix.      See also  
make_spd_matrix

  Notes The sparsity is actually imposed on the cholesky factor of the matrix. Thus alpha does not translate directly into the filling fraction of the matrix itself.
sklearn.datasets.make_sparse_uncorrelated(n_samples=100, n_features=10, *, random_state=None) [source]
 
Generate a random regression problem with sparse uncorrelated design. This dataset is described in Celeux et al [1]. as: X ~ N(0, 1)
y(X) = X[:, 0] + 2 * X[:, 1] - 2 * X[:, 2] - 1.5 * X[:, 3]
 Only the first 4 features are informative. The remaining features are useless. Read more in the User Guide.  Parameters 
 
n_samplesint, default=100 

The number of samples.  
n_featuresint, default=10 

The number of features.  
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,) 

The output values.     References  
1  
G. Celeux, M. El Anbari, J.-M. Marin, C. P. Robert, “Regularization in regression: comparing Bayesian and frequentist methods in a poorly informative situation”, 2009.
sklearn.datasets.make_spd_matrix(n_dim, *, random_state=None) [source]
 
Generate a random symmetric, positive-definite matrix. Read more in the User Guide.  Parameters 
 
n_dimint 

The matrix dimension.  
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_dim, n_dim) 

The random symmetric, positive-definite matrix.      See also  
make_sparse_spd_matrix
sklearn.datasets.make_swiss_roll(n_samples=100, *, noise=0.0, random_state=None) [source]
 
Generate a swiss roll dataset. Read more in the User Guide.  Parameters 
 
n_samplesint, default=100 

The number of sample points on the S curve.  
noisefloat, default=0.0 

The standard deviation of the gaussian noise.  
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, 3) 

The points.  
tndarray of shape (n_samples,) 

The univariate position of the sample according to the main dimension of the points in the manifold.     Notes The algorithm is from Marsland [1]. References  
1  
S. Marsland, “Machine Learning: An Algorithmic Perspective”, Chapter 10, 2009. http://seat.massey.ac.nz/personal/s.r.marsland/Code/10/lle.py
sklearn.datasets.make_s_curve(n_samples=100, *, noise=0.0, random_state=None) [source]
 
Generate an S curve dataset. Read more in the User Guide.  Parameters 
 
n_samplesint, default=100 

The number of sample points on the S curve.  
noisefloat, default=0.0 

The standard deviation of the gaussian noise.  
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, 3) 

The points.  
tndarray of shape (n_samples,) 

The univariate position of the sample according to the main dimension of the points in the manifold.
fit(X, y=None) [source]
 
Fit the model from data in X.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

Training vector, where n_samples in the number of samples and n_features is the number of features.  
yIgnored 
  Returns 
 
selfobject 

Returns the object itself.
transform(X) [source]
 
Encode the data as a sparse combination of the dictionary atoms. Coding method is determined by the object parameter transform_algorithm.  Parameters 
 
Xndarray of shape (n_samples, n_features) 

Test data to be transformed, must have the same number of features as the data used to train the model.    Returns 
 
X_newndarray of shape (n_samples, n_components) 

Transformed data.
sklearn.decomposition.dict_learning(X, n_components, *, alpha, max_iter=100, tol=1e-08, method='lars', n_jobs=None, dict_init=None, code_init=None, callback=None, verbose=False, random_state=None, return_n_iter=False, positive_dict=False, positive_code=False, method_max_iter=1000) [source]
 
Solves a dictionary learning matrix factorization problem. Finds the best dictionary and the corresponding sparse code for approximating the data matrix X by solving: (U^*, V^*) = argmin 0.5 || X - U V ||_2^2 + alpha * || U ||_1
             (U,V)
            with || V_k ||_2 = 1 for all  0 <= k < n_components
 where V is the dictionary and U is the sparse code. Read more in the User Guide.  Parameters 
 
Xndarray of shape (n_samples, n_features) 

Data matrix.  
n_componentsint 

Number of dictionary atoms to extract.  
alphaint 

Sparsity controlling parameter.  
max_iterint, default=100 

Maximum number of iterations to perform.  
tolfloat, default=1e-8 

Tolerance for the stopping condition.  
method{‘lars’, ‘cd’}, default=’lars’ 

The method used:  
 
'lars': uses the least angle regression method to solve the lasso 

problem (linear_model.lars_path);    
'cd': uses the coordinate descent method to compute the Lasso solution (linear_model.Lasso). Lars will be faster if the estimated components are sparse.   
n_jobsint, default=None 

Number of parallel jobs to run. None means 1 unless in a joblib.parallel_backend context. -1 means using all processors. See Glossary for more details.  
dict_initndarray of shape (n_components, n_features), default=None 

Initial value for the dictionary for warm restart scenarios.  
code_initndarray of shape (n_samples, n_components), default=None 

Initial value for the sparse code for warm restart scenarios.  
callbackcallable, default=None 

Callable that gets invoked every five iterations  
verbosebool, default=False 

To control the verbosity of the procedure.  
random_stateint, RandomState instance or None, default=None 

Used for randomly initializing the dictionary. Pass an int for reproducible results across multiple function calls. See Glossary.  
return_n_iterbool, default=False 

Whether or not to return the number of iterations.  
positive_dictbool, default=False 

Whether to enforce positivity when finding the dictionary.  New in version 0.20.   
positive_codebool, default=False 

Whether to enforce positivity when finding the code.  New in version 0.20.   
method_max_iterint, default=1000 

Maximum number of iterations to perform.  New in version 0.22.     Returns 
 
codendarray of shape (n_samples, n_components) 

The sparse code factor in the matrix factorization.  
dictionaryndarray of shape (n_components, n_features), 

The dictionary factor in the matrix factorization.  
errorsarray 

Vector of errors at each iteration.  
n_iterint 

Number of iterations run. Returned only if return_n_iter is set to True.      See also  
dict_learning_online


DictionaryLearning


MiniBatchDictionaryLearning


SparsePCA


MiniBatchSparsePCA
fit(X, y=None) [source]
 
Fit the FactorAnalysis model to X using SVD based approach  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

Training data.  
yIgnored 
  Returns 
 self
get_covariance() [source]
 
Compute data covariance with the FactorAnalysis model. cov = components_.T * components_ + diag(noise_variance)  Returns 
 
covndarray of shape (n_features, n_features) 

Estimated covariance of data.
get_precision() [source]
 
Compute data precision matrix with the FactorAnalysis model.  Returns 
 
precisionndarray of shape (n_features, n_features) 

Estimated precision of data.
score(X, y=None) [source]
 
Compute the average log-likelihood of the samples  Parameters 
 
Xndarray of shape (n_samples, n_features) 

The data  
yIgnored 
  Returns 
 
llfloat 

Average log-likelihood of the samples under the current model
score_samples(X) [source]
 
Compute the log-likelihood of each sample  Parameters 
 
Xndarray of shape (n_samples, n_features) 

The data    Returns 
 
llndarray of shape (n_samples,) 

Log-likelihood of each sample under the current model
transform(X) [source]
 
Apply dimensionality reduction to X using the model. Compute the expected mean of the latent variables. See Barber, 21.2.33 (or Bishop, 12.66).  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

Training data.    Returns 
 
X_newndarray of shape (n_samples, n_components) 

The latent variables of X.
fit(X, y=None) [source]
 
Fit the model to X.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

Training data, where n_samples is the number of samples and n_features is the number of features.  
yIgnored 
  Returns 
 self
fit_transform(X, y=None) [source]
 
Fit the model and recover the sources from X.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

Training data, where n_samples is the number of samples and n_features is the number of features.  
yIgnored 
  Returns 
 
X_newndarray of shape (n_samples, n_components)
inverse_transform(X, copy=True) [source]
 
Transform the sources back to the mixed data (apply mixing matrix).  Parameters 
 
Xarray-like of shape (n_samples, n_components) 

Sources, where n_samples is the number of samples and n_components is the number of components.  
copybool, default=True 

If False, data passed to fit are overwritten. Defaults to True.    Returns 
 
X_newndarray of shape (n_samples, n_features)
transform(X, copy=True) [source]
 
Recover the sources from X (apply the unmixing matrix).  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

Data to transform, where n_samples is the number of samples and n_features is the number of features.  
copybool, default=True 

If False, data passed to fit can be overwritten. Defaults to True.    Returns 
 
X_newndarray of shape (n_samples, n_components)
fit(X, y=None) [source]
 
Fit the model with X, using minibatches of size batch_size.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

Training data, where n_samples is the number of samples and n_features is the number of features.  
yIgnored 
  Returns 
 
selfobject 

Returns the instance itself.
get_covariance() [source]
 
Compute data covariance with the generative model. cov = components_.T * S**2 * components_ + sigma2 * eye(n_features) where S**2 contains the explained variances, and sigma2 contains the noise variances.  Returns 
 
covarray, shape=(n_features, n_features) 

Estimated covariance of data.
get_precision() [source]
 
Compute data precision matrix with the generative model. Equals the inverse of the covariance but computed with the matrix inversion lemma for efficiency.  Returns 
 
precisionarray, shape=(n_features, n_features) 

Estimated precision of data.
inverse_transform(X) [source]
 
Transform data back to its original space. In other words, return an input X_original whose transform would be X.  Parameters 
 
Xarray-like, shape (n_samples, n_components) 

New data, where n_samples is the number of samples and n_components is the number of components.    Returns 
 X_original array-like, shape (n_samples, n_features)
   Notes If whitening is enabled, inverse_transform will compute the exact inverse operation, which includes reversing whitening.
partial_fit(X, y=None, check_input=True) [source]
 
Incremental fit with X. All of X is processed as a single batch.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

Training data, where n_samples is the number of samples and n_features is the number of features.  
check_inputbool, default=True 

Run check_array on X.  
yIgnored 
  Returns 
 
selfobject 

Returns the instance itself.