Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Alignment API
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
moex
Alignment API
Commits
166ba3d3
Commit
166ba3d3
authored
15 years ago
by
Jérôme Euzenat
Browse files
Options
Downloads
Patches
Plain Diff
- reengineered so that it could be reused by other measures
- more Java 1.5 iterators
parent
2602e640
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/fr/inrialpes/exmo/align/impl/eval/PRecEvaluator.java
+15
-15
15 additions, 15 deletions
src/fr/inrialpes/exmo/align/impl/eval/PRecEvaluator.java
with
15 additions
and
15 deletions
src/fr/inrialpes/exmo/align/impl/eval/PRecEvaluator.java
+
15
−
15
View file @
166ba3d3
...
...
@@ -48,23 +48,23 @@ import java.net.URI;
public
class
PRecEvaluator
extends
BasicEvaluator
implements
Evaluator
{
pr
ivate
double
precision
=
0
.;
pr
otected
double
precision
=
0
.;
pr
ivate
double
recall
=
0
.;
pr
otected
double
recall
=
0
.;
pr
ivate
double
fallout
=
0
.;
pr
otected
double
fallout
=
0
.;
pr
ivate
double
overall
=
0
.;
pr
otected
double
overall
=
0
.;
pr
ivate
double
fmeasure
=
0
.;
pr
otected
double
fmeasure
=
0
.;
pr
ivate
long
time
=
0
;
pr
otected
long
time
=
0
;
pr
ivate
int
nbexpected
=
0
;
pr
otected
int
nbexpected
=
0
;
pr
ivate
int
nbfound
=
0
;
pr
otected
int
nbfound
=
0
;
pr
ivate
int
nbcorrect
=
0
;
// nb of cells correctly identified
pr
otected
int
nbcorrect
=
0
;
// nb of cells correctly identified
/** Creation
* Initiate Evaluator for precision and recall
...
...
@@ -106,14 +106,11 @@ public class PRecEvaluator extends BasicEvaluator implements Evaluator {
}
public
double
eval
(
Parameters
params
,
Object
cache
)
throws
AlignmentException
{
init
();
nbexpected
=
0
;
nbfound
=
align2
.
nbCells
();
precision
=
0
.;
recall
=
0
.;
for
(
Enumeration
e
=
align1
.
getElements
();
e
.
hasMoreElements
();
nbexpected
++)
{
Cell
c1
=
(
Cell
)
e
.
nextElement
();
for
(
Cell
c1
:
align1
)
{
URI
uri1
=
c1
.
getObject2AsURI
();
nbexpected
++;
Set
<
Cell
>
s2
=
(
Set
<
Cell
>)
align2
.
getAlignCells1
(
c1
.
getObject1
()
);
if
(
s2
!=
null
){
for
(
Iterator
it2
=
s2
.
iterator
();
it2
.
hasNext
()
&&
c1
!=
null
;
){
...
...
@@ -127,7 +124,6 @@ public class PRecEvaluator extends BasicEvaluator implements Evaluator {
}
}
}
// What is the definition if:
// nbfound is 0 (p, r are 0)
// nbexpected is 0 [=> nbcorrect is 0] (r=NaN, p=0[if nbfound>0, NaN otherwise])
...
...
@@ -135,6 +131,10 @@ public class PRecEvaluator extends BasicEvaluator implements Evaluator {
// precision is 0 [= nbcorrect is 0]
precision
=
(
double
)
nbcorrect
/
(
double
)
nbfound
;
recall
=
(
double
)
nbcorrect
/
(
double
)
nbexpected
;
return
computeDerived
();
}
protected
double
computeDerived
()
{
fallout
=
(
double
)
(
nbfound
-
nbcorrect
)
/
(
double
)
nbfound
;
fmeasure
=
2
*
precision
*
recall
/
(
precision
+
recall
);
overall
=
recall
*
(
2
-
(
1
/
precision
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment