rapidsai / clx

A collection of RAPIDS examples for security analysts, data scientists, and engineers to quickly get started applying RAPIDS and GPU acceleration to real-world cybersecurity use cases.
Apache License 2.0
168 stars 68 forks source link

[BUG] Rerunning Accuracy Score in DGA notebook eventually throws error #437

Closed taureandyernv closed 3 years ago

taureandyernv commented 3 years ago

Describe the bug Subsequent rerunning of the accuracy score cell in the Inference section returns a TypeError

TypeError                                 Traceback (most recent call last)
<ipython-input-20-0c7766158fd1> in <module>
     19 print(type(pred_results[0]))
     20 print(type(true_results[0]))
---> 21 accuracy_score = accuracy_score(pred_results, true_results)
     22 
     23 print('Model accuracy: %s'%(accuracy_score))
TypeError: 'numpy.float64' object is not callable

Steps/Code to reproduce bug

  1. go to https://github.com/rapidsai/clx/blob/branch-21.08/notebooks/dga_detection/DGA_Detection.ipynb
  2. run the notebooks
  3. repeatedly rerun the Accuracy Score Cell and it eventually happens.

Expected behavior The accuracy score would be shown and no errors are through

Proposed solution by @BartleyR and @beckernick is to change the variable name as it could overwrite the function of the same name.