neulab/docprompting-conala huggingface dataset:
transform(X) [source]
 
Apply dimensionality reduction to X. X is projected on the first principal components previously extracted from a training set, using minibatches of size batch_size if X is sparse.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

New data, where n_samples is the number of samples and n_features is the number of features.    Returns 
 
X_newndarray of shape (n_samples, n_components) 
   Examples >>> import numpy as np
>>> from sklearn.decomposition import IncrementalPCA
>>> X = np.array([[-1, -1], [-2, -1], [-3, -2],
...               [1, 1], [2, 1], [3, 2]])
>>> ipca = IncrementalPCA(n_components=2, batch_size=3)
>>> ipca.fit(X)
IncrementalPCA(batch_size=3, n_components=2)
>>> ipca.transform(X)
fit(X, y=None) [source]
 
Fit the model from data in X.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

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

Returns the instance itself.
fit_transform(X, y=None, **params) [source]
 
Fit the model from data in X and transform X.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

Training vector, where n_samples in the number of samples and n_features is the number of features.    Returns 
 
X_newndarray of shape (n_samples, n_components)
inverse_transform(X) [source]
 
Transform X back to original space.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_components) 
  Returns 
 
X_newndarray of shape (n_samples, n_features) 
   References “Learning to Find Pre-Images”, G BakIr et al, 2004.
transform(X) [source]
 
Transform X.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 
  Returns 
 
X_newndarray of shape (n_samples, n_components)
fit(X, y=None) [source]
 
Learn model for the data X with variational Bayes method. When learning_method is ‘online’, use mini-batch update. Otherwise, use batch update.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

Document word matrix.  
yIgnored 
  Returns 
 self
partial_fit(X, y=None) [source]
 
Online VB with Mini-Batch update.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

Document word matrix.  
yIgnored 
  Returns 
 self
perplexity(X, sub_sampling=False) [source]
 
Calculate approximate perplexity for data X. Perplexity is defined as exp(-1. * log-likelihood per word)  Changed in version 0.19: doc_topic_distr argument has been deprecated and is ignored because user no longer has access to unnormalized distribution   Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

Document word matrix.  
sub_samplingbool 

Do sub-sampling or not.    Returns 
 
scorefloat 

Perplexity score.
score(X, y=None) [source]
 
Calculate approximate log-likelihood as score.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

Document word matrix.  
yIgnored 
  Returns 
 
scorefloat 

Use approximate bound as score.
transform(X) [source]
 
Transform data X according to the fitted model.  Changed in version 0.18: doc_topic_distr is now normalized   Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

Document word matrix.    Returns 
 
doc_topic_distrndarray of shape (n_samples, n_components) 

Document topic distribution for X.
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 instance itself.
partial_fit(X, y=None, iter_offset=None) [source]
 
Updates the model using the data in X as a mini-batch.  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 

iter_offsetint, default=None 

The number of iteration on data batches that has been performed before this call to partial_fit. This is optional: if no number is passed, the memory of the object is used.    Returns 
 
selfobject 

Returns the instance itself.
transform(X) [source]
 
Least Squares projection of the data onto the sparse components. To avoid instability issues in case the system is under-determined, regularization can be applied (Ridge regression) via the ridge_alpha parameter. Note that Sparse PCA components orthogonality is not enforced as in PCA hence one cannot use a simple linear projection.  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.
fit(X, y=None, **params) [source]
 
Learn a NMF model for the data X.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

Data matrix to be decomposed  
yIgnored 
  Returns 
 self
fit_transform(X, y=None, W=None, H=None) [source]
 
Learn a NMF model for the data X and returns the transformed data. This is more efficient than calling fit followed by transform.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

Data matrix to be decomposed  
yIgnored 

Warray-like of shape (n_samples, n_components) 

If init=’custom’, it is used as initial guess for the solution.  
Harray-like of shape (n_components, n_features) 

If init=’custom’, it is used as initial guess for the solution.    Returns 
 
Wndarray of shape (n_samples, n_components) 

Transformed data.
inverse_transform(W) [source]
 
Transform data back to its original space.  Parameters 
 
W{ndarray, sparse matrix} of shape (n_samples, n_components) 

Transformed data matrix.    Returns 
 
X{ndarray, sparse matrix} of shape (n_samples, n_features) 

Data matrix of original shape.    New in version 0.18: ..
transform(X) [source]
 
Transform the data X according to the fitted NMF model.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

Data matrix to be transformed by the model.    Returns 
 
Wndarray of shape (n_samples, n_components) 

Transformed data.
fit(X, y=None) [source]
 
Fit the model with 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 
 
selfobject 

Returns the instance itself.
fit_transform(X, y=None) [source]
 
Fit the model with X and apply the dimensionality reduction on 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) 

Transformed values.     Notes This method returns a Fortran-ordered array. To convert it to a C-ordered array, use ‘np.ascontiguousarray’.
score(X, y=None) [source]
 
Return the average log-likelihood of all samples. See. “Pattern Recognition and Machine Learning” by C. Bishop, 12.2.1 p. 574 or http://www.miketipping.com/papers/met-mppca.pdf  Parameters 
 
Xarray-like 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]
 
Return the log-likelihood of each sample. See. “Pattern Recognition and Machine Learning” by C. Bishop, 12.2.1 p. 574 or http://www.miketipping.com/papers/met-mppca.pdf  Parameters 
 
Xarray-like 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. X is projected on the first principal components previously extracted from a training set.  Parameters 
 
Xarray-like, shape (n_samples, n_features) 

New data, where n_samples is the number of samples and n_features is the number of features.    Returns 
 
X_newarray-like, shape (n_samples, n_components) 
   Examples >>> import numpy as np
>>> from sklearn.decomposition import IncrementalPCA
>>> X = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]])
>>> ipca = IncrementalPCA(n_components=2, batch_size=3)
>>> ipca.fit(X)
IncrementalPCA(batch_size=3, n_components=2)
>>> ipca.transform(X)
fit(X, y=None) [source]
 
Do nothing and return the estimator unchanged. This method is just there to implement the usual API and hence work in pipelines.  Parameters 
 
XIgnored 

yIgnored 
  Returns 
 
selfobject
transform(X, y=None) [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.
fit(X, y=None) [source]
 
Fit model on training data X.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

Training data.  
yIgnored 
  Returns 
 
selfobject 

Returns the transformer object.
fit_transform(X, y=None) [source]
 
Fit model to X and perform dimensionality reduction on X.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

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

Reduced version of X. This will always be a dense array.
inverse_transform(X) [source]
 
Transform X back to its original space. Returns an array X_original whose transform would be X.  Parameters 
 
Xarray-like of shape (n_samples, n_components) 

New data.    Returns 
 
X_originalndarray of shape (n_samples, n_features) 

Note that this is always a dense array.
transform(X) [source]
 
Perform dimensionality reduction on X.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

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

Reduced version of X. This will always be a dense array.
decision_function(X) [source]
 
Apply decision function to an array of samples. The decision function is equal (up to a constant factor) to the log-posterior of the model, i.e. log p(y = k | x). In a binary classification setting this instead corresponds to the difference log p(y = 1 | x) - log p(y = 0 | x). See Mathematical formulation of the LDA and QDA classifiers.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

Array of samples (test vectors).    Returns 
 
Cndarray of shape (n_samples,) or (n_samples, n_classes) 

Decision function values related to each class, per sample. In the two-class case, the shape is (n_samples,), giving the log likelihood ratio of the positive class.
fit(X, y) [source]
 
 Fit LinearDiscriminantAnalysis model according to the given

training data and parameters.  Changed in version 0.19: store_covariance has been moved to main constructor.   Changed in version 0.19: tol has been moved to main constructor.     Parameters 
 
Xarray-like of shape (n_samples, n_features) 

Training data.  
yarray-like of shape (n_samples,) 

Target values.
predict(X) [source]
 
Predict class labels for samples in X.  Parameters 
 
Xarray-like or sparse matrix, shape (n_samples, n_features) 

Samples.    Returns 
 
Carray, shape [n_samples] 

Predicted class label per sample.
predict_log_proba(X) [source]
 
Estimate log probability.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

Input data.    Returns 
 
Cndarray of shape (n_samples, n_classes) 

Estimated log probabilities.
predict_proba(X) [source]
 
Estimate probability.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

Input data.    Returns 
 
Cndarray of shape (n_samples, n_classes) 

Estimated probabilities.
transform(X) [source]
 
Project data to maximize class separation.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

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

Transformed data.
fit(X, y) [source]
 
Fit the model according to the given training data and parameters.  Changed in version 0.19: store_covariances has been moved to main constructor as store_covariance   Changed in version 0.19: tol has been moved to main constructor.   Parameters 
 
Xarray-like of shape (n_samples, n_features) 

Training vector, where n_samples is the number of samples and n_features is the number of features.  
yarray-like of shape (n_samples,) 

Target values (integers)
predict(X) [source]
 
Perform classification on an array of test vectors X. The predicted class C for each sample in X is returned.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 
  Returns 
 
Cndarray of shape (n_samples,)
predict_log_proba(X) [source]
 
Return log of posterior probabilities of classification.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

Array of samples/test vectors.    Returns 
 
Cndarray of shape (n_samples, n_classes) 

Posterior log-probabilities of classification per class.
predict_proba(X) [source]
 
Return posterior probabilities of classification.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

Array of samples/test vectors.    Returns 
 
Cndarray of shape (n_samples, n_classes) 

Posterior probabilities of classification per class.
fit(X, y, sample_weight=None) [source]
 
Fit the random classifier.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

Training data.  
yarray-like of shape (n_samples,) or (n_samples, n_outputs) 

Target values.  
sample_weightarray-like of shape (n_samples,), default=None 

Sample weights.    Returns 
 
selfobject
predict(X) [source]
 
Perform classification on test vectors X.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

Test data.    Returns 
 
yarray-like of shape (n_samples,) or (n_samples, n_outputs) 

Predicted target values for X.
predict_log_proba(X) [source]
 
Return log probability estimates for the test vectors X.  Parameters 
 
X{array-like, object with finite length or shape} 

Training data, requires length = n_samples    Returns 
 
Pndarray of shape (n_samples, n_classes) or list of such arrays 

Returns the log probability of the sample for each class in the model, where classes are ordered arithmetically for each output.
predict_proba(X) [source]
 
Return probability estimates for the test vectors X.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

Test data.    Returns 
 
Pndarray of shape (n_samples, n_classes) or list of such arrays 

Returns the probability of the sample for each class in the model, where classes are ordered arithmetically, for each output.
score(X, y, sample_weight=None) [source]
 
Returns the mean accuracy on the given test data and labels. In multi-label classification, this is the subset accuracy which is a harsh metric since you require for each sample that each label set be correctly predicted.  Parameters 
 
XNone or array-like of shape (n_samples, n_features) 

Test samples. Passing None as test samples gives the same result as passing real test samples, since DummyClassifier operates independently of the sampled observations.  
yarray-like of shape (n_samples,) or (n_samples, n_outputs) 

True labels for X.  
sample_weightarray-like of shape (n_samples,), default=None 

Sample weights.    Returns 
 
scorefloat 

Mean accuracy of self.predict(X) wrt. y.
fit(X, y, sample_weight=None) [source]
 
Fit the random regressor.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

Training data.  
yarray-like of shape (n_samples,) or (n_samples, n_outputs) 

Target values.  
sample_weightarray-like of shape (n_samples,), default=None 

Sample weights.    Returns 
 
selfobject
predict(X, return_std=False) [source]
 
Perform classification on test vectors X.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

Test data.  
return_stdbool, default=False 

Whether to return the standard deviation of posterior prediction. All zeros in this case.  New in version 0.20.     Returns 
 
yarray-like of shape (n_samples,) or (n_samples, n_outputs) 

Predicted target values for X.  
y_stdarray-like of shape (n_samples,) or (n_samples, n_outputs) 

Standard deviation of predictive distribution of query points.
score(X, y, sample_weight=None) [source]
 
Returns the coefficient of determination R^2 of the prediction. The coefficient R^2 is defined as (1 - u/v), where u is the residual sum of squares ((y_true - y_pred) ** 2).sum() and v is the total sum of squares ((y_true - y_true.mean()) ** 2).sum(). The best possible score is 1.0 and it can be negative (because the model can be arbitrarily worse). A constant model that always predicts the expected value of y, disregarding the input features, would get a R^2 score of 0.0.  Parameters 
 
XNone or array-like of shape (n_samples, n_features) 

Test samples. Passing None as test samples gives the same result as passing real test samples, since DummyRegressor operates independently of the sampled observations.  
yarray-like of shape (n_samples,) or (n_samples, n_outputs) 

True values for X.  
sample_weightarray-like of shape (n_samples,), default=None 

Sample weights.    Returns 
 
scorefloat 

R^2 of self.predict(X) wrt. y.
decision_function(X) [source]
 
Compute the decision function of X.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The training input samples. Sparse matrix can be CSC, CSR, COO, DOK, or LIL. COO, DOK, and LIL are converted to CSR.    Returns 
 
scorendarray of shape of (n_samples, k) 

The decision function of the input samples. The order of outputs is the same of that of the classes_ attribute. Binary classification is a special cases with k == 1, otherwise k==n_classes. For binary classification, values closer to -1 or 1 mean more like the first or second class in classes_, respectively.
property feature_importances_  
The impurity-based feature importances. The higher, the more important the feature. The importance of a feature is computed as the (normalized) total reduction of the criterion brought by that feature. It is also known as the Gini importance. Warning: impurity-based feature importances can be misleading for high cardinality features (many unique values). See sklearn.inspection.permutation_importance as an alternative.  Returns 
 
feature_importances_ndarray of shape (n_features,) 

The feature importances.
fit(X, y, sample_weight=None) [source]
 
Build a boosted classifier from the training set (X, y).  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The training input samples. Sparse matrix can be CSC, CSR, COO, DOK, or LIL. COO, DOK, and LIL are converted to CSR.  
yarray-like of shape (n_samples,) 

The target values (class labels).  
sample_weightarray-like of shape (n_samples,), default=None 

Sample weights. If None, the sample weights are initialized to 1 / n_samples.    Returns 
 
selfobject 

Fitted estimator.
predict(X) [source]
 
Predict classes for X. The predicted class of an input sample is computed as the weighted mean prediction of the classifiers in the ensemble.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The training input samples. Sparse matrix can be CSC, CSR, COO, DOK, or LIL. COO, DOK, and LIL are converted to CSR.    Returns 
 
yndarray of shape (n_samples,) 

The predicted classes.
predict_log_proba(X) [source]
 
Predict class log-probabilities for X. The predicted class log-probabilities of an input sample is computed as the weighted mean predicted class log-probabilities of the classifiers in the ensemble.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The training input samples. Sparse matrix can be CSC, CSR, COO, DOK, or LIL. COO, DOK, and LIL are converted to CSR.    Returns 
 
pndarray of shape (n_samples, n_classes) 

The class probabilities of the input samples. The order of outputs is the same of that of the classes_ attribute.
predict_proba(X) [source]
 
Predict class probabilities for X. The predicted class probabilities of an input sample is computed as the weighted mean predicted class probabilities of the classifiers in the ensemble.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The training input samples. Sparse matrix can be CSC, CSR, COO, DOK, or LIL. COO, DOK, and LIL are converted to CSR.    Returns 
 
pndarray of shape (n_samples, n_classes) 

The class probabilities of the input samples. The order of outputs is the same of that of the classes_ attribute.
staged_decision_function(X) [source]
 
Compute decision function of X for each boosting iteration. This method allows monitoring (i.e. determine error on testing set) after each boosting iteration.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The training input samples. Sparse matrix can be CSC, CSR, COO, DOK, or LIL. COO, DOK, and LIL are converted to CSR.    Yields 
 
scoregenerator of ndarray of shape (n_samples, k) 

The decision function of the input samples. The order of outputs is the same of that of the classes_ attribute. Binary classification is a special cases with k == 1, otherwise k==n_classes. For binary classification, values closer to -1 or 1 mean more like the first or second class in classes_, respectively.
staged_predict(X) [source]
 
Return staged predictions for X. The predicted class of an input sample is computed as the weighted mean prediction of the classifiers in the ensemble. This generator method yields the ensemble prediction after each iteration of boosting and therefore allows monitoring, such as to determine the prediction on a test set after each boost.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

The input samples. Sparse matrix can be CSC, CSR, COO, DOK, or LIL. COO, DOK, and LIL are converted to CSR.    Yields 
 
ygenerator of ndarray of shape (n_samples,) 

The predicted classes.
staged_predict_proba(X) [source]
 
Predict class probabilities for X. The predicted class probabilities of an input sample is computed as the weighted mean predicted class probabilities of the classifiers in the ensemble. This generator method yields the ensemble predicted class probabilities after each iteration of boosting and therefore allows monitoring, such as to determine the predicted class probabilities on a test set after each boost.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The training input samples. Sparse matrix can be CSC, CSR, COO, DOK, or LIL. COO, DOK, and LIL are converted to CSR.    Yields 
 
pgenerator of ndarray of shape (n_samples,) 

The class probabilities of the input samples. The order of outputs is the same of that of the classes_ attribute.
staged_score(X, y, sample_weight=None) [source]
 
Return staged scores for X, y. This generator method yields the ensemble score after each iteration of boosting and therefore allows monitoring, such as to determine the score on a test set after each boost.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The training input samples. Sparse matrix can be CSC, CSR, COO, DOK, or LIL. COO, DOK, and LIL are converted to CSR.  
yarray-like of shape (n_samples,) 

Labels for X.  
sample_weightarray-like of shape (n_samples,), default=None 

Sample weights.    Yields 
 
zfloat
fit(X, y, sample_weight=None) [source]
 
Build a boosted regressor from the training set (X, y).  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The training input samples. Sparse matrix can be CSC, CSR, COO, DOK, or LIL. COO, DOK, and LIL are converted to CSR.  
yarray-like of shape (n_samples,) 

The target values (real numbers).  
sample_weightarray-like of shape (n_samples,), default=None 

Sample weights. If None, the sample weights are initialized to 1 / n_samples.    Returns 
 
selfobject