Python Forum
F-score, Precision, and Recall values
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
F-score, Precision, and Recall values
#4
Did you use .numpy() twice?

    return f1.numpy(), precision.numpy(), recall.numpy()
 
f1, precision, recall = computeMetrics([1.0, 2.0, 3.0, 4.0], [1.1, 1.9, 3.2, 4.1])
 
print('metrics: ', f1.numpy(), precision.numpy(), recall.numpy())
AttributeError: 'numpy.float32' object has no attribute 'numpy'
means that the variables are already a numerical object that you can use/print directly
so delete the .numpy() or donĀ“t use it twice on the same object.
Reply


Messages In This Thread
F-score, Precision, and Recall values - by Hani - May-07-2020, 08:58 PM
RE: F-score, Precision, and Recall values - by Hani - May-09-2020, 12:01 AM
RE: F-score, Precision, and Recall values - by ThomasL - May-09-2020, 08:16 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  precision & recall gracenz 1 1,043 Sep-21-2022, 02:14 AM
Last Post: jefsummers
  Time class with picosecond precision marcocod 5 3,764 Jul-03-2020, 12:12 AM
Last Post: Larz60+
  F-score and Recall values Greater Than 1 Hani 5 2,597 May-13-2020, 01:47 AM
Last Post: Hani
  Difference between R^2 and .score donnertrud 1 7,029 Jan-08-2020, 05:14 PM
Last Post: jefsummers
  problem to add precision, recall and f1-score edys 7 4,215 May-28-2019, 04:48 AM
Last Post: heiner55

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020