Cognalysis MultiRate API Guide
With the introduction of Cognalysis MultiRate Version 7, users now have an expanded ability to automatically create a DLL to assist in more easily implementing MultiRate models in other applications.
Starting with a fully-optimized model, simply navigate to the Implement tab, select “Export DLL”, and the software will create five files for you:
- {model name}_COM.dll — the COM DLL file
- {model name}_COM.txt — the COM code underlying the compiled COM DLL
- {model name}_NET.dll — the DotNET DLL file
- {model name}_NET.txt — the DotNET code underlying the compiled .NET DLL
- {model name}_PY.py — the Python file
Program Specific Tutorials:
The below code shows how to use a MultiRate DLL in Python.
import sys
sys.path.insert(1,’location of folder containing python file’)
import *model name*_PY as multirate
from datetime import datetime
def ticks(dt):
#For use with datetime format to convert to ticks
return (dt – datetime(1, 1, 1)).total_seconds() * 10000000
oModel = multirate.Model_*model name*()
prediction = oModel.Predict(*Arguments)
# prediction [0] = predicted value
# prediction [1] = base factors
# prediction [2-end] = factors for each variable
# Note: prediction [0] = product(prediction[1:])
# Input: All arguments for API in proper order.
## Note: for a date field, the API requires the net defined Ticks. Use Ticks helper function.
# Output: Result list

