Skip Headers
Oracle® Database SQL Language Reference
11g Release 2 (11.2)

Part Number E26088-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub
SQLRF06219

PREDICTION

SQLRF51623Syntax

Description of prediction.gif follows
Description of the illustration prediction.gif

SQLRF51624cost_matrix_clause::=

Description of cost_matrix_clause.gif follows
Description of the illustration cost_matrix_clause.gif

SQLRF51625mining_attribute_clause::=

Description of mining_attribute_clause.gif follows
Description of the illustration mining_attribute_clause.gif

SQLRF51626Purpose

This function is for use with mining models created by the DBMS_DATA_MINING package or with Oracle Data Miner. It returns the best prediction for the model. The data type returned depends on the target value type used during the build of the model. For regression models, this function returns the expected value.

SQLRF51627cost_matrix_clause  The COST clause is relevant for all classification models.

If you omit the cost_matrix_clause clause, then the best prediction is the target class with the highest probability. If two or more classes are tied with the highest probability, the database chooses one class.

SQLRF51628mining_attribute_clause This maps the predictors that were provided when the model was built. Specifying USING * maps to all to the columns and expressions that can be retrieved from the underlying inputs (tables, views, and so on).

See Also:

SQLRF51629Example

The following example returns by gender the average age of customers who are likely to use an affinity card. The PREDICTION function takes into account only the cust_marital_status, education, and household_size predictors.

This example, and the prerequisite data mining operations, including the creation of the view, can be found in the demo file $ORACLE_HOME/rdbms/demo/dmdtdemo.sql. General information on data mining demo files is available in Oracle Data Mining Administrator's Guide. The example is presented here to illustrate the syntactic use of the function.

SELECT cust_gender, COUNT(*) AS cnt, ROUND(AVG(age)) AS avg_age
   FROM mining_data_apply_v
   WHERE PREDICTION(DT_SH_Clas_sample COST MODEL
      USING cust_marital_status, education, household_size) = 1
   GROUP BY cust_gender
   ORDER BY cust_gender;

C        CNT    AVG_AGE
- ---------- ----------
F        170         38
M        685         42
Reader Comment

   

Comments, corrections, and suggestions are forwarded to authors every week. By submitting, you confirm you agree to the terms and conditions. Use the OTN forums for product questions. For support or consulting, file a service request through My Oracle Support.

Hide Navigation

Quick Lookup

Database Library · Master Index · Master Glossary · Book List · Data Dictionary · SQL Keywords · Initialization Parameters · Advanced Search · Error Messages

Main Categories

This Document

New and changed documents:
RSS Feed HTML RSS Feed PDF