dist/multilabel/Homer.js
function(opts) {
	opts = opts || {};
	if (!opts.multilabelClassifierType) {
		console.dir(opts);
		throw new Error("opts.multilabelClassifierType is null");
	}
	this.multilabelClassifierType = opts.multilabelClassifierType;
	
	this.splitLabel = opts.splitLabel || function(label)      {return label.split(/@/);}
	this.joinLabel  = opts.joinLabel  || function(superlabel) {return superlabel.join("@");}
	
	this.root = {
		superlabelClassifier: this.newMultilabelClassifier(),
		mapSuperlabelToBranch: {}
	}
	
	this.allClasses = {};
}
function(opts) {
	opts = opts || {};
	if (!opts.multilabelClassifierType) {
		console.dir(opts);
		throw new Error("opts.multilabelClassifierType is null");
	}
	this.multilabelClassifierType = opts.multilabelClassifierType;
	
	this.splitLabel = opts.splitLabel || function(label)      {return label.split(/@/);}
	this.joinLabel  = opts.joinLabel  || function(superlabel) {return superlabel.join("@");}
	
	this.root = {
		superlabelClassifier: this.newMultilabelClassifier(),
		mapSuperlabelToBranch: {}
	}
	
	this.allClasses = {};
}
HOMER - Hierarchy Of Multilabel classifiERs. See:

Tsoumakas Grigorios, Katakis Ioannis, Vlahavas Ioannis. Effective and Efficient Multilabel Classification in Domains with Large Number of Labels in Proc. ECML/PKDD 2008 Workshop on Mining Multidimensional Data (MMD'08):XX 2008.
http://www.citeulike.org/user/erelsegal-halevi/tag/homer

@param opts
multilabelClassifierType (mandatory) - the type of the multilabel classifier used in each level of the hierarchy.
splitLabel (optional) - a function that splits a label to a array of sub-labels, from root to leaves. DEFAULT: split around the "@" char.
joinLabel (optional) - a function that joins an array of sub-labels, from root to leaves, to create a full label. DEFAULT: join with the "@" char.

@note The original HOMER paper used a clustering algorithm to create a hierarchy of labels.
This clustering algorithm is not implemented here.
Instead, we use a custom function that converts a label to a path in the hierarchy, and another custom function that converts a path back to a label.