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.
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
WHERE PREDICTION(DT_SH_Clas_sample COST MODEL
USING cust_marital_status, education, household_size)=1GROUPBY cust_gender
C CNT AVG_AGE
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.