Skip to content

Commit

Permalink
Fix for hdbscan incompatibility
Browse files Browse the repository at this point in the history
Fix for hdbscan incompatibility with new version of scikit-learn. Also changes for pending depreciation of joblib from scikit-learn.
  • Loading branch information
Nabeel committed May 13, 2019
1 parent fbbaf92 commit 555c844
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Qlik-Py-Init.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ cd ..
echo.
echo Installing required packages... & echo.
python -m pip install --upgrade setuptools pip
pip install grpcio grpcio-tools numpy scipy pandas cython
pip install grpcio grpcio-tools numpy scipy pandas cython joblib
pip install pystan==2.17
pip install fbprophet
pip install scikit-learn
pip install scikit-learn==0.20.3
pip install hdbscan
pip install skater==1.1.2
echo.
Expand Down
4 changes: 2 additions & 2 deletions Qlik-Py-Init.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Write-Output "Activating the virtual environment..."
& $PSScriptRoot\qlik-py-env\Scripts\activate.ps1
Write-Output "Installing required packages..."
python -m pip install --upgrade setuptools pip
pip install grpcio grpcio-tools numpy scipy pandas cython
pip install grpcio grpcio-tools numpy scipy pandas cython joblib
pip install pystan==2.17
pip install fbprophet
pip install scikit-learn
pip install scikit-learn==0.20.3
pip install hdbscan
pip install skater==1.1.2
Write-Output "Creating a new firewall rule for TCP port 50055..."
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ For installing this SSE on a machine without Internet access, use the instructio
4. Right click `Qlik-Py-Init.bat` and chose 'Run as Administrator'. You can open this file in a text editor to review the commands that will be executed. If everything goes smoothly you will see a Python virtual environment being set up, project files being copied, some packages being installed and TCP Port `50055` being opened for inbound communication.
- Note that the script always ends with a "All done" message and does not check for errors.
- If you need to change the port you can do so in the file `core\__main__.py` by opening the file with a text editor, changing the value of the `_DEFAULT_PORT` variable, and then saving the file. You will also need to update `Qlik-Py-Init.bat` to use the same port in the `netsh` command. This command will only work if you run the batch file through an elevated command prompt (i.e. with administrator privileges).
- Once the execution completes, do a quick scan of the log to see everything installed correctly. The libraries imported are: `grpcio`, `grpcio-tools`, `numpy`, `scipy`, `pandas`, `cython`, `pystan`, `fbprophet`, `scikit-learn`, `hdbscan`, `skater` and their dependencies. Also, check that the `core` and `generated` directories have been copied successfully to the newly created `qlik-py-env` directory.
- Once the execution completes, do a quick scan of the log to see everything installed correctly. The libraries imported are: `grpcio`, `grpcio-tools`, `numpy`, `scipy`, `pandas`, `cython`, `joblib`, `pystan`, `fbprophet`, `scikit-learn`, `hdbscan`, `skater` and their dependencies. Also, check that the `core` and `generated` directories have been copied successfully to the newly created `qlik-py-env` directory.
- If the initialization fails for any reason, you can simply delete the `qlik-py-env` directory and re-run `Qlik-Py-Init.bat`.

5. Now whenever you want to start this Python service you can run `Qlik-Py-Start.bat`.
Expand Down
2 changes: 1 addition & 1 deletion core/_machine_learning.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import sys
import time
import joblib
import numpy as np
import pandas as pd
from pathlib import Path
from sklearn import preprocessing
from sklearn.base import TransformerMixin
from sklearn.pipeline import Pipeline
from sklearn.externals import joblib
from sklearn.feature_extraction import FeatureHasher
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfVectorizer
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ _Note that this SSE and Docker do not handle file locking, and so do not support
4. Right click `Qlik-Py-Init.bat` and chose 'Run as Administrator'. You can open this file in a text editor to review the commands that will be executed. If everything goes smoothly you will see a Python virtual environment being set up, project files being copied, some packages being installed and TCP Port `50055` being opened for inbound communication.
- Note that the script always ends with a "All done" message and does not check for errors.
- If you need to change the port you can do so in the file `core\__main__.py` by opening the file with a text editor, changing the value of the `_DEFAULT_PORT` variable, and then saving the file. You will also need to update `Qlik-Py-Init.bat` to use the same port in the `netsh` command. This command will only work if you run the batch file through an elevated command prompt (i.e. with administrator privileges).
- Once the execution completes, do a quick scan of the log to see everything installed correctly. The libraries imported are: `grpcio`, `grpcio-tools`, `numpy`, `scipy`, `pandas`, `cython`, `pystan`, `fbprophet`, `scikit-learn`, `hdbscan`, `skater` and their dependencies. Also, check that the `core` and `generated` directories have been copied successfully to the newly created `qlik-py-env` directory.
- Once the execution completes, do a quick scan of the log to see everything installed correctly. The libraries imported are: `grpcio`, `grpcio-tools`, `numpy`, `scipy`, `pandas`, `cython`, `joblib`, `pystan`, `fbprophet`, `scikit-learn`, `hdbscan`, `skater` and their dependencies. Also, check that the `core` and `generated` directories have been copied successfully to the newly created `qlik-py-env` directory.
- If the initialization fails for any reason, you can simply delete the `qlik-py-env` directory and re-run `Qlik-Py-Init.bat`.

5. Now whenever you want to start this Python service you can run `Qlik-Py-Start.bat`.
Expand Down

0 comments on commit 555c844

Please sign in to comment.