Software Development Kit (SDK)

From Eigenvector Research Documentation Wiki
Revision as of 13:52, 10 September 2020 by Bob (talk | contribs) (Created page with "== Solo_Predictor Software Development Kit (SDK) Overview == In order to facilitate communication with and operations in Solo_Predictor from external environments, Eigenvecto...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Solo_Predictor Software Development Kit (SDK) Overview

In order to facilitate communication with and operations in Solo_Predictor from external environments, Eigenvector Research provides a software development kit (SDK) for common application languages. At this time the SDK is available in Python, with Matlab, Java, and C# ports planned for later release.

The SDK includes a number of methods which cover a signification portion of common usage for deploying an existing model with new data. Description of the methods - inputs, outputs, options - may be found in the above table. These methods will, for the most part, be common across all platform and exceptions will be clearly noted.


SDK Methods

method function arguments returns
getLastResponse() last response returned by Solo/Solo_Predictor, typically in XML format none string(plain or XML)
getLastError() last error generated in operations none string(plain)
clearVariables() clear all workspace variables none Boolean
listVariables() list of workspace variables none Python list
applyModel() apply workspace variable mdl to workspace variable data none Boolean
setDataFile(pathString) load specified file (method argument) and convert to workspace variable data string - path to data file Boolean
setModelFile(pathString) load specified file (method argument) and convert to workspace variable mdl string - path to model file (.mat extension required) Boolean
setOutputFormat(formatString) specify output format for prediction results - choice of Python dict or XML string - choice of "dict" or "xml" (case insensitive) Boolean
setPort(portValue) specify communication port with Solo/Solo_Predictor integer or string (which can be converted to integer) in the range of 1024:65535; default value = 2211 Boolean
setIPAddress(IPAddressString) specify IP address to communicate with Solo/Solo_Predictor string with valid value for IP address; default value is 127.0.0.1 Boolean
getDataFile() return data file set by setDataFile none string(plain)
getModelFile() return model file set by setModelFile none string(plain)
getPort() return port value set by setPort/default value none integer
getIPAddress() return IP address set by setIPAddress/default value none string(plain)
getOutputFormat() return output format for model predictions as set by setOutputFormat/default value none string(plain)
getPredictionResults() return model prediction values as either Python dict or XML formatted dataset object none string(XML) or Python dict; empty string if error encountered
getModelInfo() return info from loaded model none string(plain)
getPredictionResultsVarNames() names of Python dict keys for prediction outputs none Python list
getVersion(modeString) returns version information for Solo_Predictor string with value of "terse" or "full"; default value (no input) is "terse" string(plain) or Python dict
runIncludeFile(pathString) execute content of text file pathString containing valid Solo scripting commands string to text file containing valid Solo scripting commands string(XML)
getVersionSDK() return current version of SDK none string(plain)

A number of the methods return Boolean values indicating success or failure at completing the desired operation. When a return value of False is obtained, detail surrounding the nature of the error may be found from the .getLastError() method. It's important to note that communication errors with Solo_Predictor are not handled by the SDK. As such, your code for communicating with Solo_Predictor should include the platform appropriate error trapping procedures for such instances.

Python Implementation

Requirements

The Python version of the SDK has been tested on releases 2.7 and 3.7. The following libraries - appropriate to the installed version of Python - need to be installed for proper operation:

  • requests
  • BeautifulSoup
  • numpy