1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
|
%global _empty_manifest_terminate_build 0
Name: python-baycomp
Version: 1.0.2
Release: 1
Summary: Bayesian tests for comparison of classifiers
License: MIT License
URL: https://github.com/janezd/baycomp.git
Source0: https://mirrors.nju.edu.cn/pypi/web/packages/6e/f7/49f0cb5f1d1b2421036360d59da131c69224cfcfb483def506831b6515d4/baycomp-1.0.2.tar.gz
BuildArch: noarch
Requires: python3-matplotlib
Requires: python3-numpy
Requires: python3-scipy
%description
Baycomp is a library for Bayesian comparison of classifiers.
Functions compare two classifiers on one or on multiple data sets. They
compute three probabilities: the probability that the first classifier has
higher scores than the second, the probability that differences are within
the region of practical equivalence (rope), or that the second classifier
has higher scores. We will refer to this probabilities as `p_left`, `p_rope`
and `p_right`. If the argument `rope` is omitted (or set to zero), functions
return only `p_left` and `p_right`.
The region of practical equivalence (rope) is specified by the caller and
should correspond to what is "equivalent" in practice; for instance,
classification accuracies that differ by less than 0.5 may be called
equivalent.
Similarly, whether higher scores are better or worse depends upon the type
of the score.
The library can also plot the posterior distributions.
The library can be used in three ways.
1. Two shortcut functions can be used for comparison on single
and on multiple data sets. If `nbc` and `j48` contain a list of average
classification accuracies of naive Bayesian classifier and J48 on a
collection of data sets, we can call
>>> two_on_multiple(nbc, j48, rope=1)
(0.23124, 0.00666, 0.7621)
(Actual results may differ due to Monte Carlo sampling.)
With some additional arguments, the function can also plot the posterior
distribution from which these probabilities came.
2. Tests are packed into test classes. The above call is equivalent to
>>> SignedRankTest.probs(nbc, j48, rope=1)
(0.23124, 0.00666, 0.7621)
and to get a plot, we call
>>> SignedRankTest.plot(nbc, j48, rope=1, names=("nbc", "j48"))
To switch to another test, use another class::
>>> SignTest.probs(nbc, j48, rope=1)
(0.26508, 0.13274, 0.60218)
3. Finally, we can construct and query sampled posterior distributions.
>>> posterior = SignedRankTest(nbc, j48, rope=0.5)
>>> posterior.probs()
(0.23124, 0.00666, 0.7621)
>>> posterior.plot(names=("nbc", "j48"))
%package -n python3-baycomp
Summary: Bayesian tests for comparison of classifiers
Provides: python-baycomp
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%description -n python3-baycomp
Baycomp is a library for Bayesian comparison of classifiers.
Functions compare two classifiers on one or on multiple data sets. They
compute three probabilities: the probability that the first classifier has
higher scores than the second, the probability that differences are within
the region of practical equivalence (rope), or that the second classifier
has higher scores. We will refer to this probabilities as `p_left`, `p_rope`
and `p_right`. If the argument `rope` is omitted (or set to zero), functions
return only `p_left` and `p_right`.
The region of practical equivalence (rope) is specified by the caller and
should correspond to what is "equivalent" in practice; for instance,
classification accuracies that differ by less than 0.5 may be called
equivalent.
Similarly, whether higher scores are better or worse depends upon the type
of the score.
The library can also plot the posterior distributions.
The library can be used in three ways.
1. Two shortcut functions can be used for comparison on single
and on multiple data sets. If `nbc` and `j48` contain a list of average
classification accuracies of naive Bayesian classifier and J48 on a
collection of data sets, we can call
>>> two_on_multiple(nbc, j48, rope=1)
(0.23124, 0.00666, 0.7621)
(Actual results may differ due to Monte Carlo sampling.)
With some additional arguments, the function can also plot the posterior
distribution from which these probabilities came.
2. Tests are packed into test classes. The above call is equivalent to
>>> SignedRankTest.probs(nbc, j48, rope=1)
(0.23124, 0.00666, 0.7621)
and to get a plot, we call
>>> SignedRankTest.plot(nbc, j48, rope=1, names=("nbc", "j48"))
To switch to another test, use another class::
>>> SignTest.probs(nbc, j48, rope=1)
(0.26508, 0.13274, 0.60218)
3. Finally, we can construct and query sampled posterior distributions.
>>> posterior = SignedRankTest(nbc, j48, rope=0.5)
>>> posterior.probs()
(0.23124, 0.00666, 0.7621)
>>> posterior.plot(names=("nbc", "j48"))
%package help
Summary: Development documents and examples for baycomp
Provides: python3-baycomp-doc
%description help
Baycomp is a library for Bayesian comparison of classifiers.
Functions compare two classifiers on one or on multiple data sets. They
compute three probabilities: the probability that the first classifier has
higher scores than the second, the probability that differences are within
the region of practical equivalence (rope), or that the second classifier
has higher scores. We will refer to this probabilities as `p_left`, `p_rope`
and `p_right`. If the argument `rope` is omitted (or set to zero), functions
return only `p_left` and `p_right`.
The region of practical equivalence (rope) is specified by the caller and
should correspond to what is "equivalent" in practice; for instance,
classification accuracies that differ by less than 0.5 may be called
equivalent.
Similarly, whether higher scores are better or worse depends upon the type
of the score.
The library can also plot the posterior distributions.
The library can be used in three ways.
1. Two shortcut functions can be used for comparison on single
and on multiple data sets. If `nbc` and `j48` contain a list of average
classification accuracies of naive Bayesian classifier and J48 on a
collection of data sets, we can call
>>> two_on_multiple(nbc, j48, rope=1)
(0.23124, 0.00666, 0.7621)
(Actual results may differ due to Monte Carlo sampling.)
With some additional arguments, the function can also plot the posterior
distribution from which these probabilities came.
2. Tests are packed into test classes. The above call is equivalent to
>>> SignedRankTest.probs(nbc, j48, rope=1)
(0.23124, 0.00666, 0.7621)
and to get a plot, we call
>>> SignedRankTest.plot(nbc, j48, rope=1, names=("nbc", "j48"))
To switch to another test, use another class::
>>> SignTest.probs(nbc, j48, rope=1)
(0.26508, 0.13274, 0.60218)
3. Finally, we can construct and query sampled posterior distributions.
>>> posterior = SignedRankTest(nbc, j48, rope=0.5)
>>> posterior.probs()
(0.23124, 0.00666, 0.7621)
>>> posterior.plot(names=("nbc", "j48"))
%prep
%autosetup -n baycomp-1.0.2
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%files -n python3-baycomp -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Tue Apr 11 2023 Python_Bot <Python_Bot@openeuler.org> - 1.0.2-1
- Package Spec generated
|