With the introduction of Cognalysis MultiRate Version 5, users now have the ability to automatically create a DLL to assist in more easily implementing MultiRate models in other applications.

Starting with a fully-optimized model, simply select File…Create API in MultiRate, and the software will create four files for you:

  1. {model name}_COM.dll — the COM DLL file
  2. {model name}_COM.txt — the COM code underlying the compiled COM DLL
  3. {model name}_NET.dll — the DotNET DLL file
  4. {model name}_NET.txt — the DotNET code underlying the compiled .NET DLL

 

This guide will focus on implementing the NET DLL. You’ll find help implementing the COM DLL here.

In the videos below, we will demonstrate one method to call this DLL from the statistical language R, allowing deployment of MultiRate models directly into R code.  Finally, we’ll demonstrate how to embed that R code and the MultiRate DLL directly into Microsoft Excel

Implementing MultiRate DLL in R

R Wrapper Code for Cognalysis MultiRate DLL

In summary:

  1. Inspect the DotNET code to extract function name, model variables, and variable data types
  2. Write an R function wrapper script that calls the DLL Predict() function using the rClr package
  3. Call the finished R function to return the prediction

Implementing MultiRate DLL in Excel

Embedding Cognalysis MultiRate API to Calculate Predictions in Excel with BERT

In summary:

  1. Install the Excel Add-In BERT2 to access R scripts natively as Excel functions
  2. Create the R wrapper script as above
  3. Call the DLL Predict() function and inspect the results

To download files referenced in this tutorial, visit https://github/Cognalysis-Support/MultiRate-DLL

If you need help getting R integrated with Microsoft Excel, see our page with full instructions and downloads for Installing BERT2 to Integrate R and Excel.