2
.TH BAYESOL 1 "Bayesian Classification Tools" "Version @VERSION@" ""
4
bayesol \- a Bayes solution calculator for use with dbacl.
17
is a Bayes solution calculator designed to combine the output of
19
with a prior distribution and a risk specification, and
20
calculate the optimal Bayesian decision (which minimizes the posterior
23
The risk specification is read from the text file
25
and must be written in a simple format described below. The
27
output can either be read from FILE or from STDIN.
31
returns a positive integer corresponding to the category with the lowest risk.
39
See the section RISK SPECIFICATION.
41
Fully internationalized mode. Forces the use of wide characters internally,
42
which is necessary in some locales. This incurs a noticeable performance penalty.
44
Print risk scores for each
46
Each score is (approximately) the logarithm of the expected risk under that category. The lowest score (ie closest to -infinity) is best, etc.
48
Print recursive risk scores for each
50
Each score is (approximately) the logarithm of the best score based on
51
the remaining categories, after the previously best scoring categories
52
have been removed, and a normalizing factor was added. A full
53
description is given in the technical report listed at the end of this
54
manpange. The largest score (ie closest to +infinity) is best, etc.
56
Verbose mode. Prints to STDOUT the category with minimum posterior risk.
57
In case several categories are possible,
58
prints the first category in the order in which they appear
59
in the categories section of
62
Print debug output. Do not use.
64
Print the program version number and exit.
65
.SH RISK SPECIFICATION
67
needs to read a text file
69
containing a risk specification. The format of this text file is as follows
84
"\fIregex1\fR" \fIc1\fR [
86
.IR formula12 , "" ...,
89
"\fIregex2\fR" \fIc2\fR [
91
.IR formula22 , "" ...,
98
"\fIregexM\fR" \fIcM\fR [
100
.IR formulaM2 , "" ...,
115
are non-negative numbers,
119
are (possibly empty) regular expression strings,
123
are instances of the category names
127
and the formulas are numbers or mathematical expressions.
129
Every category which appears in the categories section must appear at least
130
once in the loss_matrix section, with an empty "" regular expression.
131
To construct the actual loss matrix used in the decision calculations,
133
selects, for each category appearing in the categories section,
134
the first row whose regular expression is matched
135
within FILE or STDIN, or the first row with empty regular expression if there
138
Each formula can be either a single number, or an algebraic combination of
139
the operators exp(), log(), +, -, *, /, ^ and parentheses (). The string "inf"
140
is parsed as the value infinity. Also, the
141
string "complexity" is recognized, and converted to the complexity for
146
corresponding regular expression contains submatches delimited by parentheses,
147
their numerical values can be used inside the formulas as the special variables
148
$1, ..., $9. Note that submatches which aren't numerical are converted to the value zero.
150
Case is important. Spaces and newlines can be liberally inserted. Comments
151
must start with a # and extend to the end of the line.
156
is used together with
158
An invocation looks like this:
161
% dbacl -c one -c two -c three sample.txt -vna | bayesol -c toy.risk -v
164
See @PKGDATADIR@/doc/costs.ps for a description of the algorithm used.
166
@PKGDATADIR@/doc/tutorial.html for a more detailed overview.
169
The source code for the latest version of this program is available at the
173
http://www.lbreyer.com/gpl.html
175
http://dbacl.sourceforge.net
179
Laird A. Breyer <laird@lbreyer.com>