Giter Club home page Giter Club logo

rlr's People

Contributors

alexkiro avatar derekeder avatar fgregg avatar potatochip avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

rlr's Issues

update readme

The Readme should be expanded to include:

  • installation
  • testing
  • team / credits
  • errors / bugs
  • copyright / license

Unstable results with rlr.RegularizedLogisticRegression()

It seems like the rlr.RegularizedLogisticRegression() classifier can get stuck in local minima. Doing multiple runs of fit on the same data, I get different values for weights and bias:

>>> distances = np.array([[ 0.32363278,  0.40278021,  0.0999007 ],
                       [ 0.32363278,  0.65415895,  0.06500483],
                       [ 0.32363278,  0.43124139,  0.33864626],
                       [ 0.71153408,  0.98082042,  0.97221285],
                       [ 0.23200932,  0.37879705,  0.87567651]])
>>> y = np.array([0, 0, 1, 1, 1])
>>> for _ in range(5):
    classifier = rlr.RegularizedLogisticRegression()
    classifier.fit(distances, y)
    print('Weights: ', classifier.weights, ' | Bias: ', classifier.bias)  

INFO:rlr.crossvalidation:using cross validation to find optimum alpha...
INFO:rlr.crossvalidation:optimum alpha: 0.100000
INFO:rlr.crossvalidation:using cross validation to find optimum alpha...
Weights:  [ 0.26613167 -0.1486545   3.13623194]  | Bias:  -0.903821317466
/usr/local/lib/python3.5/dist-packages/rlr/crossvalidation.py:122: RuntimeWarning: invalid value encountered in true_divide
  * (true_distinct + false_distinct)))
INFO:rlr.crossvalidation:optimum alpha: 1.000000
INFO:rlr.crossvalidation:using cross validation to find optimum alpha...
Weights:  [ 0.08961837  0.04917397  0.65640814]  | Bias:  0.0419131239574
INFO:rlr.crossvalidation:optimum alpha: 0.010000
INFO:rlr.crossvalidation:using cross validation to find optimum alpha...
Weights:  [ 0.13760738 -1.73163954  8.77028282]  | Bias:  -1.52055491953
INFO:rlr.crossvalidation:optimum alpha: 1.000000
INFO:rlr.crossvalidation:using cross validation to find optimum alpha...
Weights:  [ 0.08961837  0.04917397  0.65640814]  | Bias:  0.0419131239574
INFO:rlr.crossvalidation:optimum alpha: 0.100000
Weights:  [ 0.26613167 -0.1486545   3.13623194]  | Bias:  -0.903821317466

NB: the input data was generated using ActiveMatching.data_model.distances on a real example in dedupe.

Friendlier error message when passing empty array(s) into "lr" function

When one passes empty array(s) into the lr one gets an error from the bowels of numpy that looks a little like this:

IndexError: index 0 is out of bounds for axis 0 with size 0

It should be simple enough to test whether or not the arrays have anything in them and then raise an exception earlier.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.