Skip to content

Latest commit

 

History

History
47 lines (41 loc) · 1.51 KB

README.mkd

File metadata and controls

47 lines (41 loc) · 1.51 KB

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 extends Record {
	@Feature
	double myFeature1
	@Feature
	double myFeature2
	@Feature
	double myFeature3
	@Label
	String myLabel;	
	Object nonFeatureItem;
	String nonFeatureOrLabelString;
	//Other stuff I want to do
}

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
		RecordList myRecords = new RecordList();
		//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+ ": " + r.getLabel());
			}
		}
	}
}