Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Java Machine Learning / Optimization package
Java
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
src
.gitignore
LICENSE
README.mkd
pom.xml

README.mkd

Rudder is a meant to provide a machine learning framework and package. Using rudder you can extend a base record class and use annotations to define your features and labels, then pass those records into an analytics algorithm without having to write any additional connectors.

There will also be a few utilities that will come in and out of existence as this project grows and is refined.

Everything in this framework should be thread safe, if you find something that is not, please post an issue, a patch, or a unit test illustrating the issue.

Example of running clustering

class MyRecordClass  {
    @Feature
    double myFeature1
    @Feature
    double myFeature2
    @Feature
    double myFeature3
    @Label(setlabel="setLabel")
    String myLabel; 
    Object nonFeatureItem;
    String nonFeatureOrLabelString;

    void setLabel(String label);

    //Only use non-primitives in the set method signature
    void setLabel(Double doubleLabel);

    //Other stuff I want to do

    //This API uses equals often, so your object should override it
    boolean equals(Object o);
}

class MyClusterRunner {
    public static void main(String[] args) {
        double epsilon = 4d;  //Maximum distance between records in a cluster
        int minClusterSize = 3;  //Minimum number of records in a cluster
        IRudderList<MyRecordClass> myRecords = new RudderList<MyRecordClass>();
        //populate your object  
        DBScan dbscan = new DBScan(epsilon, minClusterSize);
        db.setSourceData(list);
        ArrayList<Cluster> clusters = db.getClusters(); 
        //do stuff with your clusters i.e. print record label and cluster
        for(int i=0; i<clusters.size(); i++) {
            for(MyRecordClass r : clusters.getElements()) {
                System.out.println("Cluster " + i+ ": " + myRecords.getStringLabel(r));
            }
        }
    }
}
Something went wrong with that request. Please try again.