Gaussian Naive Bayes using Scikit-Learn
HTML-код
- Опубликовано: 10 сен 2024
- 𝐆𝐚𝐮𝐬𝐬𝐢𝐚𝐧 𝐍𝐚𝐢𝐯𝐞 𝐁𝐚𝐲𝐞𝐬 is a supervised machine learning algorithm which has been used for a classification task in this example. This algorithm assumes that each feature in the dataset follows a Gaussian distribution.
I used sklearn's 𝗯𝗿𝗲𝗮𝘀𝘁 𝗰𝗮𝗻𝗰𝗲𝗿 dataset for this example. It contains 30 features and 2 types of cancers: 𝗺𝗮𝗹𝗶𝗴𝗻𝗮𝗻𝘁 & 𝗯𝗲𝗻𝗶𝗴𝗻. This dataset is also known as the 𝗕𝗿𝗲𝗮𝘀𝘁 𝗖𝗮𝗻𝗰𝗲𝗿 𝗪𝗶𝘀𝗰𝗼𝗻𝘀𝗶𝗻 dataset.
𝑮𝒊𝒕𝑯𝒖𝒃 𝒂𝒅𝒅𝒓𝒆𝒔𝒔: github.com/ran...
𝙄𝙢𝙥𝙤𝙧𝙩𝙖𝙣𝙩 𝙩𝙞𝙢𝙚𝙨𝙩𝙖𝙢𝙥𝙨:
01:01 - Import required libraries
02:36 - Load sklearn's 𝐛𝐫𝐞𝐚𝐬𝐭 𝐜𝐚𝐧𝐜𝐞𝐫 dataset
06:34 - Split the dataset
07:58 - Apply 𝐆𝐚𝐮𝐬𝐬𝐢𝐚𝐧 𝐍𝐚𝐢𝐯𝐞 𝐁𝐚𝐲𝐞𝐬
09:04 - Plot 𝐜𝐨𝐧𝐟𝐮𝐬𝐢𝐨𝐧_𝐦𝐚𝐭𝐫𝐢𝐱
15:03 - Print 𝐜𝐥𝐚𝐬𝐬𝐢𝐟𝐢𝐜𝐚𝐭𝐢𝐨𝐧_𝐫𝐞𝐩𝐨𝐫𝐭
#datascience #machinelearning #naivebayes #gaussiannaivebayes #jupyternotebook #jupyter #pythonprogramming #python #sklearn #breastcancerwisconsindataset