You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Intel® Optimization for XGBoost* Getting Started Sample
2
2
3
-
The `Intel® Python XGBoost* Getting Started` sample demonstrates how to set up and train an XGBoost model on datasets for prediction.
3
+
The `Intel® Optimization for XGBoost* Getting Started` sample demonstrates how to set up and train an XGBoost model on datasets for prediction.
4
4
5
5
| Area | Description
6
6
| :--- | :---
@@ -12,7 +12,7 @@ The `Intel® Python XGBoost* Getting Started` sample demonstrates how to set up
12
12
13
13
XGBoost* is a widely used gradient boosting library in the classical ML area. Designed for flexibility, performance, and portability, XGBoost* includes optimized distributed gradient boosting frameworks and implements Machine Learning algorithms underneath. Starting with 0.9 version of XGBoost, Intel has been up streaming optimizations through the `hist` histogram tree-building method. Starting with 1.3.3 version of XGBoost and beyond, Intel has also begun up streaming inference optimizations to XGBoost as well.
14
14
15
-
In this code sample, you will learn how to use Intel optimizations for XGBoost published as part of Intel® AI Tools. The sample also illustrates how to set up and train an XGBoost* model on datasets for prediction. It also demonstrates how to use software products that can be found in the [Intel® AI Tools](https://software.intel.com/content/www/us/en/develop/tools/oneapi/ai-analytics-toolkit.html).
15
+
In this code sample, you will learn how to use Intel optimizations for XGBoost published as part of AI Tools. The sample also illustrates how to set up and train an XGBoost* model on datasets for prediction. It also demonstrates how to use software products that can be found in the [AI Tools](https://software.intel.com/content/www/us/en/develop/tools/oneapi/ai-analytics-toolkit.html).
16
16
17
17
## Prerequisites
18
18
@@ -22,96 +22,126 @@ In this code sample, you will learn how to use Intel optimizations for XGBoost p
22
22
| Hardware | Intel Atom® Processors <br> Intel® Core™ Processor Family <br> Intel® Xeon® Processor Family <br> Intel® Xeon® Scalable processor family
23
23
| Software | XGBoost*
24
24
25
+
> **Note**: AI and Analytics samples are validated on AI Tools Offline Installer. For the full list of validated platforms refer to [Platform Validation](https://github.com/oneapi-src/oneAPI-samples/tree/master?tab=readme-ov-file#platform-validation).
26
+
25
27
## Key Implementation Details
26
28
27
-
- This Getting Started sample code is implemented for CPU using the Python language. The example assumes you have XGboost installed inside a conda environment, similar to what is delivered with the installation of the Intel® Distribution for Python* as part of the [Intel® AI Tools](https://software.intel.com/en-us/oneapi/ai-kit).
29
+
- This Getting Started sample code is implemented for CPU using the Python language. The example assumes you have XGboost installed inside a conda environment, similar to what is delivered with the installation of the Intel® Distribution for Python*.
28
30
29
-
- XGBoost* is ready for use once you finish the Intel® AI Tools installation and have run the post installation script.
31
+
- XGBoost* is ready for use once you finish the AI Tools installation and have run the post installation script.
30
32
31
33
## Environment Setup
32
34
33
35
You will need to download and install the following toolkits, tools, and components to use the sample.
34
36
35
-
**1. Get Intel® AI Tools**
37
+
**1. Get AI Tools**
36
38
37
39
Required AI Tools: Intel® Optimization for XGBoost*
38
40
<br>If you have not already, select and install these Tools via [AI Tools Selector](https://www.intel.com/content/www/us/en/developer/tools/oneapi/ai-tools-selector.html). AI and Analytics samples are validated on AI Tools Offline Installer. It is recommended to select Offline Installer option in AI Tools Selector.
41
+
>**Note**: If Docker option is chosen in AI Tools Selector, refer to [Working with Preset Containers](https://github.com/intel/ai-containers/tree/main/preset) to learn how to run the docker and samples.
39
42
40
-
**2. Install dependencies**
43
+
**2. (Offline Installer) Activate the AI Tools bundle base environment**
44
+
<!-- this step is from AI Tools GSG, please don't modify unless GSG is updated -->
45
+
If the default path is used during the installation of AI Tools:
cd oneAPI-samples/AI-and-Analytics/Getting-Started-Samples/IntelPython_XGBoost_GettingStarted
63
+
```
64
+
65
+
**5. Install dependencies**
66
+
>**Note**: Before running the following commands, make sure your Conda/Python environment with AI Tools installed is activated
67
+
43
68
```
44
-
**Install Jupyter Notebook** by running `pip install notebook`. Alternatively, see [Installing Jupyter](https://jupyter.org/install) for detailed installation instructions.
69
+
pip install -r requirements.txt
70
+
pip install notebook
71
+
```
72
+
For Jupyter Notebook, refer to [Installing Jupyter](https://jupyter.org/install) for detailed installation instructions.
45
73
46
74
## Run the Sample
47
75
>**Note**: Before running the sample, make sure [Environment Setup](https://github.com/oneapi-src/oneAPI-samples/tree/master/AI-and-Analytics/Getting-Started-Samples/IntelPython_XGBoost_GettingStarted#environment-setup) is completed.
76
+
48
77
Go to the section which corresponds to the installation method chosen in [AI Tools Selector](https://www.intel.com/content/www/us/en/developer/tools/oneapi/ai-tools-selector.html) to see relevant instructions:
1. If you have not already done so, activate the AI Tools bundle base environment. If you used the default location to install AI Tools, open a terminal and type the following
> **Note**: You might need to register Conda kernel to Jupyter Notebook kernel,
98
-
feel free to check [the instruction](https://github.com/IntelAI/models/tree/master/docs/notebooks/perf_analysis#option-1-conda-environment-creation)
125
+
**2. Launch Jupyter Notebook**
126
+
<!-- add other flags to jupyter notebook command if needed, such as port 8888 or allow-root -->
99
127
```
100
128
jupyter notebook --ip=0.0.0.0
101
129
```
102
-
<!-- add other flags to jupyter notebook command if needed, such as port 8888 or allow-root -->
103
-
4. Follow the instructions to open the URL with the token in your browser.
104
-
5. Select the Notebook:
130
+
**3. Follow the instructions to open the URL with the token in your browser**
131
+
132
+
**4. Select the Notebook**
133
+
<!-- add sample file name -->
105
134
```
106
135
IntelPython_XGBoost_GettingStarted.ipynb
107
136
```
108
-
6. Run every cell in the Notebook in sequence.
137
+
**5. Change the kernel to `<your-env-name>`**
138
+
<!-- leave <your-env-name> as a placeholder as user could choose any name for the env -->
139
+
140
+
**6. Run every cell in the Notebook in sequence**
109
141
110
142
### Docker
111
143
AI Tools Docker images already have Get Started samples pre-installed. Refer to [Working with Preset Containers](https://github.com/intel/ai-containers/tree/main/preset) to learn how to run the docker and samples.
112
144
113
-
114
-
115
145
## Example Output
116
146
117
147
>**Note**: Your numbers might be different.
@@ -129,8 +159,10 @@ RMSE: 11.113036205909719
129
159
## License
130
160
131
161
Code samples are licensed under the MIT license. See
132
-
[License.txt](https://github.com/oneapi-src/oneAPI-samples/blob/master/License.txt) for details.
Third party program Licenses can be found here: [third-party-programs.txt](https://github.com/oneapi-src/oneAPI-samples/blob/master/third-party-programs.txt).
0 commit comments