Package org.tribuo.regression.xgboost
Class XGBoostRegressionConverter
java.lang.Object
org.tribuo.regression.xgboost.XGBoostRegressionConverter
- All Implemented Interfaces:
Serializable
,XGBoostOutputConverter<Regressor>
public final class XGBoostRegressionConverter
extends Object
implements XGBoostOutputConverter<Regressor>
Converts XGBoost outputs into
Regressor
Prediction
s.
Instances of this class are stateless and thread-safe.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionconvertBatchOutput
(ImmutableOutputInfo<Regressor> info, List<float[][]> probabilities, int[] numValidFeatures, Example<Regressor>[] examples) Converts a list of float arrays from XGBoost Boosters into a TribuoPrediction
.convertOutput
(ImmutableOutputInfo<Regressor> info, List<float[]> probabilities, int numValidFeatures, Example<Regressor> example) Converts a list of float arrays from XGBoost Boosters into a TribuoPrediction
.boolean
Does this converter produce probabilities?
-
Constructor Details
-
XGBoostRegressionConverter
public XGBoostRegressionConverter()Construct an XGBoostRegressionConverter.
-
-
Method Details
-
generatesProbabilities
public boolean generatesProbabilities()Description copied from interface:XGBoostOutputConverter
Does this converter produce probabilities?- Specified by:
generatesProbabilities
in interfaceXGBoostOutputConverter<Regressor>
- Returns:
- True if it produces probabilities.
-
convertOutput
public Prediction<Regressor> convertOutput(ImmutableOutputInfo<Regressor> info, List<float[]> probabilities, int numValidFeatures, Example<Regressor> example) Description copied from interface:XGBoostOutputConverter
Converts a list of float arrays from XGBoost Boosters into a TribuoPrediction
.- Specified by:
convertOutput
in interfaceXGBoostOutputConverter<Regressor>
- Parameters:
info
- The output info.probabilities
- The XGBoost output.numValidFeatures
- The number of valid features used in the prediction.example
- The example this prediction was generated from.- Returns:
- The prediction object.
-
convertBatchOutput
public List<Prediction<Regressor>> convertBatchOutput(ImmutableOutputInfo<Regressor> info, List<float[][]> probabilities, int[] numValidFeatures, Example<Regressor>[] examples) Description copied from interface:XGBoostOutputConverter
Converts a list of float arrays from XGBoost Boosters into a TribuoPrediction
.- Specified by:
convertBatchOutput
in interfaceXGBoostOutputConverter<Regressor>
- Parameters:
info
- The output info.probabilities
- The XGBoost output, list dimension is across models, first array dimension is across examples, second array dimension is across outputs.numValidFeatures
- The number of valid features used in each prediction.examples
- The examples these predictions were generated from.- Returns:
- The prediction object.
-