|
Medial Code Documentation
|
Data Structures | |
| class | XGBClassifier |
| class | XGBModel |
| class | XGBRanker |
| class | XGBRankerMixIn |
| class | XGBRegressor |
| class | XGBRFClassifier |
| class | XGBRFRegressor |
Functions | |
| None | _check_rf_callback (Optional[int] early_stopping_rounds, Optional[Sequence[TrainingCallback]] callbacks) |
| bool | _can_use_qdm (Optional[str] tree_method) |
| Objective | _objective_decorator (Callable[[np.ndarray, np.ndarray], Tuple[np.ndarray, np.ndarray]] func) |
| Metric | _metric_decorator (Callable func) |
| Metric | ltr_metric_decorator (Callable func, Optional[int] n_jobs) |
| Callable[[Type], Type] | xgboost_model_doc (str header, List[str] items, Optional[str] extra_parameters=None, Optional[str] end_note=None) |
| Tuple[Any, List[Tuple[Any, str]]] | _wrap_evaluation_matrices (float missing, Any X, Any y, Optional[Any] group, Optional[Any] qid, Optional[Any] sample_weight, Optional[Any] base_margin, Optional[Any] feature_weights, Optional[Sequence[Tuple[Any, Any]]] eval_set, Optional[Sequence[Any]] sample_weight_eval_set, Optional[Sequence[Any]] base_margin_eval_set, Optional[Sequence[Any]] eval_group, Optional[Sequence[Any]] eval_qid, Callable create_dmatrix, bool enable_categorical, Optional[FeatureTypes] feature_types) |
| PredtT | _cls_predict_proba (int n_classes, PredtT prediction, Callable vstack) |
| Tuple[ArrayLike, Optional[ArrayLike]] | _get_qid (ArrayLike X, Optional[ArrayLike] qid) |
Variables | |
| SklObjective | |
| int | DEFAULT_N_ESTIMATORS = 100 |
| PredtT = TypeVar("PredtT", bound=np.ndarray) | |
Scikit-Learn Wrapper interface for XGBoost.
|
protected |
Get the special qid column from X if exists.
|
protected |
Decorate a metric function from sklearn. Converts an metric function that uses the typical sklearn metric signature so that it is compatible with :py:func:`train`
|
protected |
Decorate an objective function
Converts an objective function using the typical sklearn metrics
signature so that it is usable with ``xgboost.training.train``
Parameters
----------
func:
Expects a callable with signature ``func(y_true, y_pred)``:
y_true: array_like of shape [n_samples]
The target values
y_pred: array_like of shape [n_samples]
The predicted values
Returns
-------
new_func:
The new objective function as expected by ``xgboost.training.train``.
The signature is ``new_func(preds, dmatrix)``:
preds: array_like, shape [n_samples]
The predicted values
dmatrix: ``DMatrix``
The training set from which the labels will be extracted using
``dmatrix.get_label()``
|
protected |
Convert array_like evaluation matrices into DMatrix. Perform validation on the way.
| Metric xgboost.sklearn.ltr_metric_decorator | ( | Callable | func, |
| Optional[int] | n_jobs | ||
| ) |
Decorate a learning to rank metric.
| Callable[[Type], Type] xgboost.sklearn.xgboost_model_doc | ( | str | header, |
| List[str] | items, | ||
| Optional[str] | extra_parameters = None, |
||
| Optional[str] | end_note = None |
||
| ) |
Obtain documentation for Scikit-Learn wrappers
Parameters
----------
header: str
An introducion to the class.
items : list
A list of common doc items. Available items are:
- estimators: the meaning of n_estimators
- model: All the other parameters
- objective: note for customized objective
extra_parameters: str
Document for class specific parameters, placed at the head.
end_note: str
Extra notes put to the end.
| xgboost.sklearn.SklObjective |