neulab/docprompting-conala huggingface dataset:
predict(X) [source]
 
Predict regression value for X. The predicted regression value of an input sample is computed as the weighted median 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 regression values.
staged_predict(X) [source]
 
Return staged predictions for X. The predicted regression value of an input sample is computed as the weighted median 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 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The training input samples.    Yields 
 
ygenerator of ndarray of shape (n_samples,) 

The predicted regression values.
decision_function(X) [source]
 
Average of the decision functions of the base classifiers.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The training input samples. Sparse matrices are accepted only if they are supported by the base estimator.    Returns 
 
scorendarray of shape (n_samples, k) 

The decision function of the input samples. The columns correspond to the classes in sorted order, as they appear in the attribute classes_. Regression and binary classification are special cases with k == 1, otherwise k==n_classes.
property estimators_samples_  
The subset of drawn samples for each base estimator. Returns a dynamically generated list of indices identifying the samples used for fitting each member of the ensemble, i.e., the in-bag samples. Note: the list is re-created at each call to the property in order to reduce the object memory footprint by not storing the sampling data. Thus fetching the property may be slower than expected.
fit(X, y, sample_weight=None) [source]
 
 Build a Bagging ensemble of estimators from the training

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

The training input samples. Sparse matrices are accepted only if they are supported by the base estimator.  
yarray-like of shape (n_samples,) 

The target values (class labels in classification, real numbers in regression).  
sample_weightarray-like of shape (n_samples,), default=None 

Sample weights. If None, then samples are equally weighted. Note that this is supported only if the base estimator supports sample weighting.    Returns 
 
selfobject
predict(X) [source]
 
Predict class for X. The predicted class of an input sample is computed as the class with the highest mean predicted probability. If base estimators do not implement a predict_proba method, then it resorts to voting.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The training input samples. Sparse matrices are accepted only if they are supported by the base estimator.    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 log of the mean predicted class probabilities of the base estimators in the ensemble.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The training input samples. Sparse matrices are accepted only if they are supported by the base estimator.    Returns 
 
pndarray 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. The predicted class probabilities of an input sample is computed as the mean predicted class probabilities of the base estimators in the ensemble. If base estimators do not implement a predict_proba method, then it resorts to voting and the predicted class probabilities of an input sample represents the proportion of estimators predicting each class.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The training input samples. Sparse matrices are accepted only if they are supported by the base estimator.    Returns 
 
pndarray 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_.
predict(X) [source]
 
Predict regression target for X. The predicted regression target of an input sample is computed as the mean predicted regression targets of the estimators in the ensemble.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The training input samples. Sparse matrices are accepted only if they are supported by the base estimator.    Returns 
 
yndarray of shape (n_samples,) 

The predicted values.
apply(X) [source]
 
Apply trees in the forest to X, return leaf indices.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The input samples. Internally, its dtype will be converted to dtype=np.float32. If a sparse matrix is provided, it will be converted into a sparse csr_matrix.    Returns 
 
X_leavesndarray of shape (n_samples, n_estimators) 

For each datapoint x in X and for each tree in the forest, return the index of the leaf x ends up in.
decision_path(X) [source]
 
Return the decision path in the forest.  New in version 0.18.   Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The input samples. Internally, its dtype will be converted to dtype=np.float32. If a sparse matrix is provided, it will be converted into a sparse csr_matrix.    Returns 
 
indicatorsparse matrix of shape (n_samples, n_nodes) 

Return a node indicator matrix where non zero elements indicates that the samples goes through the nodes. The matrix is of CSR format.  
n_nodes_ptrndarray of shape (n_estimators + 1,) 

The columns from indicator[n_nodes_ptr[i]:n_nodes_ptr[i+1]] gives the indicator value for the i-th estimator.
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 values of this array sum to 1, unless all trees are single node trees consisting of only the root node, in which case it will be an array of zeros.
fit(X, y, sample_weight=None) [source]
 
Build a forest of trees from the training set (X, y).  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The training input samples. Internally, its dtype will be converted to dtype=np.float32. If a sparse matrix is provided, it will be converted into a sparse csc_matrix.  
yarray-like of shape (n_samples,) or (n_samples, n_outputs) 

The target values (class labels in classification, real numbers in regression).  
sample_weightarray-like of shape (n_samples,), default=None 

Sample weights. If None, then samples are equally weighted. Splits that would create child nodes with net zero or negative weight are ignored while searching for a split in each node. In the case of classification, splits are also ignored if they would result in any single class carrying a negative weight in either child node.    Returns 
 
selfobject
predict(X) [source]
 
Predict class for X. The predicted class of an input sample is a vote by the trees in the forest, weighted by their probability estimates. That is, the predicted class is the one with highest mean probability estimate across the trees.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The input samples. Internally, its dtype will be converted to dtype=np.float32. If a sparse matrix is provided, it will be converted into a sparse csr_matrix.    Returns 
 
yndarray of shape (n_samples,) or (n_samples, n_outputs) 

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 log of the mean predicted class probabilities of the trees in the forest.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The input samples. Internally, its dtype will be converted to dtype=np.float32. If a sparse matrix is provided, it will be converted into a sparse csr_matrix.    Returns 
 
pndarray of shape (n_samples, n_classes), or a list of n_outputs 

such arrays if n_outputs > 1. The class 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. The predicted class probabilities of an input sample are computed as the mean predicted class probabilities of the trees in the forest. The class probability of a single tree is the fraction of samples of the same class in a leaf.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The input samples. Internally, its dtype will be converted to dtype=np.float32. If a sparse matrix is provided, it will be converted into a sparse csr_matrix.    Returns 
 
pndarray of shape (n_samples, n_classes), or a list of n_outputs 

such arrays if n_outputs > 1. The class probabilities of the input samples. The order of the classes corresponds to that in the attribute classes_.
predict(X) [source]
 
Predict regression target for X. The predicted regression target of an input sample is computed as the mean predicted regression targets of the trees in the forest.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The input samples. Internally, its dtype will be converted to dtype=np.float32. If a sparse matrix is provided, it will be converted into a sparse csr_matrix.    Returns 
 
yndarray of shape (n_samples,) or (n_samples, n_outputs) 

The predicted values.
apply(X) [source]
 
Apply trees in the ensemble to X, return leaf indices.  New in version 0.17.   Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The input samples. Internally, its dtype will be converted to dtype=np.float32. If a sparse matrix is provided, it will be converted to a sparse csr_matrix.    Returns 
 
X_leavesarray-like of shape (n_samples, n_estimators, n_classes) 

For each datapoint x in X and for each tree in the ensemble, return the index of the leaf x ends up in each estimator. In the case of binary classification n_classes is 1.
decision_function(X) [source]
 
Compute the decision function of X.  Parameters 
 
X{array-like, 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 
 
scorendarray of shape (n_samples, n_classes) or (n_samples,) 

The decision function of the input samples, which corresponds to the raw values predicted from the trees of the ensemble . 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, sample_weight=None, monitor=None) [source]
 
Fit the gradient boosting model.  Parameters 
 
X{array-like, 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.  
yarray-like of shape (n_samples,) 

Target values (strings or integers in classification, real numbers in regression) For classification, labels must correspond to classes.  
sample_weightarray-like of shape (n_samples,), default=None 

Sample weights. If None, then samples are equally weighted. Splits that would create child nodes with net zero or negative weight are ignored while searching for a split in each node. In the case of classification, splits are also ignored if they would result in any single class carrying a negative weight in either child node.  
monitorcallable, default=None 

The monitor is called after each iteration with the current iteration, a reference to the estimator and the local variables of _fit_stages as keyword arguments callable(i, self,
locals()). If the callable returns True the fitting procedure is stopped. The monitor can be used for various things such as computing held-out estimates, early stopping, model introspect, and snapshoting.    Returns 
 
selfobject
predict(X) [source]
 
Predict class for X.  Parameters 
 
X{array-like, 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 
 
yndarray of shape (n_samples,) 

The predicted values.
predict_log_proba(X) [source]
 
Predict class log-probabilities for X.  Parameters 
 
X{array-like, 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 
 
pndarray 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_.    Raises 
 AttributeError

If the loss does not support probabilities.
predict_proba(X) [source]
 
Predict class probabilities for X.  Parameters 
 
X{array-like, 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 
 
pndarray 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_.    Raises 
 AttributeError

If the loss does not support probabilities.
staged_decision_function(X) [source]
 
Compute decision function of X for each iteration. This method allows monitoring (i.e. determine error on testing set) after each stage.  Parameters 
 
X{array-like, 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 
 
scoregenerator of ndarray of shape (n_samples, k) 

The decision function of the input samples, which corresponds to the raw values predicted from the trees of the ensemble . The classes corresponds to that in the attribute classes_. Regression and binary classification are special cases with k == 1, otherwise k==n_classes.
staged_predict(X) [source]
 
Predict class at each stage for X. This method allows monitoring (i.e. determine error on testing set) after each stage.  Parameters 
 
X{array-like, 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 
 
ygenerator of ndarray of shape (n_samples,) 

The predicted value of the input samples.
staged_predict_proba(X) [source]
 
Predict class probabilities at each stage for X. This method allows monitoring (i.e. determine error on testing set) after each stage.  Parameters 
 
X{array-like, 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 
 
ygenerator of ndarray of shape (n_samples,) 

The predicted value of the input samples.
apply(X) [source]
 
Apply trees in the ensemble to X, return leaf indices.  New in version 0.17.   Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The input samples. Internally, its dtype will be converted to dtype=np.float32. If a sparse matrix is provided, it will be converted to a sparse csr_matrix.    Returns 
 
X_leavesarray-like of shape (n_samples, n_estimators) 

For each datapoint x in X and for each tree in the ensemble, return the index of the leaf x ends up in each estimator.
predict(X) [source]
 
Predict regression target for X.  Parameters 
 
X{array-like, 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 
 
yndarray of shape (n_samples,) 

The predicted values.
staged_predict(X) [source]
 
Predict regression target at each stage for X. This method allows monitoring (i.e. determine error on testing set) after each stage.  Parameters 
 
X{array-like, 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 
 
ygenerator of ndarray of shape (n_samples,) 

The predicted value of the input samples.
decision_function(X) [source]
 
Compute the decision function of X.  Parameters 
 
Xarray-like, shape (n_samples, n_features) 

The input samples.    Returns 
 
decisionndarray, shape (n_samples,) or (n_samples, n_trees_per_iteration) 

The raw predicted values (i.e. the sum of the trees leaves) for each sample. n_trees_per_iteration is equal to the number of classes in multiclass classification.
fit(X, y, sample_weight=None) [source]
 
Fit the gradient boosting model.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

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

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

Weights of training data.  New in version 0.23.     Returns 
 
selfobject
predict(X) [source]
 
Predict classes for X.  Parameters 
 
Xarray-like, shape (n_samples, n_features) 

The input samples.    Returns 
 
yndarray, shape (n_samples,) 

The predicted classes.
predict_proba(X) [source]
 
Predict class probabilities for X.  Parameters 
 
Xarray-like, shape (n_samples, n_features) 

The input samples.    Returns 
 
pndarray, shape (n_samples, n_classes) 

The class probabilities of the input samples.
staged_decision_function(X) [source]
 
Compute decision function of X for each iteration. This method allows monitoring (i.e. determine error on testing set) after each stage.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

The input samples.    Yields 
 
decisiongenerator of ndarray of shape (n_samples,) or (n_samples, n_trees_per_iteration) 

The decision function of the input samples, which corresponds to the raw values predicted from the trees of the ensemble . The classes corresponds to that in the attribute classes_.
staged_predict(X) [source]
 
Predict classes at each iteration. This method allows monitoring (i.e. determine error on testing set) after each stage.  New in version 0.24.   Parameters 
 
Xarray-like of shape (n_samples, n_features) 

The input samples.    Yields 
 
ygenerator of ndarray of shape (n_samples,) 

The predicted classes of the input samples, for each iteration.
staged_predict_proba(X) [source]
 
Predict class probabilities at each iteration. This method allows monitoring (i.e. determine error on testing set) after each stage.  Parameters 
 
Xarray-like of shape (n_samples, n_features) 

The input samples.    Yields 
 
ygenerator of ndarray of shape (n_samples,) 

The predicted class probabilities of the input samples, for each iteration.
predict(X) [source]
 
Predict values for X.  Parameters 
 
Xarray-like, shape (n_samples, n_features) 

The input samples.    Returns 
 
yndarray, shape (n_samples,) 

The predicted values.
staged_predict(X) [source]
 
Predict regression target for each iteration This method allows monitoring (i.e. determine error on testing set) after each stage.  New in version 0.24.   Parameters 
 
Xarray-like of shape (n_samples, n_features) 

The input samples.    Yields 
 
ygenerator of ndarray of shape (n_samples,) 

The predicted values of the input samples, for each iteration.
decision_function(X) [source]
 
Average anomaly score of X of the base classifiers. The anomaly score of an input sample is computed as the mean anomaly score of the trees in the forest. The measure of normality of an observation given a tree is the depth of the leaf containing this observation, which is equivalent to the number of splittings required to isolate this point. In case of several observations n_left in the leaf, the average path length of a n_left samples isolation tree is added.  Parameters 
 
X{array-like, 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 
 
scoresndarray of shape (n_samples,) 

The anomaly score of the input samples. The lower, the more abnormal. Negative scores represent outliers, positive scores represent inliers.
fit(X, y=None, sample_weight=None) [source]
 
Fit estimator.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The input samples. Use dtype=np.float32 for maximum efficiency. Sparse matrices are also supported, use sparse csc_matrix for maximum efficiency.  
yIgnored 

Not used, present for API consistency by convention.  
sample_weightarray-like of shape (n_samples,), default=None 

Sample weights. If None, then samples are equally weighted.    Returns 
 
selfobject 

Fitted estimator.
predict(X) [source]
 
Predict if a particular sample is an outlier or not.  Parameters 
 
X{array-like, 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 
 
is_inlierndarray of shape (n_samples,) 

For each observation, tells whether or not (+1 or -1) it should be considered as an inlier according to the fitted model.
score_samples(X) [source]
 
Opposite of the anomaly score defined in the original paper. The anomaly score of an input sample is computed as the mean anomaly score of the trees in the forest. The measure of normality of an observation given a tree is the depth of the leaf containing this observation, which is equivalent to the number of splittings required to isolate this point. In case of several observations n_left in the leaf, the average path length of a n_left samples isolation tree is added.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The input samples.    Returns 
 
scoresndarray of shape (n_samples,) 

The anomaly score of the input samples. The lower, the more abnormal.
fit(X, y=None, sample_weight=None) [source]
 
Fit estimator.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

The input samples. Use dtype=np.float32 for maximum efficiency. Sparse matrices are also supported, use sparse csc_matrix for maximum efficiency.  
yIgnored 

Not used, present for API consistency by convention.  
sample_weightarray-like of shape (n_samples,), default=None 

Sample weights. If None, then samples are equally weighted. Splits that would create child nodes with net zero or negative weight are ignored while searching for a split in each node. In the case of classification, splits are also ignored if they would result in any single class carrying a negative weight in either child node.    Returns 
 
selfobject
fit_transform(X, y=None, sample_weight=None) [source]
 
Fit estimator and transform dataset.  Parameters 
 
X{array-like, sparse matrix} of shape (n_samples, n_features) 

Input data used to build forests. Use dtype=np.float32 for maximum efficiency.  
yIgnored 

Not used, present for API consistency by convention.  
sample_weightarray-like of shape (n_samples,), default=None 

Sample weights. If None, then samples are equally weighted. Splits that would create child nodes with net zero or negative weight are ignored while searching for a split in each node. In the case of classification, splits are also ignored if they would result in any single class carrying a negative weight in either child node.    Returns 
 
X_transformedsparse matrix of shape (n_samples, n_out) 

Transformed dataset.