ym2_predict()

Read(143) Label: model, prediction,

Description:

Perform data prediction.

Syntax:

ym2_predict(pcfObj, data)

Note:

External library function (See YModel User Reference).

 

The function performs data prediction and returns prediction result object.

Parameter:

pcfObj

pcf object

data

Data used for prediction, which can a .mtx/.csv file, a table sequence or a cursor

Return value:

Prediction result object

Example:

 

A

 

1

=ym2_env("F:/ymodel")

Initialize environment.

2

=ym2_pcfload("F:/ymodel/data/train.pcf")

Return a pcf file object.

3

=ym2_predict(A2,"F:/ymodel/data/train.csv")

Use a .csv file to perform the prediction.

4

=file("F:/ymodel/data/train.xls").xlsimport@t()

Read train.xls file and return a table sequence.

5

=ym2_predict(A2,A4)

Use the table sequence to perform prediction.

6

=file("F:/ymodel/data/train.txt").cursor@t()

Create cursor based on train.xls to return.

7

=ym2_predict(A2,A6)

Use the cursor to perform prediction.

8

>ym2_close()

Release resources.