Files
2026-07-13 13:27:18 +08:00

58 lines
3.4 KiB
R

% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/lgb.Booster.R
\name{lgb_predict_shared_params}
\alias{lgb_predict_shared_params}
\title{Shared prediction parameter docs}
\arguments{
\item{type}{Type of prediction to output. Allowed types are:\itemize{
\item \code{"response"}: will output the predicted score according to the objective function being
optimized (depending on the link function that the objective uses), after applying any necessary
transformations - for example, for \code{objective="binary"}, it will output class probabilities.
\item \code{"class"}: for classification objectives, will output the class with the highest predicted
probability. For other objectives, will output the same as "response". Note that \code{"class"} is
not a supported type for \link{lgb.configure_fast_predict} (see the documentation of that function
for more details).
\item \code{"raw"}: will output the non-transformed numbers (sum of predictions from boosting iterations'
results) from which the "response" number is produced for a given objective function - for example,
for \code{objective="binary"}, this corresponds to log-odds. For many objectives such as
"regression", since no transformation is applied, the output will be the same as for "response".
\item \code{"leaf"}: will output the index of the terminal node / leaf at which each observations falls
in each tree in the model, outputted as integers, with one column per tree.
\item \code{"contrib"}: will return the per-feature contributions for each prediction, including an
intercept (each feature will produce one column).
}
Note that, if using custom objectives, types "class" and "response" will not be available and will
default towards using "raw" instead.
If the model was fit through function \link{lightgbm} and it was passed a factor as labels,
passing the prediction type through \code{params} instead of through this argument might
result in factor levels for classification objectives not being applied correctly to the
resulting output.
\emph{New in version 4.0.0}}
\item{start_iteration}{int or None, optional (default=None)
Start index of the iteration to predict.
If None or <= 0, starts from the first iteration.}
\item{num_iteration}{int or None, optional (default=None)
Limit number of iterations in the prediction.
If None, if the best iteration exists and start_iteration is None or <= 0, the
best iteration is used; otherwise, all iterations from start_iteration are used.
If <= 0, all iterations from start_iteration are used (no limits).}
\item{params}{a list of additional named parameters. See
\href{https://lightgbm.readthedocs.io/en/latest/Parameters.html#predict-parameters}{
the "Predict Parameters" section of the documentation} for a list of parameters and
valid values. Where these conflict with the values of keyword arguments to this function,
the values in \code{params} take precedence.}
}
\description{
Shared prediction parameter docs
}
\details{
This page contains shared documentation for prediction-related parameters used throughout the package.
}
\keyword{internal}