8000 refactor: change metric evaluator name adapt to eval_at by JoanFM · Pull Request #1570 · jina-ai/serve · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

refactor: change metric evaluator name adapt to eval_at #1570

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

Merged
merged 7 commits into from
Jan 6, 2021

Conversation

JoanFM
Copy link
Contributor
@JoanFM JoanFM commented Dec 30, 2020

No description provided.

@JoanFM JoanFM requested a review from a team as a code owner December 30, 2020 19:08
@jina-bot jina-bot added size/S area/core This issue/PR affects the core codebase area/testing This issue/PR affects testing component/executor labels Dec 30, 2020
@github-actions
Copy link
github-actions bot commented Dec 30, 2020

Latency summary

Current PR yields:

  • 😶 index QPS at 1566, delta to last 3 avg.: +1%
  • 😶 query QPS at 26, delta to last 3 avg.: -1%

Breakdown

Version Index QPS Query QPS
current 1566 26
0.8.22 1517 26
0.8.21 1555 26
0.8.20 1549 26

Backed by latency-tracking. Further commits will update this comment.

Copy link
Member
@florian-hoenicke florian-hoenicke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line 87 in test_ranking_evaluate_driver has to be changed to
assert doc.evaluations[0].op_name == 'Precision@2'

Also for some reason the function test_ranking_evaluate_driver is there twice. We can remove one of them.

@JoanFM
8000
Copy link
Contributor Author
JoanFM commented Dec 31, 2020

line 87 in test_ranking_evaluate_driver has to be changed to
assert doc.evaluations[0].op_name == 'Precision@2'

Also for some reason the function test_ranking_evaluate_driver is there twice. We can remove one of them.

Is it exactly the same? if it is exactly the same yes we can remove it, otherwise we rename one.

I saw, I want to change to

assert doc.evaluations[0].op_name == executor.metric

Would u have time to do these couple of changes on this branch?

@florian-hoenicke
Copy link
Member

sure - I do it

ground_truth_pairs):
ruuningavg_rank_evaluate_driver.attach(executor=PrecisionEvaluator(eval_at=2), pea=None)
ruuningavg_rank_evaluate_driver._apply_all(ground_truth_pairs)
for pair in ground_truth_pairs:
doc = pair.doc
assert len(doc.evaluations) == 1
assert doc.evaluations[0].op_name == 'Precision@N'
assert doc.evaluations[0].op_name == 'Precision@2'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can u change this to have

driver.attach(executor=executor, pea=None)

assert driver.op_name == executor.metric

Naming might be wrong, but like this the responsibility of testing the actual name is tested in the executor while the driver tests that the name is taken from executor

Copy link
Contributor Author
@JoanFM JoanFM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it

@JoanFM
Copy link
Contributor Author
JoanFM commented Dec 31, 2020

@florian-hoenicke if u can, can u try running jina hello-world and see if the evaluation results are properly shown in the html resulting?

@codecov
Copy link
codecov bot commented Dec 31, 2020

Codecov Report

Merging #1570 (f7da519) into master (35139e9) will increase coverage by 0.89%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1570      +/-   ##
==========================================
+ Coverage   83.44%   84.34%   +0.89%     
==========================================
  Files         128      128              
  Lines        6646     6705      +59     
==========================================
+ Hits         5546     5655     +109     
+ Misses       1100     1050      -50     
Impacted Files Coverage Δ
jina/executors/evaluators/rank/precision.py 100.00% <ø> (ø)
jina/executors/evaluators/rank/recall.py 100.00% <ø> (ø)
jina/drivers/evaluate.py 98.27% <100.00%> (+0.06%) ⬆️
jina/logging/sse.py 91.42% <0.00%> (-0.76%) ⬇️
jina/logging/profile.py 69.84% <0.00%> (-0.56%) ⬇️
jina/executors/decorators.py 91.11% <0.00%> (-0.17%) ⬇️
jina/drivers/craft.py 100.00% <0.00%> (ø)
jina/types/ndarray/generic.py 100.00% <0.00%> (ø)
jina/drivers/encode.py 94.91% <0.00%> (+0.08%) ⬆️
jina/enums.py 96.59% <0.00%> (+0.09%) ⬆️
... and 15 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 35139e9...ca7aa40. Read the comment docs.

@florian-hoenicke
Copy link
Member

As a result I get:
Precision@50: 65.47% Recall@50: 0.55%
The precision looks really low to me.
From what I see in the results, it should be much higher.

@JoanFM
Copy link
Contributor Author
JoanFM commented Dec 31, 2020

As a result I get:
Precision@50: 65.47% Recall@50: 0.55%
The precision looks really low to me.
From what I see in the results, it should be much higher.

thats okey I just want to check the name

Copy link
Member
@hanxiao hanxiao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this intentionally. To me it is redundant as we already have self.name for all executor. Can we just use self.name instead of creating a new property.

I suggest remove redundant metric property and use:

op.name = f'{self.exec.name}@{self.eval_at}'

@JoanFM
Copy link
Contributor Author
JoanFM commented Dec 31, 2020

I removed this intentionally. To me it is redundant as we already have self.name for all executor. Can we just use self.name instead of creating a new property.

I suggest remove redundant metric property and use:

op.name = f'{self.exec.name}@{self.eval_at}'

it was to mantain alignment with hub but yes we can do this. Just wanted to align all

@JoanFM
Copy link
Contributor Author
JoanFM commented Dec 31, 2020

Will do as @hanxiao suggests

@JoanFM JoanFM closed this Dec 31, 2020
@florian-hoenicke
Copy link
Member

I created a new pr for the two tests having the same method name.
https://github.com/jina-ai/jina/pull/1573/files

@JoanFM JoanFM force-pushed the fix-metric-name-eval branch from 95c50e2 to 426cba6 Compare January 2, 2021 17:25
nan-wang
nan-wang previously approved these changes Jan 4, 2021
Copy link
Member
@nan-wang nan-wang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM👍

@nan-wang
Copy link
Member
nan-wang commented Jan 5, 2021

@JoanFM JoanFM force-pushed the fix-metric-name-eval branch from 6db2f84 to ca7aa40 Compare January 5, 2021 07:30
@JoanFM
Copy link
Contributor Author
JoanFM commented Jan 5, 2021

The unit test failed
https://github.com/jina-ai/jina/pull/1570/checks?check_run_id=1645486983#step:6:2024

Thanks for pointing it out

Copy link
Member
@nan-wang nan-wang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM👍

@nan-wang nan-wang merged commit 7200c65 into master Jan 6, 2021
@nan-wang nan-wang deleted the fix-metric-name-eval branch January 6, 2021 03:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core This issue/PR affects the core codebase area/testing This issue/PR affects testing component/driver component/executor size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0