AI BootCamp (Module 1 Crash Course)
Machine learning model that can sort images
Natural Language Processing 7
Machine learning model that can recognise natural language commands
Recommendation Systems 6
Machine learning model that can recommend the reading age of a book based on data about the book
Decisions and Ethics 4
Presentation or report summarising key points
Machine Learning Algorithms 12
In this session we will be looking at some of the algorithms that make machine learning possible.
(Optional) Python and Orange 3
Data visualiastions using Orange Python code for importing data and running machine learning algorithms (decision trees and kNN)
[LAB] Naive Bayes
- Open the spreadsheet – Session 5 data – and click on the tennis tab. This shows whether someone played tennis depending on a range of factors such as how hot it was and whether it was windy.
- Use Worksheet 5.3a to summarise whether someone would play tennis depending on the outlook, temperature, humidity and whether it is windy – the outlook section has been completed for you.
- The probability of someone playing P(yes) is the number of ‘Yes’s for the option divided by the total number of ’Yes’s. For example there are 3 ‘Yes’s for sunny out of 10 ‘Yes’s for outlook so P(yes) for sunny is 3/10.
- Similarly, the probability of someone not playing P(no) is the number of ‘No’s for the option divided by the total number of ’No’s. So for sunny, P(no) is 2/5.
- Complete P(yes) and P(no) for each option.
- Find out the probability of playing tennis if it is sunny, mild, high humidity and not windy – you need multiply the P(yes) for each option.
- In the same way, to calculate the probability of not playing tennis you will need to multiply the P(no) for each option.
- The worked example on Worksheet 5.3b illustrates both these.
- Each fraction can be expressed as a decimal by dividing the top number by the bottom number, e.g. 3/10 = 0.3. This will make it easier to calculate the probability using a calculator.
- Finally, to convert the probability into a percentage, use this formulae
Percentage probability of Yes = P(yes) / (P(yes) + P(no)) * 100
Percentage probability of No = P(no) / (P(yes) + P(no)) * 100
e.g. for Yes = 0.0252 / 0.0764 * 100 = 33%
- Follow this method to calculate the probability of playing tennis if it is rainy, cool, normal humidity and windy.
- Extension – What is the probability of playing tennis if it is overcast? (Hint – you will not need a calculator for this.)