Skip to content

Commit

Permalink
Initial implementation.
Browse files Browse the repository at this point in the history
Facebook Prophet : Functions for timeseries forecasting.
Correlation: Functions for calculating linear correlations.

Signed-off-by: Nabeel <[email protected]>
  • Loading branch information
nabeel-oz committed Mar 13, 2018
1 parent d5383e4 commit a85db6c
Show file tree
Hide file tree
Showing 9 changed files with 2,138 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Qlik-Py-Init.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
@echo off
echo Setting up the Python virtual environment... & echo.
python -m venv qlik-py-env
echo.
echo Moving project files to the new directory... & echo.
move generated "%~dp0\qlik-py-env"
move core "%~dp0\qlik-py-env"
echo.
echo Activating the virtual environment... & echo.
cd "%~dp0\qlik-py-env\Scripts"
call activate
cd ..
echo.
echo Installing required packages... & echo.
pip install grpcio
pip install numpy
pip install scipy
pip install pandas
pip install fbprophet
echo.
echo All done. Run Qlik-Py-Start.bat to start the SSE Extension Service. & echo.
pause
6 changes: 6 additions & 0 deletions Qlik-Py-Start.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@echo off
cd "%~dp0\qlik-py-env\Scripts"
call activate
cd ..\core
python __main__.py
pause
Empty file added core/__init__.py
Empty file.
425 changes: 425 additions & 0 deletions core/__main__.py

Large diffs are not rendered by default.

697 changes: 697 additions & 0 deletions core/_prophet_forecast.py

Large diffs are not rendered by default.

70 changes: 70 additions & 0 deletions core/functions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"Functions": [
{
"Id": 0,
"Name": "Correlation",
"Type": 0,
"ReturnType": 1,
"Params": {
"a_series1": 0,
"b_series2": 0,
"c_corr_type": 0
}
},
{
"Id": 1,
"Name": "Pearson",
"Type": 0,
"ReturnType": 1,
"Params": {
"a_series1": 0,
"b_series2": 0
}
},
{
"Id": 2,
"Name": "Prophet",
"Type": 0,
"ReturnType": 1,
"Params": {
"a_date": 2,
"b_value": 1,
"c_other_args": 0
}
},
{
"Id": 3,
"Name": "Prophet_Basic",
"Type": 0,
"ReturnType": 1,
"Params": {
"a_date": 2,
"b_value": 1
}
},
{
"Id": 4,
"Name": "Prophet_Holidays",
"Type": 0,
"ReturnType": 1,
"Params": {
"a_date": 2,
"b_value": 1,
"c_holidays": 2,
"d_other_args": 0
}
},
{
"Id": 5,
"Name": "Prophet_Seasonality",
"Type": 0,
"ReturnType": 1,
"Params": {
"a_season": 2,
"b_time_series": 0,
"c_holidays": 0,
"d_other_args": 0
}
}
]
}
32 changes: 32 additions & 0 deletions core/logger.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[loggers]
keys=root

[logger_root]
handlers=console,file
level=NOTSET

[formatters]
keys=simple,complex

[formatter_simple]
format=%(asctime)s - %(levelname)s - %(message)s

[formatter_complex]
format=%(asctime)s - %(levelname)s - %(module)s : %(lineno)d - %(message)s

[handlers]
keys=file,console

[handler_file]
class=handlers.TimedRotatingFileHandler
interval=midnight
backupCount=5
formatter=complex
level=DEBUG
args=('logs/SSEPlugin.log',)

[handler_console]
class=StreamHandler
formatter=simple
level=INFO
args=(sys.stdout,)
Loading

0 comments on commit a85db6c

Please sign in to comment.