SlideShare a Scribd company logo
Microsoft Naive Bayes Algorithm
overviewNaive Bayes AlgorithmDMX QueriesExploring a Naive Bayes ModelNaive Bayes PrinciplesNaive Bayes Parameters
Naive Bayes AlgorithmThe Microsoft Naive Bayes algorithm is a classification algorithm provided by Microsoft SQL Server Analysis Services for use in predictive modeling. The name Naive Bayes derives from the fact that the algorithm uses Bayes theorem but does not take into account dependencies that may exist, and therefore its assumptions are said to be naive.
How to use the Naive Bayes algorithm in SQL server?This algorithm is less computationally intense than other Microsoft algorithmsIt is therefore is useful for quickly generating mining models to discover relationships between input columns and predictable columns. The algorithm considers each pair of input attribute values and output attribute values.Exploring a Naive Bayes model will tell you how your attributes are related to each other.
DMX When you create a query against a data mining modelyou can create either a content query, which provides details about the patterns discovered in analysis, or you can create a prediction query, which uses the patterns in the model to make predictions for new data You can also retrieve metadata about the model by using a query against the data mining schema rowset.
DMX QueriesSELECT MODEL_CATALOG, MODEL_NAME, DATE_CREATED, LAST_PROCESSED, SERVICE_NAME, PREDICTION_ENTITY, FILTER FROM $system.DMSCHEMA_MINING_MODELS WHERE MODEL_NAME = 'TM_NaiveBayes_Filtered‘Getting Model Metadata by Using DMXyou can find metadata for the model, by querying the data mining schema rowset.This might include when the model was created, when the model was last processed, the name of the mining structure that the model is based on, and the name of the columns used as the predictable attribute.
DMX QueriesRetrieving a Summary of Training DataQuery to retrieve the data from the node specified.Because the statistics are stored in a nested table, the FLATTENED keyword is used to make the results easier to view.     SELECT FLATTENED MODEL_NAME, (SELECT ATTRIBUTE_NAME, ATTRIBUTE_VALUE, [SUPPORT], [PROBABILITY], VALUETYPE FROM NODE_DISTRIBUTION) AS t FROM TM_NaiveBayes.CONTENT WHERE NODE_TYPE = 26
DMX QueriesFinding More Information about AttributesExample to show how to return information from the model about a particular attribute( here ”Region”) The Result of this query is shown in the next slide.SELECT NODE_TYPE, NODE_CAPTION, MSOLAP_NODE_SCORE FROM TM_NaiveBayes.CONTENT WHERE ATTRIBUTE_NAME = 'Region'
DMX QueriesSample Resultto showinginformation from the model about a particular  attribute  ”Region”
DMX QueriesSELECT NODE_CAPTION, MSOLAP_NODE_SCORE FROM TM_NaiveBayes.CONTENT WHERE NODE_TYPE = 10 ORDER BY MSOLAP_NODE_SCORE DESCQuery returns theimportance scores ofall attributes in theModel. The Result of this query is shown in the next slide.
DMX Queriesquery returns theimportance scores ofall attributes in theModel.
Exploring a Naive Bayes ModelThe convenient way to start analyzing a new data set is to create a Naive Bayes model and mark all the non-key columns as both input and predictive.The content of each model is presented as a series of nodes. A node is an object within a mining model that contains metadata and information about a portion of the model. Nodes are arranged in a hierarchy. 
Naive Bayes Model Content
Exploring a Naive Bayes ModelThe Naive Bayes viewer is accessed through either the BI Development Studio or SQL Management Studio by right-clicking on the model and selecting Browse.SQL Server Data Mining provides four different views on Naive Bayes models :Dependency Network: Provides a quick display of how all of the attributes in your model are related. Each node in the graph represents an attribute, whereas each edge represents a relationship. outgoing edge (it is predictive of the attribute in the node at the end of the edge)Incoming edge( it is predicted by the other node)
Exploring a Naive Bayes ModelAttribute Profiles:provides you with an exhaustive report of how each input attribute corresponds to each output attribute, one attribute at a time. At the top of the Attribute Profiles view, you select which output you want to look at, and the rest of the view shows how all of the input attributes are correlated to the states of the selected output attribute.
Exploring a Naive Bayes ModelAttribute Characteristics:This tab allows you to select an output attribute and value and shows you a description of the cases where that attribute and value occur.Attribute Discrimination: Provides the answers to the most interesting question: What is the difference between X and Y? With this viewer, you choose the attribute you are interested in, and select the states you want to compare.
Naive Bayes PrinciplesBayes mathematical methods use a combination of conditional and unconditional probabilities.The Naive part of Naive Bayes tells you to treat all of your input attributes as independent of each other with respect to the target variable. This may be a faulty assumption, but it allows you to multiply your probabilities to determine the likelihood of each state.
Naive Bayes PrinciplesThe Bayes rule states that if you have a hypothesis Hand evidence about that hypothesis E, then the probability of H is calculated using the following formula:P(H | E) =   P(E | H) × P(H)                                   P(E)This simply states that the probability of your hypothesis given the evidence is equal to the probability of the evidence given the hypothesis multiplied by the probability of the hypothesis, and then normalized.
Naive Bayes ParametersMAXIMUM _INPUT _ATTRIBUTES determines the number of attributes that will be considered as inputs for training. If there is more than this number of inputs, the algorithm will select the most important inputs and ignore the rest. Setting this parameter to 0 causes the algorithm to consider all attributes.The default value is 255.MAXIMUM _OUTPUT _ATTRIBUTES determines the number of attributes that will be considered as outputs for training. If there is more than this number of outputs, the algorithm will select the most important outputs and ignore the rest. Setting this parameter to 0 causes the algorithm to consider all attributes.The default value is 255.
Naive Bayes ParametersMAXIMUM _STATES controls how many states of an attribute are considered. If an attribute has more than this number of states, only the most popular states will be used. States that are not selected will be considered to be missing data. This parameter is useful when an attribute has a high cardinality
SummaryNaive Bayes AlgorithmDMX QueriesNaive Bayes Model ContentExploring a Naive Bayes ModelNaive Bayes PrinciplesNaive Bayes Parameters
Visit more self help tutorialsPick a tutorial of your choice and browse through it at your own pace.The tutorials section is free, self-guiding and will not involve any additional support.Visit us at www.dataminingtools.net

More Related Content

PPTX
MS SQL SERVER: Microsoft naive bayes algorithm
PPT
Excel Datamining Addin Beginner
PDF
Matlab for marketing people
PPT
Excel Datamining Addin Intermediate
PPT
Excel Datamining Addin Advanced
PPTX
Learning machine learning with Yellowbrick
PPTX
Analytics machine learning in weka
PPTX
WEKA: Data Mining Input Concepts Instances And Attributes
MS SQL SERVER: Microsoft naive bayes algorithm
Excel Datamining Addin Beginner
Matlab for marketing people
Excel Datamining Addin Intermediate
Excel Datamining Addin Advanced
Learning machine learning with Yellowbrick
Analytics machine learning in weka
WEKA: Data Mining Input Concepts Instances And Attributes

What's hot (20)

PDF
Visualizing Model Selection with Scikit-Yellowbrick: An Introduction to Devel...
PPTX
Generating test data for Statistical and ML models
DOCX
Data mining techniques using weka
PPTX
weka data mining
PDF
Handling SQL Server Null Values
PPT
Data Mining with WEKA WEKA
PPTX
Data mining Part 1
PPTX
PPT
data mining with weka application
PPT
An Introduction To Weka
PPT
Ap Power Point Chpt9
PDF
Data mining with weka
PDF
Data Mining Techniques using WEKA (Ankit Pandey-10BM60012)
PDF
Machine Learning
PDF
Machine Learning with WEKA
PPTX
Interaction Modeling
PDF
somhelpdoc
PPTX
Some Basic Concepts of Object Oriented Methodology
PPTX
XL-MINER:Partition
PPT
WEKA Tutorial
Visualizing Model Selection with Scikit-Yellowbrick: An Introduction to Devel...
Generating test data for Statistical and ML models
Data mining techniques using weka
weka data mining
Handling SQL Server Null Values
Data Mining with WEKA WEKA
Data mining Part 1
data mining with weka application
An Introduction To Weka
Ap Power Point Chpt9
Data mining with weka
Data Mining Techniques using WEKA (Ankit Pandey-10BM60012)
Machine Learning
Machine Learning with WEKA
Interaction Modeling
somhelpdoc
Some Basic Concepts of Object Oriented Methodology
XL-MINER:Partition
WEKA Tutorial
Ad

Viewers also liked (14)

PDF
Social media in Ministry seminar (NST 2010)
KEY
Big break Social Media Seminar
PPTX
MS SQL SERVER: Microsoft time series algorithm
PPT
FastTrac Final Presentations
PPTX
The doula advantage _Spanish version
PDF
Newton March Report
PPT
Marketing VezetőI Wj
PPT
Inforum e befogadas_eu
DOCX
PPTX
Turban and its importance in sikhism
PDF
Daru Toll 2014. június
PDF
Designnet > 09/11
PDF
2005 vuestros cabellos estan todos contados
PDF
Tynki QUICK-MIX - FOLDER PRODUKTÓW
Social media in Ministry seminar (NST 2010)
Big break Social Media Seminar
MS SQL SERVER: Microsoft time series algorithm
FastTrac Final Presentations
The doula advantage _Spanish version
Newton March Report
Marketing VezetőI Wj
Inforum e befogadas_eu
Turban and its importance in sikhism
Daru Toll 2014. június
Designnet > 09/11
2005 vuestros cabellos estan todos contados
Tynki QUICK-MIX - FOLDER PRODUKTÓW
Ad

Similar to MS SQL SERVER: Microsoft naive bayes algorithm (20)

PPTX
MS SQL SERVER: Microsoft sequence clustering and association rules
PPTX
MS SQL SERVER: Microsoft sequence clustering and association rules
PDF
Machine learning Algorithms
PDF
Introduction to Machine Learning with SciKit-Learn
PPT
Lect_04b_PhpMysqlKEY PERFORMANCE INDICATOR FOR ICT-UNIT (new).ppt
DOCX
Task A. [20 marks] Data Choice. Name the chosen data set(s) .docx
PPT
Excel Datamining Addin Beginner
PPTX
Machine Learning - Simple Linear Regression
PPTX
Predicting Employee Churn: A Data-Driven Approach Project Presentation
PPT
Php and MySQL Web Development
PPTX
8606BICA2.pptx
PPTX
Applications of Classification Algorithm.pptx
DOCX
CPSC 50900 Database Systems ProjectAll your efforts this semeste
PPT
Excel Datamining Addin Intermediate
PPTX
Predicting Employee Attrition
PPT
Excel Datamining Addin Advanced
DOCX
Obiee interview questions and answers faq
PPTX
Interface Python with MySQLwedgvwewefwefwe.pptx
PDF
VBA work.pdf
PPTX
Analysis Services en SQL Server 2008
MS SQL SERVER: Microsoft sequence clustering and association rules
MS SQL SERVER: Microsoft sequence clustering and association rules
Machine learning Algorithms
Introduction to Machine Learning with SciKit-Learn
Lect_04b_PhpMysqlKEY PERFORMANCE INDICATOR FOR ICT-UNIT (new).ppt
Task A. [20 marks] Data Choice. Name the chosen data set(s) .docx
Excel Datamining Addin Beginner
Machine Learning - Simple Linear Regression
Predicting Employee Churn: A Data-Driven Approach Project Presentation
Php and MySQL Web Development
8606BICA2.pptx
Applications of Classification Algorithm.pptx
CPSC 50900 Database Systems ProjectAll your efforts this semeste
Excel Datamining Addin Intermediate
Predicting Employee Attrition
Excel Datamining Addin Advanced
Obiee interview questions and answers faq
Interface Python with MySQLwedgvwewefwefwe.pptx
VBA work.pdf
Analysis Services en SQL Server 2008

More from sqlserver content (20)

PPTX
MS SQL SERVER: Using the data mining tools
PPTX
MS SQL SERVER: SSIS and data mining
PPTX
MS SQL SERVER: Programming sql server data mining
PPTX
MS SQL SERVER: Olap cubes and data mining
PPTX
MS SQL SERVER: Neural network and logistic regression
PPTX
MS SQL SERVER: Decision trees algorithm
PPTX
MS SQL Server: Data mining concepts and dmx
PPTX
MS Sql Server: Reporting models
PPTX
MS Sql Server: Reporting manipulating data
PPTX
MS Sql Server: Reporting introduction
PPTX
MS Sql Server: Reporting basics
PPTX
MS Sql Server: Datamining Introduction
PPTX
MS Sql Server: Business Intelligence
PPTX
MS SQLSERVER:Feeding Data Into Database
PPTX
MS SQLSERVER:Doing Calculations With Functions
PPTX
MS SQLSERVER:Deleting A Database
PPTX
MS SQLSERVER:Customizing Your D Base Design
PPTX
MS SQLSERVER:Creating Views
PPTX
MS SQLSERVER:Creating A Database
PPTX
MS SQLSERVER:Advanced Query Concepts Copy
MS SQL SERVER: Using the data mining tools
MS SQL SERVER: SSIS and data mining
MS SQL SERVER: Programming sql server data mining
MS SQL SERVER: Olap cubes and data mining
MS SQL SERVER: Neural network and logistic regression
MS SQL SERVER: Decision trees algorithm
MS SQL Server: Data mining concepts and dmx
MS Sql Server: Reporting models
MS Sql Server: Reporting manipulating data
MS Sql Server: Reporting introduction
MS Sql Server: Reporting basics
MS Sql Server: Datamining Introduction
MS Sql Server: Business Intelligence
MS SQLSERVER:Feeding Data Into Database
MS SQLSERVER:Doing Calculations With Functions
MS SQLSERVER:Deleting A Database
MS SQLSERVER:Customizing Your D Base Design
MS SQLSERVER:Creating Views
MS SQLSERVER:Creating A Database
MS SQLSERVER:Advanced Query Concepts Copy

Recently uploaded (20)

PPTX
Spectroscopy.pptx food analysis technology
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Machine learning based COVID-19 study performance prediction
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Empathic Computing: Creating Shared Understanding
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Machine Learning_overview_presentation.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPT
Teaching material agriculture food technology
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
Spectroscopy.pptx food analysis technology
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Machine learning based COVID-19 study performance prediction
Per capita expenditure prediction using model stacking based on satellite ima...
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Empathic Computing: Creating Shared Understanding
Review of recent advances in non-invasive hemoglobin estimation
Machine Learning_overview_presentation.pptx
Encapsulation_ Review paper, used for researhc scholars
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
MIND Revenue Release Quarter 2 2025 Press Release
“AI and Expert System Decision Support & Business Intelligence Systems”
Teaching material agriculture food technology
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
NewMind AI Weekly Chronicles - August'25-Week II
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Advanced methodologies resolving dimensionality complications for autism neur...
Digital-Transformation-Roadmap-for-Companies.pptx
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf

MS SQL SERVER: Microsoft naive bayes algorithm

  • 2. overviewNaive Bayes AlgorithmDMX QueriesExploring a Naive Bayes ModelNaive Bayes PrinciplesNaive Bayes Parameters
  • 3. Naive Bayes AlgorithmThe Microsoft Naive Bayes algorithm is a classification algorithm provided by Microsoft SQL Server Analysis Services for use in predictive modeling. The name Naive Bayes derives from the fact that the algorithm uses Bayes theorem but does not take into account dependencies that may exist, and therefore its assumptions are said to be naive.
  • 4. How to use the Naive Bayes algorithm in SQL server?This algorithm is less computationally intense than other Microsoft algorithmsIt is therefore is useful for quickly generating mining models to discover relationships between input columns and predictable columns. The algorithm considers each pair of input attribute values and output attribute values.Exploring a Naive Bayes model will tell you how your attributes are related to each other.
  • 5. DMX When you create a query against a data mining modelyou can create either a content query, which provides details about the patterns discovered in analysis, or you can create a prediction query, which uses the patterns in the model to make predictions for new data You can also retrieve metadata about the model by using a query against the data mining schema rowset.
  • 6. DMX QueriesSELECT MODEL_CATALOG, MODEL_NAME, DATE_CREATED, LAST_PROCESSED, SERVICE_NAME, PREDICTION_ENTITY, FILTER FROM $system.DMSCHEMA_MINING_MODELS WHERE MODEL_NAME = 'TM_NaiveBayes_Filtered‘Getting Model Metadata by Using DMXyou can find metadata for the model, by querying the data mining schema rowset.This might include when the model was created, when the model was last processed, the name of the mining structure that the model is based on, and the name of the columns used as the predictable attribute.
  • 7. DMX QueriesRetrieving a Summary of Training DataQuery to retrieve the data from the node specified.Because the statistics are stored in a nested table, the FLATTENED keyword is used to make the results easier to view. SELECT FLATTENED MODEL_NAME, (SELECT ATTRIBUTE_NAME, ATTRIBUTE_VALUE, [SUPPORT], [PROBABILITY], VALUETYPE FROM NODE_DISTRIBUTION) AS t FROM TM_NaiveBayes.CONTENT WHERE NODE_TYPE = 26
  • 8. DMX QueriesFinding More Information about AttributesExample to show how to return information from the model about a particular attribute( here ”Region”) The Result of this query is shown in the next slide.SELECT NODE_TYPE, NODE_CAPTION, MSOLAP_NODE_SCORE FROM TM_NaiveBayes.CONTENT WHERE ATTRIBUTE_NAME = 'Region'
  • 9. DMX QueriesSample Resultto showinginformation from the model about a particular attribute  ”Region”
  • 10. DMX QueriesSELECT NODE_CAPTION, MSOLAP_NODE_SCORE FROM TM_NaiveBayes.CONTENT WHERE NODE_TYPE = 10 ORDER BY MSOLAP_NODE_SCORE DESCQuery returns theimportance scores ofall attributes in theModel. The Result of this query is shown in the next slide.
  • 11. DMX Queriesquery returns theimportance scores ofall attributes in theModel.
  • 12. Exploring a Naive Bayes ModelThe convenient way to start analyzing a new data set is to create a Naive Bayes model and mark all the non-key columns as both input and predictive.The content of each model is presented as a series of nodes. A node is an object within a mining model that contains metadata and information about a portion of the model. Nodes are arranged in a hierarchy. 
  • 14. Exploring a Naive Bayes ModelThe Naive Bayes viewer is accessed through either the BI Development Studio or SQL Management Studio by right-clicking on the model and selecting Browse.SQL Server Data Mining provides four different views on Naive Bayes models :Dependency Network: Provides a quick display of how all of the attributes in your model are related. Each node in the graph represents an attribute, whereas each edge represents a relationship. outgoing edge (it is predictive of the attribute in the node at the end of the edge)Incoming edge( it is predicted by the other node)
  • 15. Exploring a Naive Bayes ModelAttribute Profiles:provides you with an exhaustive report of how each input attribute corresponds to each output attribute, one attribute at a time. At the top of the Attribute Profiles view, you select which output you want to look at, and the rest of the view shows how all of the input attributes are correlated to the states of the selected output attribute.
  • 16. Exploring a Naive Bayes ModelAttribute Characteristics:This tab allows you to select an output attribute and value and shows you a description of the cases where that attribute and value occur.Attribute Discrimination: Provides the answers to the most interesting question: What is the difference between X and Y? With this viewer, you choose the attribute you are interested in, and select the states you want to compare.
  • 17. Naive Bayes PrinciplesBayes mathematical methods use a combination of conditional and unconditional probabilities.The Naive part of Naive Bayes tells you to treat all of your input attributes as independent of each other with respect to the target variable. This may be a faulty assumption, but it allows you to multiply your probabilities to determine the likelihood of each state.
  • 18. Naive Bayes PrinciplesThe Bayes rule states that if you have a hypothesis Hand evidence about that hypothesis E, then the probability of H is calculated using the following formula:P(H | E) = P(E | H) × P(H) P(E)This simply states that the probability of your hypothesis given the evidence is equal to the probability of the evidence given the hypothesis multiplied by the probability of the hypothesis, and then normalized.
  • 19. Naive Bayes ParametersMAXIMUM _INPUT _ATTRIBUTES determines the number of attributes that will be considered as inputs for training. If there is more than this number of inputs, the algorithm will select the most important inputs and ignore the rest. Setting this parameter to 0 causes the algorithm to consider all attributes.The default value is 255.MAXIMUM _OUTPUT _ATTRIBUTES determines the number of attributes that will be considered as outputs for training. If there is more than this number of outputs, the algorithm will select the most important outputs and ignore the rest. Setting this parameter to 0 causes the algorithm to consider all attributes.The default value is 255.
  • 20. Naive Bayes ParametersMAXIMUM _STATES controls how many states of an attribute are considered. If an attribute has more than this number of states, only the most popular states will be used. States that are not selected will be considered to be missing data. This parameter is useful when an attribute has a high cardinality
  • 21. SummaryNaive Bayes AlgorithmDMX QueriesNaive Bayes Model ContentExploring a Naive Bayes ModelNaive Bayes PrinciplesNaive Bayes Parameters
  • 22. Visit more self help tutorialsPick a tutorial of your choice and browse through it at your own pace.The tutorials section is free, self-guiding and will not involve any additional support.Visit us at www.dataminingtools.net