Back to Browse

Complement Naive Bayes using Scikit-Learn

129 views
Aug 4, 2024
22:09

๐‚๐จ๐ฆ๐ฉ๐ฅ๐ž๐ฆ๐ž๐ง๐ญ ๐๐š๐ข๐ฏ๐ž ๐๐š๐ฒ๐ž๐ฌ is a supervised machine learning algorithm which has been used for a classification task in this example. This algorithm is a modification of ๐Œ๐ฎ๐ญ๐ข๐ง๐จ๐ฆ๐ข๐š๐ฅ ๐๐š๐ข๐ฏ๐ž ๐๐š๐ฒ๐ž๐ฌ and it works well in the case of unbalanced datasets. I used ๐—ต๐—ฎ๐—บ_๐˜€๐—ฝ๐—ฎ๐—บ.๐—ฐ๐˜€๐˜ƒ dataset for this example. The dataset is available in the repository. It contains 2 types of emails: ๐ก๐š๐ฆ & ๐ฌ๐ฉ๐š๐ฆ. ๐‘ฎ๐’Š๐’•๐‘ฏ๐’–๐’ƒ ๐’‚๐’…๐’…๐’“๐’†๐’”๐’”: https://github.com/randomaccess2023/MG2023/tree/main/Video%2067 ๐™„๐™ข๐™ฅ๐™ค๐™ง๐™ฉ๐™–๐™ฃ๐™ฉ ๐™ฉ๐™ž๐™ข๐™š๐™จ๐™ฉ๐™–๐™ข๐™ฅ๐™จ: 01:01 - Import required libraries 02:39 - Load ๐ก๐š๐ฆ_๐ฌ๐ฉ๐š๐ฆ dataset 03:53 - Drop unnecessary columns 06:53 - Apply preprocessing 07:47 - Separate features and labels 08:09 - Split the dataset 09:42 - Apply ๐•๐ž๐œ๐ญ๐จ๐ซ๐ข๐ณ๐š๐ญ๐ข๐จ๐ง and ๐‚๐จ๐ฆ๐ฉ๐ฅ๐ž๐ฆ๐ž๐ง๐ญ ๐๐š๐ข๐ฏ๐ž ๐๐š๐ฒ๐ž๐ฌ 13:03 - Plot ๐œ๐จ๐ง๐Ÿ๐ฎ๐ฌ๐ข๐จ๐ง_๐ฆ๐š๐ญ๐ซ๐ข๐ฑ 17:42 - Print ๐œ๐ฅ๐š๐ฌ๐ฌ๐ข๐Ÿ๐ข๐œ๐š๐ญ๐ข๐จ๐ง_๐ซ๐ž๐ฉ๐จ๐ซ๐ญ #datascience #pythonprogramming #python #complementnaivebayes #naivebayes #jupyternotebook #jupyter #machinelearning #hamspamdataset

Download

1 formats

Video Formats

360pmp430.0 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

Complement Naive Bayes using Scikit-Learn | NatokHD