ekloberdanz / naivebayes Goto Github PK
View Code? Open in Web Editor NEWNaive Bayes model for text classification from scratch.
Naive Bayes model for text classification from scratch.
In this lab, I implemented the Naive Bayes algorithm in Python from scratch and I used it to tackle the “20 Newsgroups “ classification problem. The model is multinomial and uses the “bag of words” approach. The summaries below show the class priors, overall accuracies, class accuracies, and confusion matrices for both training and testing data for two different posterior probability estimators: the maximum likelihood estimator (MLE) and the Bayesian estimator (BE). The program naiveBayes2.py must be run with python3 (it was made with and tested with Python 3.5.2). Also, the program is multithreaded and will use all cores availible. (It was tested on a laptop with 8 cores and 16 GB memory and it runs for about a minute.) The following libraries must be installed: csv itertools multiprocessing math pprint pandas sys run the following command to install any library: python3 -m pip install library --user usage: type into terminal: python3 naiveBayes2.py train_label.csv train_data.csv test_label.csv test_data.csv vocabulary.txt
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.