Quick Search:
CODE
Oracle PL/SQL Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
 Oracle PL/SQL: PREDICTION Jump to:  
Category: >> Oracle PL/SQL >> PREDICTION Bookmark and Share

<< lastnext >>

Snippet Name: PREDICTION

Description: PREDICTION returns the best prediction for the model. The datatype returned depends on the target value type used during the build of the model. For regression models, this function returns the expected value.

mining_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).

If you specify more predictors in the mining_attribute_clause than there are predictors used by the model, then the extra expressions are silently ignored.

If you specify fewer predictors than are used during the build, then the operation proceeds with the subset of predictors you specify and returns information on a best-effort basis. All types of models will return a result regardless of the number of predictors you specify in this clause.

If you specify a predictor with the same name as was used during the build but a different datatype, then the database implicitly converts to produce a predictor value of the same type as the original build.

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 can be found in the demo file $ORACLE_HOME/rdbms/demo/dmdtdemo.sql.

Also see:
» PREDICTION_SET
» PREDICTION_PROBABILITY
» PREDICTION_DETAILS
» PREDICTION_COST
» PREDICTION_BOUNDS
» FEATURE_SET
» FEATURE_ID
» CLUSTER_SET
» CLUSTER_PROBABILITY
» CLUSTER_ID

Comment: (none)

Language: PL/SQL
Highlight Mode: PLSQL
Last Modified: March 07th, 2009

PREDICTION(<schema.model>, <cost_matrix_clause>
<mining_attribute_clause>)
 
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
 


Free
Oracle Magazine
Subscriptions
and Oracle White Papers


SQL University.net courses meet the most demanding needs of the business world for advanced education in a cost-effective manner. SQL University.net courses are available immediately for IT professionals and can be taken without disruption of your workplace schedule or processes.

Compared to traditional travel-based training, SQL University.net saves time and valuable corporate resources, allowing companies to do more with less. That's our mission, and that's what we deliver.

Click here to find out more
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 45 users online    © 2009 psoug.org

PSOUG LOGIN
Username: 
Password: 
Forgot your password?