This article is a continuation of the following article that introduces the system stored procedures for SQL Server Data Mining.
This article is a continuation of the following article that introduces the system stored procedures for SQL Server Data Mining.
The following procedures can only be used with models built using the Microsoft Naïve Bayes algorithm.
Returns an ordered list of attributes correlated to the specified value of the predictable attribute, together with frequency and support.
Fully qualified procedure name
System.Microsoft.AnalysisServices.System.DataMining.NaiveBayes.GetAttributeCharacteristics
Parameters
Model name as string
Predictable attribute node ID as string
Value of predictable attribute as string
Valuetype as integer
Threshold as double
Example
This example returns an ordered list of attributes and values that correlate with the selected attribute value (the predictable attribute in the node with the ID '100000000’) along with the strength of the correlation.
CALL System.GetAttributeCharacteristics('Targeted Mailing NB','100000000', '0', 1,0.0005)
Sample results
Attributes |
Values |
Frequency |
Support |
|
Gender |
M |
1 |
4547 |
|
Marital Status |
M |
0.59 |
2699 |
|
Number Children at Home |
0 |
0.59 |
0.57 |
2611 |
Region |
North America |
0.55 |
2519 |
Notes
This stored procedure is not usually called by the Microsoft Naïve Bayes model viewer. Typically the viewer will load all of the related attributes and filter those displayed in the viewer.
The value type field indicates whether the value a known state from the model, or is the intrinsic Missing value.
See also
Data Mining with SQL Server 2008, MacLennan, 2008, p 226
Takes two values of an attribute and returns an ordered list of attributes, along with the strength with which they differentiate the two values. The stored procedure of the same name that you use with clustering models has a different set of input arguments.
Fully qualified procedure name
System.Microsoft.AnalysisServices.System.DataMining.NaiveBayes.GetAttributeDiscrimination
Parameters
Model name as string
Predictable attribute node ID as string
Value 1 as string
Valuetype as integer
Value 2 as string
Valuetype as integer
Threshold as double
Rescaled as Boolean
Example
This example compares the distribution of attribute values for two states, ‘0’ and ‘1’, of the predictable attribute in the node with the ID '100000000’.
CALL System.GetAttributeDiscrimination('Targeted Mailing NB','100000000', '0', 1, '1', 1, 0.0005, true)
Sample results
Attributes |
Values |
Score |
Score |
InState1 |
InState2 |
OutState1 |
OutState2 |
|
InState2 |
Number Cars Owned |
0 |
|
-100 |
1102 |
1927 |
5443 |
4467 |
Number Cars Owned |
2 |
|
85.32 |
2732 |
1781 |
3813 |
4613 |
|
English Education |
Partial High School |
|
53.89 |
793 |
355 |
5752 |
6039 |
|
Region |
Pacific |
|
2.5%;background-color:transparent;">
||||||
Region -43.04 |
1005 |
1513 |
5540 |
4881 |
Notes
This stored procedure is used in the Microsoft Naïve Bayes model viewer. By default the viewer uses a threshold value of .0005.
You can also use the string literal 'All other states' as a value for the parameter, Attribute value 2.
The value type field indicates whether the value is one of the known states from the model, or is the intrinsic Missing value.
If this parameter is a 1, the value is an actual state of the attribute.
If this parameter is a 0, the value provided for Value1 is ignored, and the left-hand value is considered to be the “missing state”.
If this parameter is a 2, the value provided for Value1 is ignored, and the left hand value is considered to be “all other states.
See also
Data Mining with SQL Server 2008, MacLennan, 2008, p 226
Returns a list of the possible values for the specified predictable attributes, with their support values.
Fully qualified procedure name
System.Microsoft.AnalysisServices.System.DataMining.NaiveBayes.GetAttributeHistogram
Parameters
Model name as string
Node unique ID as string
Example
This example lists all the values of the specified predictable column, and returns the number of cases that contain each value.
CALL GetAttributeHistogram('Targeted Mailing NB')
Sample results
VALUE |
SUPPORT |
|
0 |
0 |
447 |
1 |
4297 |
Notes
Naïve Bayes models support multiple predictable attributes, so you must obtain the node ID of the desired attribute first. Note that the Missing value is always returned as well.
See also
No resources
Returns a list of the predictable attributes with the unique node ID for each attribute.
Fully qualified procedure name
System.Microsoft.AnalysisServices.System.DataMining.NaiveBayes.GetPredictableAttributes
Parameters
Model name as string
Example
This example lists all the attributes in the specified model that were flagged as targets for prediction, and returns the node ID for each attribute.
CALL System.GetPredictableAttributes('Targeted Mailing NB')
Sample results
ATTRIBUTE_NAME |
NODE_UNIQUE_NAME |
Bike Buyer |
10000000 |
Notes
Naïve Bayes models support multiple predictable attributes. After you get the ID of the attribute, you can use GetAttributeHistogram to see a breakdown of the possible predictable values and support for each.
See also
Data Mining with SQL Server 2008, MacLennan, 2008, p 226
Return to list of system stored procedures for all model types