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
d3499db5
Commit
d3499db5
authored
15 years ago
by
Jérôme Euzenat
Browse files
Options
Downloads
Patches
Plain Diff
- documented non-reentrance
- improved loop (1.5) - minor cosmetic changes
parent
5d49db87
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
+9
-8
9 additions, 8 deletions
src/fr/inrialpes/exmo/align/impl/eval/PRecEvaluator.java
with
9 additions
and
8 deletions
src/fr/inrialpes/exmo/align/impl/eval/PRecEvaluator.java
+
9
−
8
View file @
d3499db5
/*
* $Id$
*
* Copyright (C) INRIA, 2004-
2009,
2010
* Copyright (C) INRIA, 2004-2010
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
...
...
@@ -72,6 +72,8 @@ public class PRecEvaluator extends BasicEvaluator implements Evaluator {
* Initiate Evaluator for precision and recall
* @param align1 : the reference alignment
* @param align2 : the alignment to evaluate
* The two parameters are transformed into URIAlignment before being processed
* Hence, if one of them is modified after initialisation, this will not be taken into account.
**/
public
PRecEvaluator
(
Alignment
align1
,
Alignment
align2
)
throws
AlignmentException
{
super
(((
BasicAlignment
)
align1
).
toURIAlignment
(),
((
BasicAlignment
)
align2
).
toURIAlignment
());
...
...
@@ -105,9 +107,6 @@ public class PRecEvaluator extends BasicEvaluator implements Evaluator {
* In the implementation |B|=nbfound, |A|=nbexpected and |A inter B|=nbcorrect.
*/
public
double
eval
(
Properties
params
)
throws
AlignmentException
{
return
eval
(
params
,
(
Object
)
null
);
}
public
double
eval
(
Properties
params
,
Object
cache
)
throws
AlignmentException
{
init
();
nbfound
=
align2
.
nbCells
();
...
...
@@ -116,13 +115,12 @@ public class PRecEvaluator extends BasicEvaluator implements Evaluator {
nbexpected
++;
Set
<
Cell
>
s2
=
align2
.
getAlignCells1
(
c1
.
getObject1
()
);
if
(
s2
!=
null
){
for
(
Iterator
it2
=
s2
.
iterator
();
it2
.
hasNext
()
&&
c1
!=
null
;
){
Cell
c2
=
(
Cell
)
it2
.
next
();
for
(
Cell
c2
:
s2
)
{
URI
uri2
=
c2
.
getObject2AsURI
();
// if (c1.getobject2 == c2.getobject2)
if
(
uri1
.
toString
().
equals
(
uri2
.
toString
()))
{
if
(
uri1
.
toString
().
equals
(
uri2
.
toString
())
)
{
nbcorrect
++;
c1
=
null
;
// out of the loop.
break
;
}
}
}
...
...
@@ -136,6 +134,9 @@ public class PRecEvaluator extends BasicEvaluator implements Evaluator {
recall
=
(
double
)
nbcorrect
/
(
double
)
nbexpected
;
return
computeDerived
();
}
public
double
eval
(
Properties
params
,
Object
cache
)
throws
AlignmentException
{
return
eval
(
params
);
}
protected
double
computeDerived
()
{
fallout
=
(
double
)
(
nbfound
-
nbcorrect
)
/
(
double
)
nbfound
;
...
...
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