Skip to content

Commit

Permalink
[2021.2.1-rls] Enable sklearnex documentation (#613)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pahandrovich authored Apr 6, 2021
1 parent b70d897 commit 24cd6bf
Show file tree
Hide file tree
Showing 30 changed files with 822 additions and 20 deletions.
17 changes: 13 additions & 4 deletions .ci/pipeline/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,28 @@ jobs:
conda activate CB
./conda-recipe/run_test.sh
displayName: Testing
- script: |
. /usr/share/miniconda/etc/profile.d/conda.sh
conda activate CB
cd doc/daal4py
make html
displayName: 'Build daal4py documentation'
- script: |
. /usr/share/miniconda/etc/profile.d/conda.sh
conda activate CB
cd doc
make html
displayName: 'Build documentation'
displayName: 'Build scikit-learn-intelex documentation'
- script: |
cp -R doc/_build $(Build.ArtifactStagingDirectory)/html
mkdir $(Build.ArtifactStagingDirectory)/html/daal4py
mkdir $(Build.ArtifactStagingDirectory)/html/sklearnex
cp -R doc/daal4py/_build $(Build.ArtifactStagingDirectory)/html_daal4py
cp -R doc/_build $(Build.ArtifactStagingDirectory)/html_sklearnex
displayName: 'Copy build'
- task: PublishPipelineArtifact@0
inputs:
artifactName: 'daal4py-documentation'
targetPath: '$(Build.ArtifactStagingDirectory)/html'
artifactName: 'documentation'
targetPath: '$(Build.ArtifactStagingDirectory)/'

- job: Linux_DPCPP
pool:
Expand Down
21 changes: 13 additions & 8 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,41 @@ To install the package:

```bash
cd <checkout-dir>
python setup_sklearnex.py install --single-version-externally-managed --record=record.txt
python setup_sklearnex.py install
```

To install the package in the development mode:

```bash
cd <checkout-dir>
python setup.py develop --no-deps
python setup_sklearnex.py develop
```

To install scikit-learn-intelex without the dependency on daal4py:

```bash
cd <checkout-dir>
python setup_sklearnex.py install
python setup_sklearnex.py install --single-version-externally-managed --record=record.txt
```
```bash
cd <checkout-dir>
python setup.py develop
python setup_sklearnex.py develop --no-deps
```

⚠️ Keys `--single-version-externally-managed` and `--no-deps` are required so that daal4py is not downloaded after installation of Intel(R) Extension for Scikit-learn

⚠️ The `develop` mode will not install the package but it will create a `.egg-link` in the deployment directory
back to the project source code directory. That way you can edit the source code and see the changes
without having to reinstall package every time you make a small change.

⚠️ `--single-version-externally-managed` is an option used for Python packages instructing the setuptools module
to create a Python package that can be easily managed by the package manager on the host.

## Building documentation for Intel(R) Extension for Scikit-learn
### Prerequisites for creating documentation
* sphinx
* sphinx_rtd_theme
* daal4py

### Building documentation
1. Install daal4py into your python environment
2. ```cd doc && make html```
3. The documentation will be in ```doc/_build/html```
1. ```cd doc && make html```
2. The documentation will be in ```doc/_build/html```
4 changes: 2 additions & 2 deletions daal4py/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,5 @@ python setup.py develop --no-deps

### Building documentation
1. Install daal4py into your python environment
2. ```cd doc && make html```
3. The documentation will be in ```doc/_build/html```
2. ```cd doc/daal4py && make html```
3. The documentation will be in ```doc/daal4py/_build/html```
4 changes: 2 additions & 2 deletions doc/Makefile
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = daal4py
SOURCEDIR = .
SPHINXPROJ = scikit-learn-intelex
SOURCEDIR = sources
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
Expand Down
20 changes: 20 additions & 0 deletions doc/daal4py/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = daal4py
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
36 changes: 36 additions & 0 deletions doc/daal4py/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build
set SPHINXPROJ=daal4py

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%

:end
popd
File renamed without changes.
12 changes: 12 additions & 0 deletions doc/sklearn.rst → doc/daal4py/sklearn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ Python interface to efficient Intel(R) oneAPI Data Analytics Library provided by
to create scikit-learn compatible estimators, transformers, clusterers, etc. powered by oneDAL which
are nearly as efficient as native programs.

Deprecation Notice
-------------------------------

Scikit-learn patching functionality in daal4py was deprecated and moved to a separate
package, `Intel(R) Extension for Scikit-learn* <https://github.com/intel/scikit-learn-intelex>`_.
All future patches will be available only in Intel(R) Extension for Scikit-learn*.
Please use the scikit-learn-intelex package instead of daal4py for the scikit-learn acceleration.

.. _sklearn_patches:

oneDAL accelerated scikit-learn
Expand Down Expand Up @@ -126,6 +134,10 @@ algorithms:
- pairwise_distance
- With metric=``cosine`` and ``correlation``.
- Only dense data is supported.
* - Other
- roc_auc_score
- Parameters ``average``, ``sample_weight``, ``max_fpr`` and ``multi_class`` are not supported.
- No limitations.


Monkey-patched scikit-learn classes and functions passes scikit-learn's own test
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions doc/make.bat
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set SOURCEDIR=sources
set BUILDDIR=_build
set SPHINXPROJ=daal4py
set SPHINXPROJ=scikit-learn-intelex

if "%1" == "" goto help

Expand Down
120 changes: 120 additions & 0 deletions doc/sources/_static/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
/* override table width restrictions */
@media screen and (min-width: 767px) {

.wy-table-responsive table td {
/* !important prevents the common CSS stylesheets from overriding
this as on RTD they are loaded after this stylesheet */

white-space: normal !important;
}
}

.code-block-caption {
color: #000;
font: italic 85%/1 arial,sans-serif;
padding: 1em 0;
text-align: center;
}


.collapsible {
margin-left: -10px;
background-color: #f1f1f1;
cursor: pointer;
padding: 18px 18px 18px 10px;
width: 100%;
border: none;
text-align: left;
outline: none;
font-weight: 700;
font-family: "Roboto Slab","ff-tisa-web-pro","Georgia",Arial,sans-serif;
}

code.sig-name.descname {
white-space: initial;
}

table.optimization-notice td {
white-space: initial;
}

table.optimization-notice td p:last-child {
text-align: right;
}

img.with-border {
border:1px solid #021a40;
}

div.column {
float: left;
width: 50%;
padding: 10px;
}

/* Clear floats after the columns */
.column:after {
content: "";
display: table;
clear: both;
}

.comparison:after {
content: "";
display: table;
clear: both;
}

div.admonition-container {
width: 49%;
padding: 0 3px 0 0;
}

/* Clear floats after the columns */
.admonition-container:after {
content: "";
display: table;
clear: both;
}

div.quotation {
background-color: #fffff1;
padding: 1em 0 0 1em;
}

.rst-content div[class^='highlight'] pre {
white-space: pre-wrap;
}

/* A workaround for https://github.com/readthedocs/sphinx_rtd_theme/issues/647
* Override display for function signatures so that there is spacing between
* types and arguments */
.rst-content dl:not(.docutils) dt {
display: table-cell !important;
}
.rst-content dl:not(.docutils) dd {
margin-top: 6px;
}

/*
.rst-content tt.literal, .rst-content code.literal, .highlight {
background: #f0f0f0;
}
.rst-content tt.literal, .rst-content code.literal {
color: #000000;
}*/


.eqno {
margin-left: 5px;
float: right;
}
.math .headerlink {
display: none;
visibility: hidden;
}
.math:hover .headerlink {
display: inline-block;
visibility: visible;
margin-right: -0.7em;
}
Loading

0 comments on commit 24cd6bf

Please sign in to comment.