Skip to content

A classifier inspired by electrostatics. Works with weighted datasets.

Notifications You must be signed in to change notification settings

prajwalsouza/Electrostatic-Classifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Electrostatic Classifier

A classifier inspired by electrostatics. A demo can be found here.

A binary classification demo

Usage

from classifier import ElectroStaticClassifier
clf = ElectroStaticClassifier()

trainingdata = [[1,1], [1,2], [2,1], [3,1], [2,2], [0,3]]
traininglabels = [1, 1, 1, 0, 0, 0]
weights = [0.1, 0.5, 0.4, 0.2, 0.3, 0.1]

clf.fit(trainingdata, traininglabels, weights) #If weights are not given, every data point is assigned the same weight value

clf.predict([0.5, 2]) 
>>> [1]

Dependencies

  1. Numpy : A fundamental package for scientific computing with Python.

Releases

No releases published

Packages

No packages published

Languages