Precision Score in Python

Simon Leung
Simon Leung used Ask the Experts™
Any idea how the follow result is calculated :

Testlabels3           = ['Red', 'Green', 'Green', 'Red', 'Yellow']
PredictedLabels3 = ['Red', 'Red', 'Green', 'Yellow', 'Yellow']

precision_score(TestLabels3, PredictedLabels3, average=None)
result : array([1. , 0.5, 0.5])

precision_score(TestLabels3, PredictedLabels3, average='weighted')
result : 0.7
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
I will not be able to answer this question. Others might.
The chance to get an answer might be higher if you mention from which library precision_score is coming from.

Perhaps you add the statement that imports precision_score to your question and you add the module containing precision score to your question's title?
Software Engineer
Distinguished Expert 2018
I guess it has to do with machine learning:

An i have not delved machine learning  on that level. (quite not my line of work (yet?)).
So the Wikipedia article might be a start on finding more info.

Laymans terms of Wikipedia article: (ultra short summary)
This refers to python open source projects that are using this function:

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial