Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
VEBER Philippe
codepi
Commits
b161a3da
Commit
b161a3da
authored
Mar 24, 2020
by
Philippe Veber
Browse files
Result_table: added interface, optional oracle
parent
3e4064ad
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
11 deletions
+23
-11
lib/convergence_detection.ml
lib/convergence_detection.ml
+2
-1
lib/toolbox/result_table.ml
lib/toolbox/result_table.ml
+13
-10
lib/toolbox/result_table.mli
lib/toolbox/result_table.mli
+8
-0
No files found.
lib/convergence_detection.ml
View file @
b161a3da
...
...
@@ -193,7 +193,8 @@ let recall_precision_curve table =
let
%
workflow
recall_precision_auc_table
table
=
let
module
RT
=
Reviewphiltrans_toolbox
.
Result_table
in
let
{
RT
.
labels
;
scores_per_meth
}
=
RT
.
of_file
[
%
path
table
]
in
let
{
RT
.
oracle
;
scores_per_meth
}
=
RT
.
of_file
[
%
path
table
]
in
let
labels
=
Option
.
value_exn
oracle
in
Array
.
map
scores_per_meth
~
f
:
(
fun
(
meth
,
scores
)
->
let
_
,
auc
=
Biocaml_unix
.
Bin_pred
.
recall_precision_curve
~
labels
~
scores
in
meth
,
auc
...
...
lib/toolbox/result_table.ml
View file @
b161a3da
open
Core_kernel
type
t
=
{
labels
:
bool
array
;
oracle
:
bool
array
option
;
scores_per_meth
:
(
string
*
float
array
)
array
;
}
let
of_file
fn
=
let
module
D
=
Owl
.
Dataframe
in
let
df
=
D
.
of_csv
fn
in
let
labels
=
D
.
get_col_by_name
df
"Oracle"
|>
D
.
unpack_int_series
|>
Array
.
map
~
f
:
(
function
|
0
->
false
|
1
->
true
|
_
->
assert
false
)
let
oracle
=
try
D
.
get_col_by_name
df
"Oracle"
|>
D
.
unpack_int_series
|>
Array
.
map
~
f
:
(
function
|
0
->
false
|
1
->
true
|
_
->
failwith
"Unexpected element in oracle column"
)
|>
Option
.
some
with
Caml
.
Not_found
->
None
in
let
scores
meth
=
match
D
.
get_col_by_name
df
meth
with
...
...
@@ -33,4 +36,4 @@ let of_file fn =
Option
.
map
(
scores
m
)
~
f
:
(
fun
c
->
m
,
c
)
)
in
{
labels
;
scores_per_meth
}
{
oracle
;
scores_per_meth
}
lib/toolbox/result_table.mli
0 → 100644
View file @
b161a3da
(** Format that is expected for the output of a detection method *)
type
t
=
{
oracle
:
bool
array
option
;
scores_per_meth
:
(
string
*
float
array
)
array
;
}
val
of_file
:
string
->
t
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment