Coder Social home page Coder Social logo

mariolpantunes / ml Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 2.0 890 KB

A standard machine learning library written in Java. It contains several pieces of code/methods/functions that are related with ML and useful for my research. More functions and algorithms are being developed (mostly when I need them).

License: MIT License

Java 100.00%
clustering java machine-learning text-mining

ml's Introduction

ml's People

Contributors

atlas-ma avatar mariolpantunes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ml's Issues

bug

The following code results in an Exception:
final double[] X = new double[] { 1, 2, 3 };
final double[] Y = new double[] { 0, 0.1, 0.1 };
new DFDT().elbow(X, Y);

bug BaseCurvature::knee and BaseCurvature::elbow invalid

Bug reproduction code:
final double[] X = new double[] { 1, 2, 3 };
final double[] Y = new double[] { 0, 0, 0 };
new DSDT().elbow(X, Y);
new DFDT().elbow(X, Y);
new DSDT().knee(X, Y);
new DFDT().knee(X, Y);

Explanation:
When all values of Y are the same (in the above example all are 0.0), the function BaseCurvature::knee (and BaseCurvature::elbow) will calculate the slope -- which would be 0.
However, the code only checks for:
if (slope > 0) {...} else {...}

Thus, the case of slope==0 falls into the else, and calls find_elbow(x, y), which in turn calls itRefinement(x, y), which in turn calls dsdt(..).
However, dsdt(..) calls:
m[] = ArrayUtils.csd(...)
which returns an empty array.
This then calls isoData(..) and cause
double t = mean(...)
to be t=NaN

I suggest fixing the bug in both the elbow(..) and knee(..) level, i.e., after the slope calculation add:
if (slope == 0) { // all values are the same
return rv; // -1
} else if (slope < 0) { ...}
} else { ... }

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.