Create Predicted Eventlog: Difference between revisions
Jump to navigation
Jump to search
(Created page with " == Prerequisites == Following prerequisites need to be fullfilled to run the eventlog prediction: * QPR ProcessAnalyzer 2024.2 or later * Snowflake is configured * Source model is stored to Snowflake == Prediction installation == Follow these steps to") |
No edit summary |
||
Line 7: | Line 7: | ||
== Prediction installation == | == Prediction installation == | ||
Follow these steps to | Follow these steps to install the eventlog prediction: | ||
# Create a Snowflake-managed stage with name '''PREDICTION''' to the same schema that is configured for QPR ProcessAnalyzer (in the Snowflake connection string). | |||
# Open the created stage and upload the '''predict.pyz''' file to the stage (ask the file from your QPR representative). | |||
# Create the procedure procedure to the same schema. | |||
<pre> | |||
CREATE OR REPLACE PROCEDURE QPRPA_SP_PREDICTION("CONFIGURATION" OBJECT) | |||
RETURNS OBJECT | |||
LANGUAGE PYTHON | |||
STRICT | |||
RUNTIME_VERSION = '3.8' | |||
PACKAGES = ('nltk','numpy','pandas==1.5.3','scikit-learn','snowflake-snowpark-python','tensorflow','dill','prophet','holidays==0.18','python-kubernetes','docker-py') | |||
HANDLER = 'main' | |||
EXECUTE AS OWNER | |||
AS ' | |||
import sys | |||
def main(session, parameters_in: dict) -> dict: | |||
session.file.get(''@prediction/predict.pyz'', ''/tmp'') | |||
sys.path.append(''/tmp/predict.pyz'') | |||
import predict | |||
return predict.main(session, parameters_in) | |||
'; | |||
</pre> |
Revision as of 09:52, 15 February 2024
Prerequisites
Following prerequisites need to be fullfilled to run the eventlog prediction:
- QPR ProcessAnalyzer 2024.2 or later
- Snowflake is configured
- Source model is stored to Snowflake
Prediction installation
Follow these steps to install the eventlog prediction:
- Create a Snowflake-managed stage with name PREDICTION to the same schema that is configured for QPR ProcessAnalyzer (in the Snowflake connection string).
- Open the created stage and upload the predict.pyz file to the stage (ask the file from your QPR representative).
- Create the procedure procedure to the same schema.
CREATE OR REPLACE PROCEDURE QPRPA_SP_PREDICTION("CONFIGURATION" OBJECT) RETURNS OBJECT LANGUAGE PYTHON STRICT RUNTIME_VERSION = '3.8' PACKAGES = ('nltk','numpy','pandas==1.5.3','scikit-learn','snowflake-snowpark-python','tensorflow','dill','prophet','holidays==0.18','python-kubernetes','docker-py') HANDLER = 'main' EXECUTE AS OWNER AS ' import sys def main(session, parameters_in: dict) -> dict: session.file.get(''@prediction/predict.pyz'', ''/tmp'') sys.path.append(''/tmp/predict.pyz'') import predict return predict.main(session, parameters_in) ';