Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

PredictProbability (DMX)

Returns the probability for a specified state.


PredictProbability(<scalar column reference>, [<predicted state>])

A scalar column.

A scalar value.

If the predicted state is omitted, the state that has the highest probability is used, excluding the missing states bucket. To include the missing states bucket, set the <predicted state> to INCLUDE_NULL. To return the probability for the missing states, set the <predicted state> to NULL.

NoteNote

Some mining models do not provide probability values and therefore cannot use this function. In addition, the probability values for any particular target value are calculated differently or might have a different interpretation depending on the model type that you are querying. For more information about how probability is calculated for a particular model type, see the individual algorithm topic in Mining Model Content (Analysis Services - Data Mining).

The following example uses a natural prediction join to determine whether an individual is likely to be a bike buyer based on the TM Decision Tree mining model, and also determines the probability for the prediction. In this example, there are two PredictProbability functions, one for each possible value. If you omit this argument, the function returns the probability for the most likely value.

SELECT
  [Bike Buyer],
  PredictProbability([Bike Buyer], 1) AS [Bike Buyer = Yes],
  PredictProbability([Bike Buyer], 0) AS [Bike Buyer = No]
FROM [TM Decision Tree]
NATURAL PREDICTION JOIN
(SELECT 28 AS [Age],
  '2-5 Miles' AS [Commute Distance],
  'Graduate Degree' AS [Education],
  0 AS [Number Cars Owned],
  0 AS [Number Children At Home]) AS t

Example results:

Bike Buyer

Bike Buyer = Yes

Bike Buyer = No

1

0.867074195848097

0.132755556974282

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.