Page 51 - Data Science Algorithms in a Week
P. 51
Naive Bayes
Thus, we get the following data:
Temperature Wind Play
Cold Strong No
Warm Strong No
Warm None Yes
Hot None No
Hot Breeze Yes
Warm Breeze Yes
Cold Breeze No
Cold None Yes
Hot Strong Yes
Warm None Yes
Warm Strong ?
We can keep the duplicate rows, as they give us greater evidence of the occurrence of the
specific data row.
Input:
Saving the table we get the following CSV file:
# source_code/2/chess_reduced.csv
Temperature,Wind,Play
Cold,Strong,No
Warm,Strong,No
Warm,None,Yes
Hot,None,No
Hot,Breeze,Yes
Warm,Breeze,Yes
Cold,Breeze,No
Cold,None,Yes
Hot,Strong,Yes
Warm,None,Yes
Warm,Strong,?
[ 39 ]