Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run score #361

Open
ritesh99rakesh opened this issue Dec 17, 2019 · 11 comments
Open

Unable to run score #361

ritesh99rakesh opened this issue Dec 17, 2019 · 11 comments
Assignees

Comments

@ritesh99rakesh
Copy link

ritesh99rakesh commented Dec 17, 2019

I was trying to run my own algorithm on the NAB datasets as per option 1 on https://github.com/numenta/NAB/wiki/NAB-Entry-Points
Till optimize function, everything works fine but following error occurs while scoring

Running scoring step
multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 44, in mapstar
    return list(map(*args))
  File "/home/ritesh/NUS/code/NAB/nab/scorer.py", line 165, in scoreDataSet
    return (detectorName, profileName, relativePath, threshold, bestRow.score,
AttributeError: 'NoneType' object has no attribute 'score'
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "run.py", line 204, in <module>
    main(args)
  File "run.py", line 77, in main
    runner.score(args.detectors, detectorThresholds)
  File "/home/ritesh/NUS/code/NAB/nab/runner.py", line 208, in score
    scoreFlag))
  File "/home/ritesh/NUS/code/NAB/nab/scorer.py", line 99, in scoreCorpus
    results = pool.map_async(scoreDataSet, args).get(999999)
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 644, in get
    raise self._value
AttributeError: 'NoneType' object has no attribute 'score'

Please help ASAP

@liuyuqingNKCS
Copy link

I got the same problem, but still don't know how to fix it.
However, I think there must be something wrong in the scoreDataset function in sweeper.py, cause I found the logic below may return None for matchingRow. And then lead to the problem mentioned above.

    matchingRow = None
    prevRow = None

    for thresholdScore in scoresByThreshold:
      if thresholdScore.threshold == threshold:
        matchingRow = thresholdScore
        break
      elif thresholdScore.threshold < threshold:
        matchingRow = prevRow
        break
      
      prevRow = thresholdScore

@bhatiasiddharth
Copy link

@rhyolight @subutai: Can you please fix this or give a lead as to what is causing the problem mentioned here? Thanks.

@lscheinkman lscheinkman self-assigned this Jul 22, 2020
@subutai
Copy link
Member

subutai commented Jul 22, 2020

@rhyolight @subutai: Can you please fix this or give a lead as to what is causing the problem mentioned here? Thanks.

We'll take a look - give us a couple of days. The function may make some assumptions about allowable values.

@lscheinkman
Copy link
Contributor

@bhatiasiddharth Can you verify if the anomalyScore returned by your custom detector handleRecord method is a floating point number between 0 and 1?

@bhatiasiddharth
Copy link

No it is not. Does it need a score between 0 and 1 only?

@lscheinkman
Copy link
Contributor

Yes, the raw anomaly score must be a number between 0 and 1.

@bhatiasiddharth
Copy link

Sure, thanks.

@lscheinkman
Copy link
Contributor

Let me know if it works for you

@bhatiasiddharth
Copy link

Currently, the algorithm I am trying does not give scores between 0 and 1. I need to think how to do it. Once I try, I will let you know. Thanks.

@subutai
Copy link
Member

subutai commented Jul 22, 2020

Currently, the algorithm I am trying does not give scores between 0 and 1. I need to think how to do it. Once I try, I will let you know. Thanks.

Perhaps you can pass it through a sigmoid, or similar function to get the output in range? As long as it's a monotonic function, it shouldn't matter at all since we are just thresholding the score.

@bhatiasiddharth
Copy link

Thanks for letting me know. It worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants