Skip to content
This repository has been archived by the owner on Jun 2, 2022. It is now read-only.

dedupeio/rlr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rlr

L2 Regularized Logistic Regression With Case Weighting

Minimal dependency logistic regression classifer with L2 Regularization and optional case weighting.

Part of the Dedupe.io cloud service and open source toolset for de-duplicating and finding fuzzy matches in your data.

Build Status

labels = numpy.array([1] * 6 + [0] * 6)
examples = numpy.array([1, 0] * 6).reshape(12, 1)

case_weights = numpy.arange(1, 13) * 1./12
case_weights = numpy.array([0.5] * 12)

classifier = rlr.RegularizedLogisticRegression(alpha = 0)
classifier.fit(examples, labels, case_weights=case_weights)

classifier.predict_proba(examples)
[0.5, ... 0.5]