PPT]Making Observations and Inferences
www.asdk12.org/staff/lasee.../84046_inferences__predictions.ppt
Inference: Explaining your observations to come up with a conclusion. ... sunny day, you observe a massive line of dark clouds quickly advances, what prediction
/support.sas.com/resources/papers/proceedings14/SAS313-2014.pdf
In contrast to many statistical modeling approaches, which can value inference over prediction, the focus of machine learning is predictive accuracy (Breiman 2001a). High predictive accuracy is usually achieved by training complex models, which often involve advanced numerical optimization routines, on a large number of training examples
In contrast to many statistical modeling approaches, which can value inference over prediction, the focus of machine learning is predictive accuracy (Breiman 2001a). High predictive accuracy is usually achieved by training complex models, which often involve advanced numerical optimization routines, on a large number of training examples
[PDF]2. Observation-Inference-Prediction.ppt [Read-Only]
www.hamilton-local.k12.oh.us/.../Obser...
Observation/Inference/Prediction ... □Ex: I predict if I buy a blue sock it will have a hole in it. ... Example: I can not experiment on every single plant in the world to
Hamilton Township High School
Examples of Inference - YourDictionary
examples.yourdictionary.com/examples-of-inference.html
Inference means using knowledge and information to come to conclusions. Examplesof inference can make the concept more clear.Difference between Inference and Prediction? - ProTeacher Community
www.proteacher.net/discussions/showthread.php?t=66235
Dec 24, 2007 - 13 posts
An example from the worksheet I found was: ... Inference and prediction, though, are closely related, and I'm not sure that we really have to ...[PDF]Observation – Inference – Prediction - Science-class.net
science-class.net/NOS/observations/obs_inf_worksheet_2013.pdf
Purpose: To practice distinguishing between observations, inferences and predictions. Scientists ... Color, texture, smells, sounds are all examples of qualitative ...
250
229
|
I am finding it hard to understand the process of Naive Bayes, and I was wondering if someone could explained it with a simple step by step process in English. I understand it takes comparisons by times occurred as a probability, but I have no idea how the training data is related to the actual dataset.
Please give me an explanation of what role the training set plays. I am giving a very simple example for fruits here, like banana for example
| ||||||||||||||||||||
|
403
|
Your question as I understand is divided in two parts. One being you need more understanding for Naive Bayes classifier & second being the confusion surrounding Training set.
In general all of Machine Learning Algorithms need to be trained for supervised learning tasks like classification, prediction etc. or for unsupervised learning tasks like clustering.
By training it means to train them on particular inputs so that later on we may test them for unknown inputs (which they have never seen before) for which they may classify or predict etc (in case of supervised learning) based on their learning. This is what most of the Machine Learning techniques like Neural Networks, SVM, Bayesian etc. are based upon.
So in a general Machine Learning project basically you have to divide your input set to a Development Set (Training Set + Dev-Test Set) & a Test Set (or Evaluation set). Remember your basic objective would be that your system learns and classifies new inputs which they have never seen before in either Dev set or test set.
The test set typically has the same format as the training set. However, it is very important that the test set be distinct from the training corpus: if we simply reused the training set as the test set, then a model that simply memorized its input, without learning how to generalize to new examples, would receive misleadingly high scores.
In general, for an example, 70% can be training set cases. Also remember to partition the original set into the training and test sets randomly.
Now I come to your other question about Naive Bayes.
Source for example below: http://www.statsoft.com/textbook/naive-bayes-classifier
To demonstrate the concept of Naïve Bayes Classification, consider the example given below:
As indicated, the objects can be classified as either
GREEN or RED . Our task is to classify new cases as they arrive, i.e., decide to which class label they belong, based on the currently existing objects.
Since there are twice as many
GREEN objects as RED , it is reasonable to believe that a new case (which hasn't been observed yet) is twice as likely to have membership GREEN rather than RED . In the Bayesian analysis, this belief is known as the prior probability. Prior probabilities are based on previous experience, in this case the percentage of GREEN and RED objects, and often used to predict outcomes before they actually happen.
Thus, we can write:
Prior Probability of
GREEN : number of GREEN objects / total number of objects
Prior Probability of
RED : number of RED objects / total number of objects
Since there is a total of
60 objects, 40 of which are GREEN and 20 RED , our prior probabilities for class membership are:
Prior Probability for
GREEN : 40 / 60
Prior Probability for
RED : 20 / 60
Having formulated our prior probability, we are now ready to classify a new object (
WHITE circle in the diagram below). Since the objects are well clustered, it is reasonable to assume that the more GREEN (or RED ) objects in the vicinity of X, the more likely that the new cases belong to that particular color. To measure this likelihood, we draw a circle around X which encompasses a number (to be chosen a priori) of points irrespective of their class labels. Then we calculate the number of points in the circle belonging to each class label. From this we calculate the likelihood:
From the illustration above, it is clear that Likelihood of
X given GREEN is smaller than Likelihood of X given RED , since the circle encompasses 1 GREEN object and 3 RED ones. Thus:
Although the prior probabilities indicate that
X may belong to GREEN (given that there are twice as many GREEN compared to RED ) the likelihood indicates otherwise; that the class membership of X isRED (given that there are more RED objects in the vicinity of X than GREEN ). In the Bayesian analysis, the final classification is produced by combining both sources of information, i.e., the prior and the likelihood, to form a posterior probability using the so-called Bayes' rule (named after Rev. Thomas Bayes 1702-1761).
Finally, we classify X as
RED since its class membership achieves the largest posterior probability. | ||||||||||||||||||||
|
513
|
I realize that this is an old question, with an established answer. The reason I'm posting is that is the accepted answer has many elements of kNN (k nearest neighbor), a different algorithm.
Both kNN and NaiveBayes are classification algorithms. Conceptually, kNN uses the idea of "nearness" to classify new entities. In kNN 'nearness' is modeled with ideas such as Euclidean Distance or Cosine Distance. By contrast, in NaiveBayes, the concept of 'probability' is used to classify new entities.
Since the question is about Naive Bayes, here's how I'd describe the ideas and steps to someone. I'll try to do it with as few equations and in plain English as much as possible.
First, Conditional Probability & Bayes' Rule
Before someone can understand and appreciate the nuances of Naive Bayes', they need to know a couple of related concepts first, namely, the idea of Conditional Probability, and Bayes' Rule. (If you are familiar with these concepts, skip to the section titled Getting to Naive Bayes')
Conditional Probability in plain English: What is the probability that something will happen, given that something else has already happened.
Let's say that there is some Outcome O. And some Evidence E. From the way these probabilities are defined: The Probability of having both the Outcome O and Evidence E is: (Probability of O occurring) multiplied by the (Prob of E given that O happened)
One Example to understand Conditional Probability:
Let say we have a collection of US Senators. Senators could be Democrats or Republicans. They are also either male or female.
If we select one senator completely randomly, what is the probability that this person is a female Democrat? Conditional Probability can help us answer that.
Probability of (Democrat and Female Senator)= Prob(Senator is Democrat) multiplied by Conditional Probability of Being Female given that they are a Democrat.
We could compute the exact same thing, the reverse way:
Understanding Bayes Rule
Conceptually, this is a way to go from P(Evidence| Known Outcome) to P(Outcome|Known Evidence). Often, we know how frequently some particular evidence is observed, given a known outcome. We have to use this known fact to compute the reverse, to compute the chance of thatoutcome happening, given the evidence.
P(Outcome given that we know some Evidence) = P(Evidence given that we know the Outcome) times Prob(Outcome), scaled by the P(Evidence)
The classic example to understand Bayes' Rule:
Now, all this was just preamble, to get to Naive Bayes.
Getting to Naive Bayes'
So far, we have talked only about one piece of evidence. In reality, we have to predict an outcome given multiple evidence. In that case, the math gets very complicated. To get around that complication, one approach is to 'uncouple' multiple pieces of evidence, and to treat each of piece of evidence as independent. This approach is why this is called naive Bayes.
Many people choose to remember this as:
Notice a few things about this equation:
How to Apply NaiveBayes to Predict an Outcome?
Just run the formula above for each possible outcome. Since we are trying to classify, each outcome is called a
class and it has a class label. Our job is to look at the evidence, to consider how likely it is to be this class or that class, and assign a label to each entity. Again, we take a very simple approach: The class that has the highest probability is declared the "winner" and that class label gets assigned to that combination of evidences.Fruit Example
Let's try it out on an example to increase our understanding: The OP asked for a 'fruit' identification example.
Let's say that we have data on 1000 pieces of fruit. They happen to be Banana, Orange or someOther Fruit. We know 3 characteristics about each fruit:
This is our 'training set.' We will use this to predict the type of any new fruit we encounter.
We can pre-compute a lot of things about our fruit collection.
The so-called "Prior" probabilities. (If we didn't know any of the fruit attributes, this would be our guess.) These are our
base rates.
Probability of "Evidence"
Probability of "Likelihood"
Given a Fruit, how to classify it?
Let's say that we are given the properties of an unknown fruit, and asked to classify it. We are told that the fruit is Long, Sweet and Yellow. Is it a Banana? Is it an Orange? Or Is it some Other Fruit?
We can simply run the numbers for each of the 3 outcomes, one by one. Then we choose the highest probability and 'classify' our unknown fruit as belonging to the class that had the highest probability based on our prior evidence (our 1000 fruit training set):
By an overwhelming margin (
0.252 >> 0.01875 ), we classify this Sweet/Long/Yellow fruit as likely to be a Banana.Why is Bayes Classifier so popular?
Look at what it eventually comes down to. Just some counting and multiplication. We can pre-compute all these terms, and so classifying becomes easy, quick and efficient.
Let P(evidence) = z. Now we quickly compute the following three quantities.
Assign the class label of whichever is the highest number, and you are done.
Despite the name, NaiveBayes turns out to be excellent in certain applications. Text classification is one area where it really shines.
Hope that helps in understanding the concepts behind the Naive Bayes algorithm.
| ||||||||||||||||||||
|
1
|
I try to explain the Bayes rule.
Suppose that you know that 10% of people are smokers. You also know that 90% of smokers are men and 80% of them are above 20 years old.
Now you see someone who is a man and 15 years old. You want to know the chance that he be a smoker:
As you know 10% of people are smokers your initial guess is 10% (prior probability, without knowing anything about the person) but the other evidences (that he is a man and he is 15) can contribute to this probability.
Each evidence may increase or decrease this chance. For example the fact that he is a man mayincrease the chance that he is a smoker, providing that this percentage (being a man) among non-smokers is lower, for example, 40%. In other words being a man must be a good sign of being a smoker rather than a non-smoker
Or in other words, you should compare the commonness of a feature. if the commonness of being a man is 90%, then knowing that 90% of men are smoker doesn't affect our prior probability
(10% * (90% / 90%) = 10%) . But if the men contribute to 40% of the society, the evidence (that 90% of smokers are men) increases the chance of X (10% * (90% / 40%) = 22.5% ) , and if they be 95%, regardless the fact that the percentage of smoker men is high (90%)!, this evidence decreases the chance of X (10% * (90% / 95%) = 9.5%) .
So we have (As this commonness of each feature gets higher, the chance gets lower)
Notice in this formula we assumed that being a man and being under 20 are independent features so we multiplied them, it means that knowing that someone is under 20 has no effect on guessing that he is man or woman. But it may not be true, for example maybe most adolescence in a society are men...
To use this formula in a classifier
The classifier is given some features (man and under 20) and it must decide if he is an smoker or not. It uses the above formula to find that. To gain the needed probabilities (90%, 10%, 80%...) it uses training set. for example it counts the people in the training set that are smokers and find they contribute 10% of the sample. Then for smokers checks how many of them are men or women .... how many are above 20 or under 20....
| |||
0
|
Ram Narasimhan explained the concept very nicely here below is an alternative explanation through the code example of Naive Bayes in action
It uses an example problem from this book on page 351 This is the data set that we will be using In the above dataset if we give the hypothesis = {"Age":'<=30', "Income":"medium", "Student":'yes' , "Creadit_Rating":'fair'} then what is the probability that he will buy or will not buy a computer.The code below exactly answers that question. Just create a file called named new_dataset.csv and paste the following content.
Here is the code the comments explains everything we are doing here! [python]
output:
Hope it helps in better understanding the problem
peace
|