This for is going to pick up any properties added to the prototype, at the least you should use `sortedFeatures.each` or the lodash `_.each`.

I find these sorts of blocks much easier to read when written in a functional style. I believe that with lodash you can do something along these lines

	_.chain(sortedFeatures)
		.first(model.neighbors + 1)
		.map(function getFeatureClass(feature) {
			return model.targets[_.indexOf(model.features, feature)]
		})
		.groupBy()
		.object(function(features, featureClass) {
			return [featureClass, features.length];
		}).value()