Skip to content

Instantly share code, notes, and snippets.

View shubh29's full-sized avatar

Shubham Mahajan shubh29

View GitHub Profile
@shubh29
shubh29 / naivebayes.py
Created November 6, 2015 16:17 — forked from kvorion/naivebayes.py
naive bayes implementation
#Author: Krishnamurthy Koduvayur Viswanathan
from __future__ import division
import collections
import math
class Model:
def __init__(self, arffFile):
self.trainingFile = arffFile
self.features = {} #all feature names and their possible values (including the class label)