PREDICT command

Applies a predictive model to an unlabeled data set to predict classes or numeric values associated with individual records.

Note

The PREDICT command is not supported if you are running Analytics on a 32-bit computer. The computation required by the command is processor-intensive and better suited to 64-bit computers.

Syntax

PREDICT MODEL model_name TO table_name <IF test> <WHILE test> <FIRST range|NEXT range>

Parameters

Name Description
MODEL model_name

The name of the model file to use for predicting classes or values. You use a model file previously generated by the TRAIN command.

You must specify the *.model file extension. For example:

MODEL "Loan_default_prediction.model"

Note

The model file must have been trained on a data set with the same fields as the unlabeled data set – or substantially the same fields.

You cannot use a model file trained in version 14.1 of Analytics. Version 14.1 model files are not compatible with subsequent versions of Analytics. Train a new predictive model to use with the PREDICT command.

TO table_name

The name of the Analytics table output by the prediction process.

The table contains the key fields you specified during the training process, and either one or two fields generated by the prediction process:

  • Predicted the predicted classes or numeric values associated with each record in the unlabeled data set
  • Probability (classification only) the probability that a predicted class is accurate

Specify table_name as a quoted string with a .FIL file extension. For example: TO "Loan_applicants_default_predicted.FIL"

By default, the table data file (.FIL) is saved to the folder containing the Analytics project.

Use either an absolute or relative file path to save the data file to a different, existing folder:

  • TO "C:\Loan_applicants_default_predicted.FIL"
  • TO "ML Predict output\Loan_applicants_default_predicted.FIL"

Note

Table names are limited to 64 alphanumeric characters, not including the .FIL extension. The name can include the underscore character ( _ ), but no other special characters, or any spaces. The name cannot start with a number.

IF test

optional

A conditional expression that must be true in order to process each record. The command is executed on only those records that satisfy the condition.

Note

The IF parameter is evaluated against only the records remaining in a table after any scope parameters have been applied (WHILE, FIRST, NEXT).

WHILE test

optional

A conditional expression that must be true in order to process each record. The command is executed until the condition evaluates as false, or the end of the table is reached.

Note

If you use WHILE in conjunction with FIRST or NEXT, record processing stops as soon as one limit is reached.

FIRST range | NEXT range

optional

The number of records to process:

  • FIRST start processing from the first record until the specified number of records is reached
  • NEXT start processing from the currently selected record until the specified number of records is reached

Use range to specify the number of records to process.

If you omit FIRST and NEXT, all records are processed by default.

Examples

Use a classification model to make predictions

You input a classification model to the PREDICT command to make predictions about which current loan applicants will default if given a loan.

You previously produced the classification model using the TRAIN command with a set of historical loan data, including loan default information.

OPEN "Loan_applicants_current"
PREDICT MODEL "Loan_default_prediction.model" TO "Loan_applicants_default_predicted.FIL"

Use a regression model to make predictions

You input a regression model to the PREDICT command to make predictions about the future sale price of houses.

You previously produced the regression model using the TRAIN command with a set of recent house sales data, including the sale price.

OPEN "House_price_evaluation"
PREDICT MODEL "House_price_prediction.model" TO "House_prices_predicted.FIL"

Remarks

For more information about how this command works, see Predicting classes and numeric values.