natural icon indicating copy to clipboard operation
natural copied to clipboard

LogisticRegressionClassifier crashing when train function is called

Open bansalvks opened this issue 8 years ago • 8 comments

var classifierLogistic = new natural.LogisticRegressionClassifier();

classifierLogistic.addDocument("unable to connect all websites", "very bad");
classifierLogistic.addDocument("unable to connect some websites", "bad");
classifierLogistic.train();

Natural: 0.4.0

Please help. My whole node js app is crashing when i am training the classifier

bansalvks avatar Mar 02 '17 06:03 bansalvks

seems fine to me , no crashes image

rezk2ll avatar Apr 12 '17 16:04 rezk2ll

natural-poc.zip

I am attaching a zip which contains the code. The thread will be hung at classifierLogistic.train();

bansalvks avatar Apr 13 '17 18:04 bansalvks

that's because the classify method cannot work with the LogisticRegressionClassifier , use BayesClassifier instead. here

var natural = require('natural');

var classifierLogistic = new natural.BayesClassifier();

classifierLogistic.addDocument("unable to connect all websites", "very bad");
classifierLogistic.addDocument("unable to connect some websites", "bad");

classifierLogistic.train(); /// the thread will be hung here

console.log(classifierLogistic.classify('unable to connect some websites'));

this outputs image

rezk2ll avatar Apr 13 '17 18:04 rezk2ll

classify never gets called and the thread never comes out of the train method. I do not know how are you getting the output but look at the screen shot I am attaching. You will see that there is no output

image

bansalvks avatar Apr 14 '17 06:04 bansalvks

Same problem here :/

albertobazilio98 avatar Aug 14 '20 20:08 albertobazilio98

same problem here! :/

akhil1672 avatar Oct 01 '20 11:10 akhil1672

How long did you wait? It worked for me but training took quite a long time.

Dadibom avatar Oct 23 '20 07:10 Dadibom

I still get a memory issue when using logistic regression classifier

SirPhemmiey avatar Oct 28 '20 08:10 SirPhemmiey