项目作者: dedupeio

项目描述 :
Regularized Logistic Regression
高级语言: Python
项目地址: git://github.com/dedupeio/rlr.git
创建时间: 2014-11-19T23:52:43Z
项目社区:https://github.com/dedupeio/rlr

开源协议:Other

下载


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

  1. labels = numpy.array([1] * 6 + [0] * 6)
  2. examples = numpy.array([1, 0] * 6).reshape(12, 1)
  3. case_weights = numpy.arange(1, 13) * 1./12
  4. case_weights = numpy.array([0.5] * 12)
  5. classifier = rlr.RegularizedLogisticRegression(alpha = 0)
  6. classifier.fit(examples, labels, case_weights=case_weights)
  7. classifier.predict_proba(examples)
  8. [0.5, ... 0.5]