Skip to content

Commit 1e259e2

Browse files
authored
Update README.md
1 parent 7c31a0e commit 1e259e2

File tree

1 file changed

+82
-55
lines changed
  • AI-and-Analytics/Getting-Started-Samples/IntelPython_daal4py_GettingStarted

1 file changed

+82
-55
lines changed

AI-and-Analytics/Getting-Started-Samples/IntelPython_daal4py_GettingStarted/README.md

Lines changed: 82 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -24,107 +24,132 @@ In this sample, you will run a batch Linear Regression model with oneDAL daal4py
2424
| Software | Intel® oneAPI Data Analytics Library (oneDAL)
2525
> **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).
2626
27-
### For Local Development Environments
27+
## Key Implementation Details
28+
29+
- This get started sample code is implemented for CPUs using the Python language. The example assumes you have daal4py and scikit-learn installed inside a conda environment, similar to what is delivered with the installation of the Intel® Distribution for Python*.
30+
31+
- The Intel® oneAPI Data Analytics Library (oneDAL) is ready for use once you finish the AI Tools installation and have run the post installation script.
32+
33+
## Environment Setup
2834

2935
You will need to download and install the following toolkits, tools, and components to use the sample.
3036

31-
- **Intel® AI Tools**
37+
**1. Get AI Tools**
3238

33-
You can get the AI Tools from [Intel® oneAPI Toolkits](https://www.intel.com/content/www/us/en/developer/tools/oneapi/toolkits.html#analytics-kit). <br> See [*Get Started with the Intel® AI Tools for Linux**](https://www.intel.com/content/www/us/en/develop/documentation/get-started-with-ai-linux) for AI Kit installation information and post-installation steps and scripts.
3439

40+
Required AI Tools: daal4py (Select Intel® Extension for Scikit-learn* on [AI Tools Selector](https://www.intel.com/content/www/us/en/developer/tools/oneapi/ai-tools-selector.html) to install)
3541

36-
## Key Implementation Details
3742

38-
- This get started sample code is implemented for CPUs using the Python language. The example assumes you have daal4py and scikit-learn 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 Analytics Toolkit.
43+
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.
3944

40-
- The Intel® oneAPI Data Analytics Library (oneDAL) is ready for use once you finish the Intel® AI Analytics Toolkit installation and have run the post installation script.
45+
>**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.
4146
42-
## Environment Setup
47+
**2. (Offline Installer) Activate the AI Tools bundle base environment**
4348

44-
You will need to download and install the following toolkits, tools, and components to use the sample.
49+
If the default path is used during the installation of AI Tools:
50+
```
51+
source $HOME/intel/oneapi/intelpython/bin/activate
52+
```
53+
If a non-default path is used:
54+
```
55+
source <custom_path>/bin/activate
56+
```
57+
58+
**3. (Offline Installer) Activate relevant Conda environment**
59+
<!-- specify relevant conda environment name in Offline Installer for this sample -->
60+
```
61+
conda activate base
62+
```
4563

46-
**1. Get Intel® AI Tools**
64+
**4. Clone the GitHub repository**
65+
<!-- for oneapi-samples: git clone https://github.com/oneapi-src/oneAPI-samples.git
66+
cd oneAPI-samples/AI-and-Analytics/<samples-folder>/<individual-sample-folder> -->
67+
<!-- for migrated samples - provide git clone command for individual repo and cd to sample dir -->
68+
```
69+
git clone https://github.com/oneapi-src/oneAPI-samples.git
70+
cd oneAPI-samples/AI-and-Analytics/Getting-Started-Samples/IntelPython_daal4py_GettingStarted
71+
```
4772

48-
Required AI Tools: Intel® Optimization for XGBoost*
49-
<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.
73+
**5. Install dependencies**
74+
<!-- It is required to have requirement.txt file in sample dir. It should list additional libraries, such as matplotlib, ipykernel etc. -->
75+
>**Note**: Before running the following commands, make sure your Conda/Python environment with AI Tools installed is activated
5076
51-
**2. Install dependencies**
5277
```
5378
pip install -r requirements.txt
54-
```
55-
**Install Jupyter Notebook** by running `pip install notebook`. Alternatively, see [Installing Jupyter](https://jupyter.org/install) for detailed installation instructions.
79+
pip install notebook
80+
```
81+
For Jupyter Notebook, refer to [Installing Jupyter](https://jupyter.org/install) for detailed installation instructions.
5682

5783
## Run the Sample
58-
>**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_daal4py_GettingStarted#environment-setup) is completed.
84+
>**Note**: Before running the sample, make sure [Environment Setup](https://github.com/oneapi-src/oneAPI-samples/tree/master/AI-and-Analytics/Getting-Started-Samples/INC-Quantization-Sample-for-PyTorch#environment-setup) is completed.
85+
5986
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:
6087
* [AI Tools Offline Installer (Validated)](#ai-tools-offline-installer-validated)
6188
* [Conda/PIP](#condapip)
6289
* [Docker](#docker)
6390

6491
### AI Tools Offline Installer (Validated)
65-
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
66-
```
67-
source $HOME/intel/oneapi/intelpython/bin/activate
92+
93+
**1. Register Conda kernel to Jupyter Notebook kernel**
94+
95+
If the default path is used during the installation of AI Tools:
6896
```
69-
If you used a separate location, open a terminal and type the following
97+
$HOME/intel/oneapi/intelpython/envs/base/bin/python -m ipykernel install --user --name=base
7098
```
71-
source <custom_path>/bin/activate
99+
If a non-default path is used:
72100
```
73-
2. Activate the Conda environment:
74-
<!-- specify the name of conda environment for this sample, if there are several options - list all relevant names of environments -->
101+
<custom_path>/bin/python -m ipykernel install --user --name=base
75102
```
76-
conda activate xgboost
77-
```
78-
3. Clone the GitHub repository:
79-
```
80-
git clone https://github.com/oneapi-src/oneAPI-samples.git
81-
cd oneAPI-samples/AI-and-Analytics/Getting-Started-Samples/IntelPython_daal4py_GettingStarted
82-
```
83-
4. Launch Jupyter Notebook:
84-
> **Note**: You might need to register Conda kernel to Jupyter Notebook kernel,
85-
feel free to check [the instruction](https://github.com/IntelAI/models/tree/master/docs/notebooks/perf_analysis#option-1-conda-environment-creation)
103+
104+
**2. Launch Jupyter Notebook**
105+
<!-- add other flags to jupyter notebook command if needed, such as port 8888 or allow-root -->
86106
```
87107
jupyter notebook --ip=0.0.0.0
88108
```
89-
<!-- add other flags to jupyter notebook command if needed, such as port 8888 or allow-root -->
90-
5. Follow the instructions to open the URL with the token in your browser.
91-
6. Select the Notebook:
109+
**3. Follow the instructions to open the URL with the token in your browser**
110+
111+
**4. Select the Notebook**
92112
```
93113
IntelPython_daal4py_GettingStarted.ipynb
94114
```
95-
96-
7. Change the kernel to xgboost
115+
**5. Change the kernel to `base`**
97116

98-
8. Run every cell in the Notebook in sequence.
117+
**6. Run every cell in the Notebook in sequence**
99118

100119
### Conda/PIP
101-
> **Note**: Make sure your Conda/Python environment with AI Tools installed is activated
102-
1. Clone the GitHub repository:
103-
```
104-
git clone https://github.com/oneapi-src/oneAPI-samples.git
105-
cd oneapi-samples/AI-and-Analytics/Getting-Started-Samples/IntelPython_daal4py_GettingStarted
120+
> **Note**: Before running the instructions below, make sure your Conda/Python environment with AI Tools installed is activated
121+
122+
**1. Register Conda/Python kernel to Jupyter Notebook kernel**
123+
<!-- keep placeholders in this step, user could use any name for Conda/PIP env -->
124+
For Conda:
125+
```
126+
<CONDA_PATH_TO_ENV>/bin/python -m ipykernel install --user --name=<your-env-name>
106127
```
128+
To know <CONDA_PATH_TO_ENV>, run `conda env list` and find your Conda environment path.
107129

108-
2. Launch Jupyter Notebook:
109-
> **Note**: You might need to register Conda kernel to Jupyter Notebook kernel,
110-
feel free to check [the instruction](https://github.com/IntelAI/models/tree/master/docs/notebooks/perf_analysis#option-1-conda-environment-creation)
130+
For PIP:
131+
```
132+
python -m ipykernel install --user --name=<your-env-name>
133+
```
134+
**2. Launch Jupyter Notebook**
135+
<!-- add other flags to jupyter notebook command if needed, such as port 8888 or allow-root -->
111136
```
112137
jupyter notebook --ip=0.0.0.0
113138
```
114-
<!-- add other flags to jupyter notebook command if needed, such as port 8888 or allow-root -->
115-
4. Follow the instructions to open the URL with the token in your browser.
116-
5. Select the Notebook:
139+
**3. Follow the instructions to open the URL with the token in your browser**
140+
141+
**4. Select the Notebook**
117142
```
118-
IntelPython_daal4py_GettingStarted.ipynb.ipynb
143+
IntelPython_daal4py_GettingStarted.ipynb
119144
```
145+
**5. Change the kernel to `<your-env-name>`**
146+
<!-- leave <your-env-name> as a placeholder as user could choose any name for the env -->
120147

121-
6. Run every cell in the Notebook in sequence.
148+
**6. Run every cell in the Notebook in sequence**
122149

123150
### Docker
124151
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.
125152

126-
127-
128153
## Example Output
129154

130155
```
@@ -161,8 +186,10 @@ Here is one of our loaded model's features:
161186
## License
162187

163188
Code samples are licensed under the MIT license. See
164-
[License.txt](https://github.com/oneapi-src/oneAPI-samples/blob/master/License.txt) for details.
189+
[License.txt](https://github.com/oneapi-src/oneAPI-samples/blob/master/License.txt)
190+
for details.
165191

166-
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).
192+
Third party program Licenses can be found here:
193+
[third-party-programs.txt](https://github.com/oneapi-src/oneAPI-samples/blob/master/third-party-programs.txt)
167194

168195
*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

Comments
 (0)