I'm using the limdu library found here (https://www.npmjs.com/package/limdu#binary-classification). I'm trying to combine the 'Multi-Label Classification' section with the 'Input Normalization' section to make the outputs all be lowercase, but I keep getting the following error:
/Users/nickbrinsmade/Desktop/limdutest/node_modules/limdu/classifiers/EnhancedClassifier.js:43
this.classifier = new opts.classifierType();
^
TypeError: opts.classifierType is not a constructor
at new EnhancedClassifier (/Users/myusr/Desktop/limdutest/node_modules/limdu/classifiers/EnhancedClassifier.js:43:20)
at Object.<anonymous> (/Users/myusr/Desktop/limdutest/index.js:9:20)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Module.load (internal/modules/cjs/loader.js:937:32)
at Function.Module._load (internal/modules/cjs/loader.js:778:12)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
at internal/main/run_main_module.js:17:47
My code Is seen below:
var limdu = require('limdu');
var MyWinnow = limdu.classifiers.Winnow.bind(0, {retrain_count: 10});
var textClassifier = new limdu.classifiers.multilabel.BinaryRelevance({
binaryClassifierType: MyWinnow
});
intentClassifier = new limdu.classifiers.EnhancedClassifier({
classifierType: textClassifier, // same as in previous example
normalizer: limdu.features.LowerCaseNormalizer
}); //this declaration throws the error.
intentClassifier.trainBatch([
{input: {I:1,want:1,an:1,apple:1}, output: "APPLE"},
{input: {I:1,want:1,a:1,banana:1}, output: "BANANA"},
{input: {I:1,want:1,chips:1}, output: "CHIPS"}
]);
console.log(intentClassifier.classify({I:1,want:1,an:1,apple:1,and:1,a:1,banana:1}));