In this section: |
Once you have finalized your model, you can export the model formula as a routine that can be used to score new data outside of RStat.
RStat offer two types of export options:
How to: |
You can export data using C or PMML. You use C so that the data will work with WebFOCUS and you use PMML in order to see the XML output of the model (or meta) information.
You can use this procedure to export using C or PMML.
If you have executed multiple models, make sure that the specific model you would like to export is selected.
Note: Clear the check box next to either of these include options to exclude these from the exported routine.
How to: |
As of RStat Version 1.3.1, you can export Scoring functions contained within C files to be consumed as a Teradata User Defined Function (UDF). With the exception of the Teradata Export option, the export process is similar to the regular RStat export.
For Big Data Analytics, RStat routines can be deployed for in-database execution. This means that the actual scoring of large amounts of data is executed in the database engine, alleviating the need for extracting the data prior to scoring. When scoring large amounts of data, running the predictive model as an in-database function may result in significant performance gains.
After creating the predictive model, click the Export button. Select the Teradata UDF option on the Export dialog box and then Execute. A C file is created in Teradata UDF format, along with the SQL template needed to define the C program to Teradata. All the input fields are automatically defined in the SQL template. However, the actual location of the C file that has been uploaded needs to be modified in the SQL template. Once you have the location and the SQL, the UDF creation process defined by Teradata should be followed.
Once defined as a Teradata UDF, the RStat model can then be defined as an in-database function to WebFOCUS, either at the Metadata or the WebFOCUS procedure level.
The power of an RStat predictive model in-database function means that you can easily incorporate the model into ETL, reporting, Dashboard, or any other native Teradata Client application.
Along with the C file, an SQL template is created. The items in << item>> need to be modified in the line below:
<< ENTER FULL PATH OF UDF C FILE HERE AND PUT IN SINGLE QUOTE >> EXAMPLE 'CS!<<model name>>!/home/testdrive/ibi/apps/<<model name>>.c!F! <<model name>>'
The following image show an SQL template that has been modified and pasted into a Basic Teradata Query (BTEQ) tool to create a Teradata UDF.
Using the UDF in an SQL Select, note that the custscore function name matches the C file deployment in Teradata.
The following image shows in-database scored values (Arrows) returned in a report.
RStat models are completely integrated with Information Builders tools. Using predictive models in ETL allows you to segment data based on customer market segmentation.
WebFOCUS |