Java Reference

In-Depth Information

24. csApplyTaskFactory.create(

25. customerProfile, "attrition_model", "attritionApplySettings");

26. } else {

27. csRecordApplyTask.setInputRecord(customerProfile);

28. }

29. dmeConn.execute(csRecordApplyTask, timeOut);

30. PhysicalDataRecord outputRecord = csRecordApplyTask.getOutputRecord();

31. return ((Number)outputRecord.getValue("Probability")).doubleValue();

32. }

9.5

Using Regression Interfaces

The
javax.datamining.supervised.regression
package contains regression

function interfaces, such as
RegressionSettings
,
RegressionModel
,

RegressionApplySettings
,
RegressionTestMetrics
, etc. Regression inter-

faces are similar to classification interfaces in many ways. The main

difference, however, is that
regression
predicts continuous values,

whereas classification predicts discrete values. Hence, regression

does not accept objects for cost matrix, target category set, or prior

probabilities. All JDM-specified algorithms discussed for the classifi-

cation can also be used for regression. However, in the case of the

support vector machine (SVM) algorithm, due to variations between

regression and classification JDM explicitly defines an algorithm set-

tings interface called
SVMRegressionSettings
. This section illustrates the

use of the regression-related interfaces by taking the prediction of the

real-estate appraisal value example that was discussed in Section 7.2.

Table 9-17 lists all the regression-specific interface method details.

Note that
RegressionSettings
doesn't have any regression-specific

build settings. Even though there are no regression-specific settings,

this interface is defined to be consistent with other build settings for

future extensions. These setting do, however, inform the
BuildTask

object to build a regression model when executed. A
RegressionModel

object can return the
R-squared
error if the regression model validates

the model either on the build data itself or using the validate data

specified at build time. The
RegressionApplySettings
has only one
map

method through which a user can specify the desired apply content

in the apply output table. The
RegressionApplyContent
allows users to

specify content for the
predicted value
and the
prediction confidence
.

The
RegressionTestMetrics
interface defines the get methods for

various types of regression error measures that were discussed in

Section 7.2.5. By extending the generic
supervised.TestMetricsTask
, the

RegressionTestMetricsTask
computes test metrics using an apply out-

put table instead of a regression model.

Search WWH ::

Custom Search