Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

XGBPaclet

Guides

  • XGBPaclet Guide

Tech Notes

  • XGBPaclet Functionality

Symbols

  • XgbModelPredict
  • XgbMeasurement
  • XgbMeasurement
  • XgbTrain
MikeYeh`XGBPaclet`
XgbTrain
​
XgbTrain[python_session,{data_arraylabel_array}]
The minimum usage of XgbTrain with only training input of the format {data_array->label_array}, and an active external XGBoost python session, i.e., ExternalSessionObject[]. XgbTrain[] returns the evaluation session containing the trained model.
​
​
XgbTrain[python_session,{data_arraylabel_array},Options]
Add additional options for XgbTrain. It returns the evaluation session containing the trained model.
​
​
XgbTrain[python_session,{traindata_arraytrainlabel_array},"ValidationSet"{testdata_arraytestlabel_array}]
The usage of XgbTrain with both training and validation inputs, where the validation set is only set by "ValidationSet" in Options. It returns the evaluation session containing the trained model.
​
​
XgbTrain[python_session,{data_arraylabel_array},All,Options]
When adding All right after training data, XgbTrain will return a XGBTrainResultsObject[] which contains all training information
​
Details and Options

Examples  
(33)
Basic Examples  
(7)
Create Python Sessions  
(3)
A XGBoost python session is required before using
XgbTrain
[].
The following code creates the xgb python session with minimum required packages : xgboost, scikit-learn==1.5.2, and matplotlib.
In[1]:=
[◼]
RegisterEnvironment
["xgb"{"xgboost"(*withnumpy*),"scikit-learn==1.5.2","matplotlib"}]
Out[1]=
xgb
In[2]:=
session=
[◼]
StartEnvironment
["xgb"];
​
Here we create the xgb2 python session with additional shap package for generate SHAP values and plots.
In[1]:=
[◼]
RegisterEnvironment
["xgb2"{"xgboost"(*withnumpy*),"scikit-learn==1.5.2","matplotlib","shap"(*withpandas*)}]
Out[1]=
xgb2
In[2]:=
session2=
[◼]
StartEnvironment
["xgb2"]
​
The following code creates the xgb0 python session without xgboost package.
In[1]:=
[◼]
RegisterEnvironment
["xgb0"{"scikit-learn==1.5.2","matplotlib"}]
Out[1]=
xgb
In[2]:=
session0=
[◼]
StartEnvironment
["xgb0"];
Generate dataset  
(3)

The basic usage  
(1)

Options  
(8)

Scope  
(4)

Generalizations & Extensions  
(12)

Possible Issues  
(2)

SeeAlso
XgbMeasurement
TechNotes
▪
XGBPaclet Functionality
RelatedGuides
▪
XGBPaclet Guide
RelatedLinks
▪
Training section
▪
Learning API
▪
XGBoost Parameters
▪
Model IO
""

© 2025 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com