GithubHelp home page GithubHelp logo

model failures about rcppml HOT 2 CLOSED

zdebruine avatar zdebruine commented on August 25, 2024
model failures

from rcppml.

Comments (2)

zdebruine avatar zdebruine commented on August 25, 2024

@topepo Thanks for raising this issue, clearly it's causing you some trouble. Unfortunately, I could not reproduce your example using the dataset as supplied on two different machines (Windows and CentOS). I tried all seeds between 1 and 10000 for k = 5. In no case was all(is.na(res$w)) == TRUE.

Yes, too much regularization can drive a factor in w or h to complete sparsity, and thus numerical instability. That is the expectation.

Here's what my initial w matrix looks like:

> w_init <- nmf(biomass, k = 5, seed = 1, maxit = 0)$w

iter |      tol 
---------------
> w_init
          [,1]       [,2]      [,3]      [,4]      [,5]
[1,] 0.2655087 0.89838968 0.2059746 0.4976992 0.9347052
[2,] 0.3721239 0.94467527 0.1765568 0.7176185 0.2121425
[3,] 0.5728534 0.66079779 0.6870228 0.9919061 0.6516738
[4,] 0.9082078 0.62911404 0.3841037 0.3800352 0.1255551
[5,] 0.2016819 0.06178627 0.7698414 0.7774452 0.2672207
> sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)

I also tried on a different machine:

> sessionInfo()
R version 4.1.0 (2021-05-18)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)
> library(RcppML)
> library(modeldata)
> library(Matrix)
> 
> data(biomass)
> 
> biomass <- biomass[, 3:7]
> biomass <- as.matrix(biomass)
> biomass <- t(biomass)
> biomass <- Matrix(biomass, sparse = TRUE)
> 
> res <- nmf(biomass, k = 5, seed = 1, maxit = 5)

iter |      tol 
---------------
   1 | 4.58e-01
   2 | 1.03e-01
   3 | 5.50e-03
   4 | 8.68e-04
   5 | 6.20e-04

 convergence not reached in 5 iterations
  (actual tol = 6.20e-04, target tol = 1.00e-04)
> all(is.na(res$w))
[1] FALSE

from rcppml.

topepo avatar topepo commented on August 25, 2024

I updated to the GH version and was able to reproduce what you have. Thanks!

from rcppml.

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.