Java Reference
In-Depth Information
100. "predicted_appraisal_value", "appraisal_test_metrics");
101. ExecutionStatus testStatus = dmeConn.execute( rttk, timeOut );
102. //If the test data is successful then run test metrics task
103. if( ExecutionState.success.equals(testStatus.getState() ) ) {
104. DataSetApplyTask applyTask =
105. atkFactory.create( "appraisal_apply_data", "appraisal_model",
106. "appraisal_test_apply_settings", "APPRAISAL_APPLY_OUTPUT" );
107. ExecutionStatus applyStatus = dmeConn.execute( applyTask, timeOut );
108. //If the apply task on test data is successful then run test metrics task
109. if( ExecutionState.success.equals(applyStatus.getState() ) )
110. return true;
111. else
112. return false;
113. } else {
114. System.out.println("Failed due to: " + testStatus.getDescription());
115. return false;
116. }} else {
117. System.out.println("Failed due to: " + testApplyStatus.getDescription());
118. return false;
119. }}
120. else {
121. System.out.println("Failed due to: " + buildStatus.getDescription());
122. return false;
123. }}
124.
125. //Retrieve built model and test metrics
126. public void output() throws JDMException {
127. //Retrieve regression model
128. RegressionModel regModel = (RegressionModel)dmeConn.retrieveObject(
129. "appraisal_model", NamedObject.model );
130. //Similar to classification model can retreive model signature and
131. //details as shown in Listing 9.4.2
132. . . .
133. //Retrieve regression test metrics
134. RegressionTestMetrics regTestMetrics =
135. (RegressionTestMetrics)dmeConn.retrieveObject(
136. "appraisal_test_metrics", NamedObject.testMetrics );
137. System.out.println(regTestMetrics.getMeanAbsoluteError());
138. System.out.println(regTestMetrics.getRMSError());
139. System.out.println(regTestMetrics.getRSquared());
140. }}
9.6
Using Attribute Importance Interfaces
The javax.datamining.attributeimportance package contains attribute
importance function-specific interfaces, such as AttributeImportance-
Settings and AttributeImportanceModel . Table 9-18 lists the methods of
these interfaces. Attribute importance interfaces are designed to sup-
port finding important attributes for both supervised and unsuper-
vised mining functions. If the target attribute name is specified using
 
Search WWH ::




Custom Search