Skip to content
This repository

Java Machine Learning / Optimization package

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 src
Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.mkd
Octocat-spinner-32 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.