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
The `Intel® Python 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
| :--- | :---
7
+
| Category | Getting Started
7
8
| What you will learn | The basics of XGBoost programming model for Intel CPUs
8
9
| Time to complete | 5 minutes
9
-
| Category | Getting Started
10
10
11
11
## Purpose
12
12
@@ -24,75 +24,93 @@ In this code sample, you will learn how to use Intel optimizations for XGBoost p
24
24
25
25
## Key Implementation Details
26
26
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).
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).
28
28
29
-
XGBoost* is ready for use once you finish the Intel® AI Tools installation and have run the post installation script.
29
+
-XGBoost* is ready for use once you finish the Intel® AI Tools installation and have run the post installation script.
30
30
31
-
## Configure Environment (Only applicable to Intel AI Tools Offline Installer)
32
-
If you have already set up the PIP or Conda environment and installed AI Tools go directly to Run the Notebook.
33
-
> **Note**: If you have not already done so, set up your CLI
34
-
> environment by sourcing the `setvars` script in the root of your oneAPI installation.
35
-
>
36
-
> Linux*:
37
-
> - For system wide installations: `. /opt/intel/oneapi/setvars.sh`
38
-
> - For private installations: ` . ~/intel/oneapi/setvars.sh`
39
-
> - For non-POSIX shells, like csh, use the following command: `bash -c 'source <install-dir>/setvars.sh ; exec csh'`
40
-
>
41
-
> For more information on configuring environment variables, see *[Use the setvars Script with Linux* or macOS*](https://www.intel.com/content/www/us/en/develop/documentation/oneapi-programming-guide/top/oneapi-development-environment-setup/use-the-setvars-script-with-linux-or-macos.html)*.
31
+
## Environment Setup
42
32
33
+
You will need to download and install the following toolkits, tools, and components to use the sample.
43
34
44
-
### Activate Conda with Root Access
35
+
**1. Get Intel® AI Tools**
45
36
46
-
If you activated another environment, you can return with the following command:
47
-
```
48
-
source activate base
49
-
```
50
-
### Activate Conda without Root Access (Optional)
37
+
Required AI Tools: Intel® Optimization for XGBoost*
38
+
<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.
51
39
52
-
By default, the Intel® AI Tools are installed in the inteloneapi folder, which requires root privileges to manage it. If you would like to bypass using root access to manage your conda environment, then you can clone and active your desired conda environment using the following commands:
40
+
**2. Install dependencies**
53
41
```
54
-
conda create --name user_base --clone base
55
-
source activate user_base
42
+
pip install -r requirements.txt
56
43
```
44
+
**Install Jupyter Notebook** by running `pip install notebook`. Alternatively, see [Installing Jupyter](https://jupyter.org/install) for detailed installation instructions.
57
45
58
-
## Run the `Intel® Python XGBoost* Getting Started` Sample
59
-
60
-
### Install Jupyter Notebook
61
-
62
-
1. Change to the sample directory.
63
-
2. Install Jupyter Notebook with an appropriate kernel.
64
-
```
65
-
conda install jupyter nb_conda_kernels
66
-
```
67
-
### Run Jupyter Notebook
46
+
## Run the Sample
47
+
>**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.
48
+
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:
>**Note**: You cannot execute the sample in Jupyter Notebook, but you can still view inside the notebook to follow the included write-up and description.
53
+
### AI Tools Offline Installer (Validated)
54
+
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
The output files of the script will be saved in **models** and **result** directories.
110
+
### Docker
111
+
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.
92
112
93
-
#### Troubleshooting
94
113
95
-
If you receive an error message, troubleshoot the problem using the **Diagnostics Utility for Intel® oneAPI Toolkits**. The diagnostic utility provides configuration and system checks to help find missing dependencies, permissions errors, and other issues. See the [Diagnostics Utility for Intel® oneAPI Toolkits User Guide](https://www.intel.com/content/www/us/en/develop/documentation/diagnostic-utility-user-guide/top.html) for more information on using the utility.
96
114
97
115
## Example Output
98
116
@@ -102,10 +120,17 @@ If you receive an error message, troubleshoot the problem using the **Diagnostic
Code samples are licensed under the MIT license. See
109
132
[License.txt](https://github.com/oneapi-src/oneAPI-samples/blob/master/License.txt) for details.
110
133
111
134
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).
135
+
136
+
*Other names and brands may be claimed as the property of others. [Trademarks](https://www.intel.com/content/www/us/en/legal/trademarks.html)
0 commit comments