-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from fau-klue/v0.3.1
v0.3.1
- Loading branch information
Showing
12 changed files
with
92 additions
and
62 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
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 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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
""" | ||
comparison of ranked lists | ||
""" | ||
|
||
|
||
# from rbo import RankingSimilarity | ||
|
||
|
||
# def compare_rbo(df1, df2, p): | ||
|
||
# return RankingSimilarity(df1.index, df2.index).rbo(p=p) | ||
|
||
|
||
# def compare_gwets_ac1(df1, df2): | ||
|
||
# pass |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
association_measures name abbreviation category | ||
O11 observed frequency obs. raw | ||
E11 expected frequency exp. raw | ||
ipm observed instances per million obs. (ipm) raw | ||
ipm_expected expected instances per million exp. (ipm) raw | ||
conservative_log_ratio Conservative Log Ratio LRC conservative estimates | ||
log_likelihood Log-Likelihood Ratio LLR asymptotic hypothesis tests | ||
z_score z-score z-score asymptotic hypothesis tests | ||
t_score t-score t-score asymptotic hypothesis tests | ||
simple_LL simple Log-Likelihood Ratio simple LLR asymptotic hypothesis tests | ||
dice Dice Dice point estimates of association strength | ||
log_ratio Log Ratio LR point estimates of association strength | ||
min_sensitivity Minimum Sensitivity MS point estimates of association strength | ||
liddel Liddell Liddell point estimates of association strength | ||
mutual_information Mutual Information MI information theory | ||
local_mutual_information Local Mutual Information LMI information theory | ||
hypergeometric_likelihood Hypergeometric Likelihood HL likelihood measures | ||
binomial_likelihood Binomial Likelihood BL likelihood measures |
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,18 +1,34 @@ | ||
.PHONY: performance test lint coverage build | ||
|
||
install: | ||
pipenv install --dev | ||
performance: | ||
pipenv run python3 performance.py | ||
test: | ||
pipenv run pytest -v | ||
python3 -m venv venv && \ | ||
. venv/bin/activate && \ | ||
pip3 install -U pip setuptools wheel && \ | ||
pip3 install -r requirements-dev.txt | ||
|
||
lint: | ||
pipenv run pylint --rcfile=.pylintrc association_measures/*.py | ||
. venv/bin/activate && \ | ||
pylint --rcfile=.pylintrc association_measures/*.py | ||
|
||
test: | ||
. venv/bin/activate && \ | ||
pytest -s -v | ||
|
||
performance: | ||
. venv/bin/activate && \ | ||
python3 performance.py | ||
|
||
coverage: | ||
pipenv run pytest --cov-report term-missing -v --cov=association_measures/ | ||
. venv/bin/activate && \ | ||
pytest --cov-report term-missing -v --cov=association_measures/ | ||
|
||
compile: | ||
pipenv run python3 setup.py build_ext --inplace | ||
. venv/bin/activate && \ | ||
python3 setup.py build_ext --inplace | ||
|
||
build: | ||
pipenv run python3 setup.py sdist | ||
. venv/bin/activate && \ | ||
python3 setup.py sdist | ||
|
||
clean: | ||
rm -rf *.egg-info build/ association_measures/*.so association_measures/*.c dist/ |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
-r requirements.txt | ||
pytest==7.4.0 | ||
pylint==2.17.5 | ||
pytest-cov==4.1.0 | ||
wheel==0.45.1 | ||
twine==6.1.0 | ||
setuptools==75.8.2 | ||
cython==3.0.12 |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
pandas>=2.2.2,<3.0 | ||
numpy>=2.0,<3.0 | ||
scipy>=1.13.0,<2.0 |
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 |
---|---|---|
|
@@ -11,11 +11,13 @@ | |
EMAIL = '[email protected]' | ||
AUTHOR = 'Philipp Heinrich & Markus Opolka' | ||
|
||
REQUIRES_PYTHON = '>=3.8' | ||
REQUIRES_PYTHON = '>=3.9' | ||
REQUIRED = [ | ||
'wheel', | ||
'pandas', | ||
'scipy' | ||
'pandas>=2.2.2,<3.0', | ||
'numpy>=2.0,<3.0', | ||
'scipy>=1.13.0,<2.0', | ||
# 'rbo>=0.1.3,<0.2' | ||
] | ||
|
||
here = os.path.abspath(os.path.dirname(__file__)) | ||
|
@@ -97,11 +99,11 @@ def run(self): | |
'License :: OSI Approved :: MIT License', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 3', | ||
'Programming Language :: Python :: 3.8', | ||
'Programming Language :: Python :: 3.9', | ||
'Programming Language :: Python :: 3.10', | ||
'Programming Language :: Python :: 3.11', | ||
'Programming Language :: Python :: 3.12', | ||
'Programming Language :: Python :: 3.13', | ||
'Programming Language :: Cython', | ||
], | ||
) |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import association_measures.measures as am | ||
from pandas import DataFrame | ||
|
||
|
||
def test_nas(): | ||
|
||
d = DataFrame(data={'O11': 0, 'O12': 10, 'O21': 10, 'O22': 100}, index=['test']) | ||
scores = am.score(d) | ||
print(scores[['mutual_information', 'local_mutual_information']]) | ||
|
||
d = DataFrame(data={'O11': 0, 'O12': 10, 'O21': 0, 'O22': 100}, index=['test']) | ||
scores = am.score(d) | ||
print(scores[['ipm', 'ipm_expected']]) |