summaryrefslogtreecommitdiff
path: root/python-baycomp.spec
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-04-11 10:10:57 +0000
committerCoprDistGit <infra@openeuler.org>2023-04-11 10:10:57 +0000
commit7ef87bcc6db2f952e6e99c1049ba5f74cb95e2b7 (patch)
tree68a01474a20f4f038c65bbcc65da7fa5879f031c /python-baycomp.spec
parent9972ae0edfe88009206aff75eeee3c4ce8c8fcaf (diff)
automatic import of python-baycomp
Diffstat (limited to 'python-baycomp.spec')
-rw-r--r--python-baycomp.spec186
1 files changed, 186 insertions, 0 deletions
diff --git a/python-baycomp.spec b/python-baycomp.spec
new file mode 100644
index 0000000..e82b207
--- /dev/null
+++ b/python-baycomp.spec
@@ -0,0 +1,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