Git Product home page Git Product logo

em-algorithm's People

Contributors

al0new0lf avatar samashi47 avatar

Stargazers

 avatar

Watchers

 avatar

em-algorithm's Issues

bug: NaN values in test with mall customers dataset

NA values in test with mall customers dataset

Expected Behavior

Iterate until it converges or arrives at maxit, then print the results.

Current Behavior

It iterates a number of iteration (maybe 10) and params values become NaN, then it stops and prints:

Error in if (min(abs(paramsOld - paramsCurrent)) < tol) { : 
missing value where TRUE/FALSE needed

With some printing statements to debug:

Iterations of EM:
[1] 0.00 0.10 0.35 0.65 0.90
[1] 1.406076e+03 5.441687e-02 1.844696e-01 3.286551e-01 4.324584e-01
Iteration - 1...
[1] 1.406076e+03 5.441687e-02 1.844696e-01 3.286551e-01 4.324584e-01
[1] 1.406007e+03 5.449429e-02 1.844855e-01 3.285626e-01 4.324577e-01
[1] 1.406007e+03 5.449429e-02 1.844855e-01 3.285626e-01 4.324577e-01
[1] 1.405878e+03 5.464702e-02 1.845239e-01 3.283898e-01 4.324393e-01
[1] 1.405878e+03 5.464702e-02 1.845239e-01 3.283898e-01 4.324393e-01
[1] 1.405614e+03 5.496482e-02 1.846160e-01 3.280472e-01 4.323719e-01
[1] 1.405614e+03 5.496482e-02 1.846160e-01 3.280472e-01 4.323719e-01
[1] 1.405040e+03 5.567459e-02 1.848507e-01 3.273132e-01 4.321615e-01
Iteration - 5...
[1] 1.405040e+03 5.567459e-02 1.848507e-01 3.273132e-01 4.321615e-01
[1] 1.403752e+03 5.732103e-02 1.854629e-01 3.256718e-01 4.315442e-01
[1] 1.403752e+03 5.732103e-02 1.854629e-01 3.256718e-01 4.315442e-01
[1] 1.400936e+03 6.107273e-02 1.870133e-01 3.220353e-01 4.298786e-01
[1] 1.400936e+03 6.107273e-02 1.870133e-01 3.220353e-01 4.298786e-01
[1] 1.395328e+03 6.879273e-02 1.905219e-01 3.145853e-01 4.261001e-01
[1] 1.395328e+03 6.879273e-02 1.905219e-01 3.145853e-01 4.261001e-01
[1] 1.385599e+03 8.201161e-02 1.967473e-01 3.015865e-01 4.196546e-01
[1] 1.385599e+03 8.201161e-02 1.967473e-01 3.015865e-01 4.196546e-01
[1] 1369.5543130    0.1023314    0.2033040    0.2829653    0.4113993
Iteration - 10...
[1] 1369.5543130    0.1023314    0.2033040    0.2829653    0.4113993
[1] 1319.6236650    0.1487267    0.1961885    0.2554316    0.3996531
[1] 1319.6236650    0.1487267    0.1961885    0.2554316    0.3996531
[1] -7056.5065741     0.3041669     0.1403421     0.1932749     0.3622161
[1] -7056.5065741     0.3041669     0.1403421     0.1932749     0.3622161
[1]        NaN 0.56000000 0.13097109 0.09977132 0.20925759
Error in if (min(abs(paramsOld - paramsCurrent)) < tol) { :
missing value where TRUE/FALSE needed

if you ignore the NaNvalues, then it finishes until maxit, and all result values will be NaN.

Possible Solution

Better NaN values handling, or better initial values if thats what generated the bug.

Steps to Reproduce

  1. Run the implementation chunk
  2. Run the Mall customers import chunk
  3. Run the last test chunk

Log file

debug.log

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.