MCPcopy Create free account
hub / github.com/dmlc/xgboost / __init__

Method __init__

python-package/xgboost/core.py:660–826  ·  view source on GitHub ↗

Parameters ---------- data : Data source of DMatrix. See :ref:`py-data` for a list of supported input types. Note that, if passing an iterator, it **will cache data on disk**, and note that fields like ``label`` will be concatenated in

(
        self,
        data: DataType,
        label: Optional[ArrayLike] = None,
        *,
        weight: Optional[ArrayLike] = None,
        base_margin: Optional[ArrayLike] = None,
        missing: Optional[float] = None,
        silent: bool = False,
        feature_names: Optional[FeatureNames] = None,
        feature_types: Optional[Union[FeatureTypes, Categories]] = None,
        nthread: Optional[int] = None,
        group: Optional[ArrayLike] = None,
        qid: Optional[ArrayLike] = None,
        label_lower_bound: Optional[ArrayLike] = None,
        label_upper_bound: Optional[ArrayLike] = None,
        feature_weights: Optional[ArrayLike] = None,
        enable_categorical: bool = True,
        data_split_mode: DataSplitMode = DataSplitMode.ROW,
    )

Source from the content-addressed store, hash-verified

658
659 @_deprecate_positional_args
660 def __init__(
661 self,
662 data: DataType,
663 label: Optional[ArrayLike] = None,
664 *,
665 weight: Optional[ArrayLike] = None,
666 base_margin: Optional[ArrayLike] = None,
667 missing: Optional[float] = None,
668 silent: bool = False,
669 feature_names: Optional[FeatureNames] = None,
670 feature_types: Optional[Union[FeatureTypes, Categories]] = None,
671 nthread: Optional[int] = None,
672 group: Optional[ArrayLike] = None,
673 qid: Optional[ArrayLike] = None,
674 label_lower_bound: Optional[ArrayLike] = None,
675 label_upper_bound: Optional[ArrayLike] = None,
676 feature_weights: Optional[ArrayLike] = None,
677 enable_categorical: bool = True,
678 data_split_mode: DataSplitMode = DataSplitMode.ROW,
679 ) -> None:
680 """Parameters
681 ----------
682 data :
683 Data source of DMatrix. See :ref:`py-data` for a list of supported input
684 types.
685
686 Note that, if passing an iterator, it **will cache data on disk**, and note
687 that fields like ``label`` will be concatenated in-memory from multiple
688 calls to the iterator.
689 label :
690 Label of the training data.
691 weight :
692 Weight for each instance.
693
694 .. note::
695
696 For ranking task, weights are per-group. In ranking task, one weight
697 is assigned to each group (not each data point). This is because we
698 only care about the relative ordering of data points within each group,
699 so it doesn't make sense to assign weights to individual data points.
700
701 base_margin :
702 Global bias for each instance. See :doc:`/tutorials/intercept` for details.
703 missing :
704 Value in the input data which needs to be present as a missing value. If
705 None, defaults to np.nan.
706 silent :
707 Whether print messages during construction
708 feature_names :
709 Set names for features.
710 feature_types :
711
712 Set types for features. If `data` is a DataFrame type and passing
713 `enable_categorical=True`, the types will be deduced automatically from the
714 column types.
715
716 Otherwise, one can pass a list-like input with the same length as number of
717 columns in `data`, with the following possible values:

Callers 1

__init__Method · 0.45

Calls 4

_init_from_iterMethod · 0.95
set_infoMethod · 0.95
_is_iterFunction · 0.85
dispatch_data_backendFunction · 0.85

Tested by

no test coverage detected