neulab/docprompting-conala huggingface dataset:
sklearn.feature_selection.mutual_info_regression(X, y, *, discrete_features='auto', n_neighbors=3, copy=True, random_state=None) [source]
 
Estimate mutual information for a continuous target variable. Mutual information (MI) [1] between two random variables is a non-negative value, which measures the dependency between the variables. It is equal to zero if and only if two random variables are independent, and higher values mean higher dependency. The function relies on nonparametric methods based on entropy estimation from k-nearest neighbors distances as described in [2] and [3]. Both methods are based on the idea originally proposed in [4]. It can be used for univariate features selection, read more in the User Guide.  Parameters 
 
Xarray-like or sparse matrix, shape (n_samples, n_features) 

Feature matrix.  
yarray-like of shape (n_samples,) 

Target vector.  
discrete_features{‘auto’, bool, array-like}, default=’auto’ 

If bool, then determines whether to consider all features discrete or continuous. If array, then it should be either a boolean mask with shape (n_features,) or array with indices of discrete features. If ‘auto’, it is assigned to False for dense X and to True for sparse X.  
n_neighborsint, default=3 

Number of neighbors to use for MI estimation for continuous variables, see [2] and [3]. Higher values reduce variance of the estimation, but could introduce a bias.  
copybool, default=True 

Whether to make a copy of the given data. If set to False, the initial data will be overwritten.  
random_stateint, RandomState instance or None, default=None 

Determines random number generation for adding small noise to continuous variables in order to remove repeated values. Pass an int for reproducible results across multiple function calls. See Glossary.    Returns 
 
mindarray, shape (n_features,) 

Estimated mutual information between each feature and the target.     Notes  The term “discrete features” is used instead of naming them “categorical”, because it describes the essence more accurately. For example, pixel intensities of an image are discrete features (but hardly categorical) and you will get better results if mark them as such. Also note, that treating a continuous variable as discrete and vice versa will usually give incorrect results, so be attentive about that. True mutual information can’t be negative. If its estimate turns out to be negative, it is replaced by zero.  References  
1  
Mutual Information on Wikipedia.  
2(1,2)  
A. Kraskov, H. Stogbauer and P. Grassberger, “Estimating mutual information”. Phys. Rev. E 69, 2004.  
3(1,2)  
B. C. Ross “Mutual Information between Discrete and Continuous Data Sets”. PLoS ONE 9(2), 2014.  
4  
L. F. Kozachenko, N. N. Leonenko, “Sample Estimate of the Entropy of a Random Vector”, Probl. Peredachi Inf., 23:2 (1987), 9-16
decision_function(X) [source]
 
Compute the decision function of X.  Parameters 
 
X{array-like or sparse matrix} of shape (n_samples, n_features) 

The input samples. Internally, it will be converted to dtype=np.float32 and if a sparse matrix is provided to a sparse csr_matrix.    Returns 
 
scorearray, shape = [n_samples, n_classes] or [n_samples] 

The decision function of the input samples. The order of the classes corresponds to that in the attribute classes_. Regression and binary classification produce an array of shape [n_samples].
fit(X, y) [source]
 
 Fit the RFE model and then the underlying estimator on the selected

features.    Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The training input samples.  
yarray-like of shape (n_samples,) 

The target values.
predict(X) [source]
 
 Reduce X to the selected features and then predict using the

underlying estimator.    Parameters 
 
Xarray of shape [n_samples, n_features] 

The input samples.    Returns 
 
yarray of shape [n_samples] 

The predicted target values.
predict_log_proba(X) [source]
 
Predict class log-probabilities for X.  Parameters 
 
Xarray of shape [n_samples, n_features] 

The input samples.    Returns 
 
parray of shape (n_samples, n_classes) 

The class log-probabilities of the input samples. The order of the classes corresponds to that in the attribute classes_.
predict_proba(X) [source]
 
Predict class probabilities for X.  Parameters 
 
X{array-like or sparse matrix} of shape (n_samples, n_features) 

The input samples. Internally, it will be converted to dtype=np.float32 and if a sparse matrix is provided to a sparse csr_matrix.    Returns 
 
parray of shape (n_samples, n_classes) 

The class probabilities of the input samples. The order of the classes corresponds to that in the attribute classes_.
score(X, y) [source]
 
 Reduce X to the selected features and then return the score of the

underlying estimator.    Parameters 
 
Xarray of shape [n_samples, n_features] 

The input samples.  
yarray of shape [n_samples] 

The target values.
fit(X, y, groups=None) [source]
 
 Fit the RFE model and automatically tune the number of selected

features.    Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

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

Target values (integers for classification, real numbers for regression).  
groupsarray-like of shape (n_samples,) or None, default=None 

Group labels for the samples used while splitting the dataset into train/test set. Only used in conjunction with a “Group” cv instance (e.g., GroupKFold).  New in version 0.20.
fit(X, y=None, **fit_params) [source]
 
Fit the SelectFromModel meta-transformer.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

The training input samples.  
yarray-like of shape (n_samples,), default=None 

The target values (integers that correspond to classes in classification, real numbers in regression).  
**fit_paramsOther estimator specific parameters 
  Returns 
 
selfobject
partial_fit(X, y=None, **fit_params) [source]
 
Fit the SelectFromModel meta-transformer only once.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

The training input samples.  
yarray-like of shape (n_samples,), default=None 

The target values (integers that correspond to classes in classification, real numbers in regression).  
**fit_paramsOther estimator specific parameters 
  Returns 
 
selfobject
class sklearn.feature_selection.SelectorMixin [source]
 
Transformer mixin that performs feature selection given a support mask This mixin provides a feature selector implementation with transform and inverse_transform functionality given an implementation of _get_support_mask. Methods  
fit_transform(X[, y]) Fit to data, then transform it.  
get_support([indices]) Get a mask, or integer index, of the features selected  
inverse_transform(X) Reverse the transformation operation  
transform(X) Reduce X to the selected features.    
fit_transform(X, y=None, **fit_params) [source]
 
Fit to data, then transform it. Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

Input samples.  
yarray-like of shape (n_samples,) or (n_samples, n_outputs), default=None 

Target values (None for unsupervised transformations).  
**fit_paramsdict 

Additional fit parameters.    Returns 
 
X_newndarray array of shape (n_samples, n_features_new) 

Transformed array.     
  
get_support(indices=False) [source]
 
Get a mask, or integer index, of the features selected  Parameters 
 
indicesbool, default=False 

If True, the return value will be an array of integers, rather than a boolean mask.    Returns 
 
supportarray 

An index that selects the retained features from a feature vector. If indices is False, this is a boolean array of shape [# input features], in which an element is True iff its corresponding feature is selected for retention. If indices is True, this is an integer array of shape [# output features] whose values are indices into the input feature vector.     
  
inverse_transform(X) [source]
 
Reverse the transformation operation  Parameters 
 
Xarray of shape [n_samples, n_selected_features] 

The input samples.    Returns 
 
X_rarray of shape [n_samples, n_original_features] 

X with columns of zeros inserted where features would have been removed by transform.     
  
transform(X) [source]
 
Reduce X to the selected features.  Parameters 
 
Xarray of shape [n_samples, n_features] 

The input samples.    Returns 
 
X_rarray of shape [n_samples, n_selected_features] 

The input samples with only the selected features.
sklearn.feature_selection.SelectorMixin  
class sklearn.feature_selection.SelectorMixin [source]
 
Transformer mixin that performs feature selection given a support mask This mixin provides a feature selector implementation with transform and inverse_transform functionality given an implementation of _get_support_mask. Methods  
fit_transform(X[, y]) Fit to data, then transform it.  
get_support([indices]) Get a mask, or integer index, of the features selected  
inverse_transform(X) Reverse the transformation operation  
transform(X) Reduce X to the selected features.    
fit_transform(X, y=None, **fit_params) [source]
 
Fit to data, then transform it. Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

Input samples.  
yarray-like of shape (n_samples,) or (n_samples, n_outputs), default=None 

Target values (None for unsupervised transformations).  
**fit_paramsdict 

Additional fit parameters.    Returns 
 
X_newndarray array of shape (n_samples, n_features_new) 

Transformed array.     
  
get_support(indices=False) [source]
 
Get a mask, or integer index, of the features selected  Parameters 
 
indicesbool, default=False 

If True, the return value will be an array of integers, rather than a boolean mask.    Returns 
 
supportarray 

An index that selects the retained features from a feature vector. If indices is False, this is a boolean array of shape [# input features], in which an element is True iff its corresponding feature is selected for retention. If indices is True, this is an integer array of shape [# output features] whose values are indices into the input feature vector.     
  
inverse_transform(X) [source]
 
Reverse the transformation operation  Parameters 
 
Xarray of shape [n_samples, n_selected_features] 

The input samples.    Returns 
 
X_rarray of shape [n_samples, n_original_features] 

X with columns of zeros inserted where features would have been removed by transform.     
  
transform(X) [source]
 
Reduce X to the selected features.  Parameters 
 
Xarray of shape [n_samples, n_features] 

The input samples.    Returns 
 
X_rarray of shape [n_samples, n_selected_features] 

The input samples with only the selected features.
fit(X, y) [source]
 
Learn the features to select.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

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

Target values.    Returns 
 
selfobject
fit(X, y=None) [source]
 
Learn empirical variances from X.  Parameters 
 
X{array-like, sparse matrix}, shape (n_samples, n_features) 

Sample vectors from which to compute variances.  
yany, default=None 

Ignored. This parameter exists only for compatibility with sklearn.pipeline.Pipeline.    Returns 
 self
fit(X, y) [source]
 
Fit Gaussian process classification model  Parameters 
 
Xarray-like of shape (n_samples, n_features) or list of object 

Feature vectors or other representations of training data.  
yarray-like of shape (n_samples,) 

Target values, must be binary    Returns 
 
selfreturns an instance of self.
log_marginal_likelihood(theta=None, eval_gradient=False, clone_kernel=True) [source]
 
Returns log-marginal likelihood of theta for training data. In the case of multi-class classification, the mean log-marginal likelihood of the one-versus-rest classifiers are returned.  Parameters 
 
thetaarray-like of shape (n_kernel_params,), default=None 

Kernel hyperparameters for which the log-marginal likelihood is evaluated. In the case of multi-class classification, theta may be the hyperparameters of the compound kernel or of an individual kernel. In the latter case, all individual kernel get assigned the same theta values. If None, the precomputed log_marginal_likelihood of self.kernel_.theta is returned.  
eval_gradientbool, default=False 

If True, the gradient of the log-marginal likelihood with respect to the kernel hyperparameters at position theta is returned additionally. Note that gradient computation is not supported for non-binary classification. If True, theta must not be None.  
clone_kernelbool, default=True 

If True, the kernel attribute is copied. If False, the kernel attribute is modified, but may result in a performance improvement.    Returns 
 
log_likelihoodfloat 

Log-marginal likelihood of theta for training data.  
log_likelihood_gradientndarray of shape (n_kernel_params,), optional 

Gradient of the log-marginal likelihood with respect to the kernel hyperparameters at position theta. Only returned when eval_gradient is True.
predict(X) [source]
 
Perform classification on an array of test vectors X.  Parameters 
 
Xarray-like of shape (n_samples, n_features) or list of object 

Query points where the GP is evaluated for classification.    Returns 
 
Cndarray of shape (n_samples,) 

Predicted target values for X, values are from classes_
predict_proba(X) [source]
 
Return probability estimates for the test vector X.  Parameters 
 
Xarray-like of shape (n_samples, n_features) or list of object 

Query points where the GP is evaluated for classification.    Returns 
 
Carray-like of shape (n_samples, n_classes) 

Returns the probability of the samples for each class in the model. The columns correspond to the classes in sorted order, as they appear in the attribute classes_.
fit(X, y) [source]
 
Fit Gaussian process regression model.  Parameters 
 
Xarray-like of shape (n_samples, n_features) or list of object 

Feature vectors or other representations of training data.  
yarray-like of shape (n_samples,) or (n_samples, n_targets) 

Target values    Returns 
 
selfreturns an instance of self.
log_marginal_likelihood(theta=None, eval_gradient=False, clone_kernel=True) [source]
 
Returns log-marginal likelihood of theta for training data.  Parameters 
 
thetaarray-like of shape (n_kernel_params,) default=None 

Kernel hyperparameters for which the log-marginal likelihood is evaluated. If None, the precomputed log_marginal_likelihood of self.kernel_.theta is returned.  
eval_gradientbool, default=False 

If True, the gradient of the log-marginal likelihood with respect to the kernel hyperparameters at position theta is returned additionally. If True, theta must not be None.  
clone_kernelbool, default=True 

If True, the kernel attribute is copied. If False, the kernel attribute is modified, but may result in a performance improvement.    Returns 
 
log_likelihoodfloat 

Log-marginal likelihood of theta for training data.  
log_likelihood_gradientndarray of shape (n_kernel_params,), optional 

Gradient of the log-marginal likelihood with respect to the kernel hyperparameters at position theta. Only returned when eval_gradient is True.
predict(X, return_std=False, return_cov=False) [source]
 
Predict using the Gaussian process regression model We can also predict based on an unfitted model by using the GP prior. In addition to the mean of the predictive distribution, also its standard deviation (return_std=True) or covariance (return_cov=True). Note that at most one of the two can be requested.  Parameters 
 
Xarray-like of shape (n_samples, n_features) or list of object 

Query points where the GP is evaluated.  
return_stdbool, default=False 

If True, the standard-deviation of the predictive distribution at the query points is returned along with the mean.  
return_covbool, default=False 

If True, the covariance of the joint predictive distribution at the query points is returned along with the mean.    Returns 
 
y_meanndarray of shape (n_samples, [n_output_dims]) 

Mean of predictive distribution a query points.  
y_stdndarray of shape (n_samples,), optional 

Standard deviation of predictive distribution at query points. Only returned when return_std is True.  
y_covndarray of shape (n_samples, n_samples), optional 

Covariance of joint predictive distribution a query points. Only returned when return_cov is True.
sample_y(X, n_samples=1, random_state=0) [source]
 
Draw samples from Gaussian process and evaluate at X.  Parameters 
 
Xarray-like of shape (n_samples, n_features) or list of object 

Query points where the GP is evaluated.  
n_samplesint, default=1 

The number of samples drawn from the Gaussian process  
random_stateint, RandomState instance or None, default=0 

Determines random number generation to randomly draw samples. Pass an int for reproducible results across multiple function calls. See :term: Glossary <random_state>.    Returns 
 
y_samplesndarray of shape (n_samples_X, [n_output_dims], n_samples) 

Values of n_samples samples drawn from Gaussian process and evaluated at query points.
property bounds  
Returns the log-transformed bounds on the theta.  Returns 
 
boundsarray of shape (n_dims, 2) 

The log-transformed bounds on the kernel’s hyperparameters theta
clone_with_theta(theta) [source]
 
Returns a clone of self with given hyperparameters theta.  Parameters 
 
thetandarray of shape (n_dims,) 

The hyperparameters
diag(X) [source]
 
Returns the diagonal of the kernel k(X, X). The result of this method is identical to np.diag(self(X)); however, it can be evaluated more efficiently since only the diagonal is evaluated.  Parameters 
 
Xarray-like of shape (n_samples_X, n_features) or list of object 

Argument to the kernel.    Returns 
 
K_diagndarray of shape (n_samples_X, n_kernels) 

Diagonal of kernel k(X, X)
get_params(deep=True) [source]
 
Get parameters of this kernel.  Parameters 
 
deepbool, default=True 

If True, will return the parameters for this estimator and contained subobjects that are estimators.    Returns 
 
paramsdict 

Parameter names mapped to their values.
property n_dims  
Returns the number of non-fixed hyperparameters of the kernel.
set_params(**params) [source]
 
Set the parameters of this kernel. The method works on simple kernels as well as on nested kernels. The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object.  Returns 
 self
property theta  
Returns the (flattened, log-transformed) non-fixed hyperparameters. Note that theta are typically the log-transformed values of the kernel’s hyperparameters as this representation of the search space is more amenable for hyperparameter search, as hyperparameters like length-scales naturally live on a log-scale.  Returns 
 
thetandarray of shape (n_dims,) 

The non-fixed, log-transformed hyperparameters of the kernel
__call__(X, Y=None, eval_gradient=False) [source]
 
Return the kernel k(X, Y) and optionally its gradient. Note that this compound kernel returns the results of all simple kernel stacked along an additional axis.  Parameters 
 
Xarray-like of shape (n_samples_X, n_features) or list of object, default=None 

Left argument of the returned kernel k(X, Y)  
Yarray-like of shape (n_samples_X, n_features) or list of object, default=None 

Right argument of the returned kernel k(X, Y). If None, k(X, X) is evaluated instead.  
eval_gradientbool, default=False 

Determines whether the gradient with respect to the log of the kernel hyperparameter is computed.    Returns 
 
Kndarray of shape (n_samples_X, n_samples_Y, n_kernels) 

Kernel k(X, Y)  
K_gradientndarray of shape (n_samples_X, n_samples_X, n_dims, n_kernels), optional 

The gradient of the kernel k(X, X) with respect to the log of the hyperparameter of the kernel. Only returned when eval_gradient is True.
property bounds  
Returns the log-transformed bounds on the theta.  Returns 
 
boundsndarray of shape (n_dims, 2) 

The log-transformed bounds on the kernel’s hyperparameters theta
diag(X) [source]
 
Returns the diagonal of the kernel k(X, X). The result of this method is identical to np.diag(self(X)); however, it can be evaluated more efficiently since only the diagonal is evaluated.  Parameters 
 
Xarray-like of shape (n_samples_X, n_features) or list of object 

Argument to the kernel.    Returns 
 
K_diagndarray of shape (n_samples_X,) 

Diagonal of kernel k(X, X)
__call__(X, Y=None, eval_gradient=False) [source]
 
Return the kernel k(X, Y) and optionally its gradient.  Parameters 
 
Xarray-like of shape (n_samples_X, n_features) or list of object 

Left argument of the returned kernel k(X, Y)  
Yarray-like of shape (n_samples_X, n_features) or list of object, default=None 

Right argument of the returned kernel k(X, Y). If None, k(X, X) is evaluated instead.  
eval_gradientbool, default=False 

Determines whether the gradient with respect to the log of the kernel hyperparameter is computed. Only supported when Y is None.    Returns 
 
Kndarray of shape (n_samples_X, n_samples_Y) 

Kernel k(X, Y)  
K_gradientndarray of shape (n_samples_X, n_samples_X, n_dims), optional 

The gradient of the kernel k(X, X) with respect to the log of the hyperparameter of the kernel. Only returned when eval_gradient is True.
diag(X) [source]
 
Returns the diagonal of the kernel k(X, X). The result of this method is identical to np.diag(self(X)); however, it can be evaluated more efficiently since only the diagonal is evaluated.  Parameters 
 
Xndarray of shape (n_samples_X, n_features) 

Left argument of the returned kernel k(X, Y).    Returns 
 
K_diagndarray of shape (n_samples_X,) 

Diagonal of kernel k(X, X).
property requires_vector_input  
Returns whether the kernel is defined on fixed-length feature vectors or generic objects. Defaults to True for backward compatibility.
__call__(X, Y=None, eval_gradient=False) [source]
 
Return the kernel k(X, Y) and optionally its gradient.  Parameters 
 
Xndarray of shape (n_samples_X, n_features) 

Left argument of the returned kernel k(X, Y)  
Yndarray of shape (n_samples_Y, n_features), default=None 

Right argument of the returned kernel k(X, Y). If None, k(X, X) if evaluated instead.  
eval_gradientbool, default=False 

Determines whether the gradient with respect to the log of the kernel hyperparameter is computed. Only supported when Y is None.    Returns 
 
Kndarray of shape (n_samples_X, n_samples_Y) 

Kernel k(X, Y)  
K_gradientndarray of shape (n_samples_X, n_samples_X, n_dims), optional 

The gradient of the kernel k(X, X) with respect to the log of the hyperparameter of the kernel. Only returned when eval_gradient is True.
__call__(X, Y=None, eval_gradient=False) [source]
 
Return the kernel k(X, Y) and optionally its gradient.  Parameters 
 
Xarray-like of shape (n_samples_X, n_features) or list of object 

Left argument of the returned kernel k(X, Y)  
Yarray-like of shape (n_samples_Y, n_features) or list of object, default=None 

Right argument of the returned kernel k(X, Y). If None, k(X, X) is evaluated instead.  
eval_gradientbool, default=False 

Determines whether the gradient with respect to the log of the kernel hyperparameter is computed.    Returns 
 
Kndarray of shape (n_samples_X, n_samples_Y) 

Kernel k(X, Y)  
K_gradientndarray of shape (n_samples_X, n_samples_X, n_dims), optional 

The gradient of the kernel k(X, X) with respect to the log of the hyperparameter of the kernel. Only returned when eval_gradient is True.
diag(X) [source]
 
Returns the diagonal of the kernel k(X, X). The result of this method is identical to np.diag(self(X)); however, it can be evaluated more efficiently since only the diagonal is evaluated.  Parameters 
 
Xndarray of shape (n_samples_X, n_features) 

Left argument of the returned kernel k(X, Y)    Returns 
 
K_diagndarray of shape (n_samples_X,) 

Diagonal of kernel k(X, X)