Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

162
Views
'classifierType is not a constructor'

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}));
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!