apparatus icon indicating copy to clipboard operation
apparatus copied to clipboard

Error "unable to find minimum"

Open dsl101 opened this issue 5 years ago • 1 comments

I'm using a logistic regression classifier as part of an app to process RSS feed items. I've selected just 2 random items to train on as a test, but can't get past unable to find minimum. This could be because I only have 2 items in the training set (one in each class), or it could be because they're too long (up to 900 words), or it could be because the learning constants mentioned here need to be tweaked for different characteristics of the training set (small number of large documents vs large number of small documents). Or it could be logistic regression just isn't suited to my scenario (normally the training sets would be bigger, but the individual documents could very well be quite large).

Any advice, and if it's a change to those constants, I'm quite happy to have a go at PR.

dsl101 avatar Dec 11 '18 09:12 dsl101

In fact, changing maxIt, or the if(last - current < 0.0001) threshold locally didn't really help here. It was a single document which was causing the problem—these are abstracts from academic journals. This document never exits descendGradient(), due to the fact that current = cost(theta, Examples, classifications); always returns NaN. The text of the specific document, in case that is important, is:

Publication date: September 2019\n\nSource: Behaviour Research and Therapy, Volume 120\n\nAuthor(s): Joseph C. Franklin, Xieyining Huang, Diana BastidasAbstract\n\nCausal knowledge is crucial for understanding and preventing suicide. Unfortunately, we have little direct knowledge about suicide causes because we cannot conduct experiments that seek to make suicide more likely. In such situations, translational approaches can provide valuable, though tentative, information. We sought to establish a new translational approach by developing a laboratory approximation of suicide with new virtual reality (VR) technologies. Such an approach would allow researchers to tentatively investigate the causes of suicide by conducting experiments that introduce purported causes of suicide and observe their effects on VR suicide rates. Across three studies (total N = 498), results indicated that our two VR suicide scenarios (jumping from heights; shooting oneself) were safe; rated as unpleasant, realistic, and suicide-relevant; associated with several relevant predictors of VR suicide completion, including male sex, suicidal desire, suicidal capability, agitation, and prior suicidality; associated with reasons for not engaging in VR suicide that are similar to the reasons people give for not engaging in actual suicide; and produced 5% completion rates under neutral conditions and 25% completion rates after reward/avoid manipulations. We hope that future work further improves this approach and applies it to more directly test ideas about suicide causes and suicide prevention.

dsl101 avatar Sep 17 '19 16:09 dsl101