Code Monkey home page Code Monkey logo

Comments (4)

ngreenstein avatar ngreenstein commented on July 17, 2024

For NNMF_multiplicative:

Based on the existing code, I'm assuming the threshold in question is fit_residual falling below fit_error_limit. 128c7bf implements this.

For NNMF_sgd:

Currently, nothing analogous to fit_error_limit exists, although the docstring suggests that it should. That's easy to add, but (assuming this is the goal), we'd also have to add a step that computes something analogous to fit_residual. I think that requires calling predict() after each iteration, which would have a performance cost.

Do you think it's worth implementing this for NNMF_sgd? Happy to do it if so, just wanted to check if it makes sense.

from neighbors.

ljchang avatar ljchang commented on July 17, 2024

I think the pattern that might make more sense is to loop over iterations and then break of residual is lower than the tolerance.

Check out some of the sklearn algorithms, such as NNMF https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/decomposition/nmf.py

from neighbors.

ngreenstein avatar ngreenstein commented on July 17, 2024

Sure, can definitely do that. It probably also makes sense to check every 10 iterations, as sklearn does, instead of each time.

One question on the math: sklearn is calculating error by comparing current error to the initial error from before fitting began. With multiplicative updating, (previous error - current error) / initial error (link), and with coordinate descent, current error / initial error (link).

Should we do the same?

from neighbors.

ljchang avatar ljchang commented on July 17, 2024

Here are some quick thoughts

  1. Let's go with percent error threshold
  2. Let's add a rate of change threshold
  3. let's try to match Sci-kit learn's defaults in terms of order of operations.

from neighbors.

Related Issues (20)

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.