-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
103 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,15 +20,16 @@ jobs: | |
env: | ||
QUAPY_TESTS_OMIT_LARGE_DATASETS: True | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip setuptools wheel | ||
python -m pip install -e .[bayes,composable,tests] | ||
python -m pip install "qunfold @ git+https://github.com/mirkobunse/[email protected]" | ||
python -m pip install -e .[bayes,tests] | ||
- name: Test with unittest | ||
run: python -m unittest | ||
|
||
|
@@ -38,15 +39,18 @@ jobs: | |
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/master' | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Build documentation | ||
uses: ammaraskar/sphinx-action@master | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
pre-build-command: | | ||
apt-get --allow-releaseinfo-change update -y && apt-get install -y git && git --version | ||
python -m pip install --upgrade pip setuptools wheel "jax[cpu]" | ||
python -m pip install -e .[composable,neural,docs] | ||
docs-folder: "docs/" | ||
python-version: 3.11 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip setuptools wheel "jax[cpu]" | ||
python -m pip install "qunfold @ git+https://github.com/mirkobunse/[email protected]" | ||
python -m pip install -e .[neural,docs] | ||
- name: Build documentation | ||
run: sphinx-build -M html docs/source docs/build | ||
- name: Publish documentation | ||
run: | | ||
git clone ${{ github.server_url }}/${{ github.repository }}.git --branch gh-pages --single-branch __gh-pages/ | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -167,3 +167,4 @@ TweetSentQuant | |
|
||
|
||
*.png | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
- Test the return_type="index" in protocols and finish the "distributin_samples.py" example | ||
- Add EDy (an implementation is available at quantificationlib) | ||
- | ||
- [TODO] Test the return_type="index" in protocols and finish the "distributin_samples.py" example | ||
- [TODO] Add EDy (an implementation is available at quantificationlib) | ||
- [TODO] add ensemble methods SC-MQ, MC-SQ, MC-MQ | ||
- [TODO] add HistNetQ | ||
- [TODO] add CDE-iteration and Bayes-CDE methods | ||
- [TODO] add Friedman's method and DeBias | ||
- [TODO] check ignore warning stuff | ||
check https://docs.python.org/3/library/warnings.html#temporarily-suppressing-warnings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -447,7 +447,7 @@ The [](quapy.method.composable) module allows the composition of quantification | |
```sh | ||
pip install --upgrade pip setuptools wheel | ||
pip install "jax[cpu]" | ||
pip install quapy[composable] | ||
pip install "qunfold @ git+https://github.com/mirkobunse/[email protected]" | ||
``` | ||
|
||
### Basics | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,13 @@ | |
This example illustrates the composition of quantification methods from | ||
arbitrary loss functions and feature transformations. It will extend the basic | ||
example on the usage of quapy with this composition. | ||
This example requires the installation of qunfold, the back-end of QuaPy's | ||
composition module: | ||
pip install --upgrade pip setuptools wheel | ||
pip install "jax[cpu]" | ||
pip install "qunfold @ git+https://github.com/mirkobunse/[email protected]" | ||
""" | ||
|
||
import numpy as np | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,57 @@ | ||
"""This module allows the composition of quantification methods from loss functions and feature transformations. This functionality is realized through an integration of the qunfold package: https://github.com/mirkobunse/qunfold.""" | ||
|
||
import qunfold | ||
from qunfold.quapy import QuaPyWrapper | ||
from qunfold.sklearn import CVClassifier | ||
from qunfold import ( | ||
LeastSquaresLoss, # losses | ||
BlobelLoss, | ||
EnergyLoss, | ||
HellingerSurrogateLoss, | ||
CombinedLoss, | ||
TikhonovRegularization, | ||
TikhonovRegularized, | ||
ClassTransformer, # transformers | ||
HistogramTransformer, | ||
DistanceTransformer, | ||
KernelTransformer, | ||
EnergyKernelTransformer, | ||
LaplacianKernelTransformer, | ||
GaussianKernelTransformer, | ||
GaussianRFFKernelTransformer, | ||
) | ||
_import_error_message = """qunfold, the back-end of quapy.method.composable, is not properly installed. | ||
__all__ = [ # control public members, e.g., for auto-documentation in sphinx; omit QuaPyWrapper | ||
"ComposableQuantifier", | ||
"CVClassifier", | ||
"LeastSquaresLoss", | ||
"BlobelLoss", | ||
"EnergyLoss", | ||
"HellingerSurrogateLoss", | ||
"CombinedLoss", | ||
"TikhonovRegularization", | ||
"TikhonovRegularized", | ||
"ClassTransformer", | ||
"HistogramTransformer", | ||
"DistanceTransformer", | ||
"KernelTransformer", | ||
"EnergyKernelTransformer", | ||
"LaplacianKernelTransformer", | ||
"GaussianKernelTransformer", | ||
"GaussianRFFKernelTransformer", | ||
] | ||
To fix this error, call: | ||
pip install --upgrade pip setuptools wheel | ||
pip install "jax[cpu]" | ||
pip install "qunfold @ git+https://github.com/mirkobunse/[email protected]" | ||
""" | ||
|
||
try: | ||
import qunfold | ||
from qunfold.quapy import QuaPyWrapper | ||
from qunfold.sklearn import CVClassifier | ||
from qunfold import ( | ||
LeastSquaresLoss, # losses | ||
BlobelLoss, | ||
EnergyLoss, | ||
HellingerSurrogateLoss, | ||
CombinedLoss, | ||
TikhonovRegularization, | ||
TikhonovRegularized, | ||
ClassTransformer, # transformers | ||
HistogramTransformer, | ||
DistanceTransformer, | ||
KernelTransformer, | ||
EnergyKernelTransformer, | ||
LaplacianKernelTransformer, | ||
GaussianKernelTransformer, | ||
GaussianRFFKernelTransformer, | ||
) | ||
|
||
__all__ = [ # control public members, e.g., for auto-documentation in sphinx; omit QuaPyWrapper | ||
"ComposableQuantifier", | ||
"CVClassifier", | ||
"LeastSquaresLoss", | ||
"BlobelLoss", | ||
"EnergyLoss", | ||
"HellingerSurrogateLoss", | ||
"CombinedLoss", | ||
"TikhonovRegularization", | ||
"TikhonovRegularized", | ||
"ClassTransformer", | ||
"HistogramTransformer", | ||
"DistanceTransformer", | ||
"KernelTransformer", | ||
"EnergyKernelTransformer", | ||
"LaplacianKernelTransformer", | ||
"GaussianKernelTransformer", | ||
"GaussianRFFKernelTransformer", | ||
] | ||
except ImportError as e: | ||
raise ImportError(_import_error_message) from e | ||
|
||
def ComposableQuantifier(loss, transformer, **kwargs): | ||
"""A generic quantification / unfolding method that solves a linear system of equations. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,7 +125,6 @@ def get_version(rel_path): | |
# projects. | ||
extras_require={ # Optional | ||
'bayes': ['jax', 'jaxlib', 'numpyro'], | ||
'composable': ['qunfold @ git+https://github.com/mirkobunse/[email protected]'], | ||
'neural': ['torch'], | ||
'tests': ['certifi'], | ||
'docs' : ['sphinx-rtd-theme', 'myst-parser'], | ||
|