Skip to content

Commit

Permalink
Output option added, output refined
Browse files Browse the repository at this point in the history
  • Loading branch information
luav committed Jul 20, 2017
1 parent 9dcfb70 commit abed610
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,16 @@ Execution Options:
-h [ --help ] produce help message
--input arg name of the input files
-s [ --sync ] synchronize the node base, for example to fairly
evaluate against top K selected clusters that
are subset of the original nodes
-f [ --fnmi ] evaluate also FNMI
evaluate against top K selected clusters that
are subset of the original nodes
-n [ --nmis ] output both NMI [max] and NMI_sqrt
-f [ --fnmi ] evaluate also FNMI, includes '-x'
-r [ --risk ] arg (=0.01) probability of value being outside
-e [ --error ] arg (=0.01) admissible error
-a [ --fast ] apply fast approximate evaluations that are less
accurate, but much faster on large networks
accurate, but much faster on large networks
-m [ --membership ] arg (=1) average expected membership of nodes in the
clusters, > 0, typically >= 1
clusters, > 0, typically >= 1
```
If you want to tweak the precision, use the options `-e` and `-r`, to set the error and
the risk respectively. See the [paper](http://arxiv.org/abs/1202.0425) for the meaning of these concepts.
Expand Down
9 changes: 6 additions & 3 deletions gecmi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ int main(int argc, char* argv[])
"name of the input files" )
("sync,s", "synchronize the node base, for example to fairly evaluate against"
" top K selected clusters that are subset of the original nodes")
("fnmi,f", "evaluate also FNMI")
("nmis,n", "output both NMI [max] and NMI_sqrt")
("fnmi,f", "evaluate also FNMI, includes '-x'")
("risk,r",
po::value<double>()->default_value(0.01),
"probability of value being outside" )
Expand Down Expand Up @@ -144,11 +145,13 @@ int main(int argc, char* argv[])
if (vm.count("fnmi")) {
const auto b1rnum = bcp1.uniqrSize();
const auto b2rnum = bcp2.uniqrSize();
printf("NMI: %G, FNMI: %G, NMI_sqrt: %G; cls1: %lu, cls2: %lu\n", cit.nmi
printf("NMI_max: %G, FNMI: %G, NMI_sqrt: %G; cls1: %lu, cls2: %lu\n", cit.nmi
// Note: 2^x is used instead of e^x to have the same base as in the log
, cit.nmi * pow(2, -double(abs(b1rnum - b2rnum)) / std::max(b1rnum, b2rnum))
, cit.nmi_sqrt, b1rnum, b2rnum);
} else printf("NMI: %G, NMI_sqrt: %G\n", cit.nmi, cit.nmi_sqrt);
} else if (vm.count("nmis"))
printf("NMI_max: %G, NMI_sqrt: %G\n", cit.nmi, cit.nmi_sqrt);
else printf("%G\n", cit.nmi);

return 0;
}

0 comments on commit abed610

Please sign in to comment.