forked from moreo/QuaPy
Alejandro Moreo Fernandez 3aaf57f2f3 | ||
---|---|---|
NewMethods | ||
TweetSentQuant | ||
quapy | ||
.gitignore | ||
LICENSE | ||
README.md | ||
TODO.txt | ||
plot_example.py | ||
prepare_svmperf.sh | ||
svm-perf-quantification-ext.patch | ||
test.py |
README.md
QuaPy
QuaPy is an open source framework for Quantification (a.k.a. Supervised Prevalence Estimation) written in Python.
QuaPy roots on the concept of data sample, and provides implementations of most important concepts in quantification literature, such as the most important quantification baselines, many advanced quantification methods, quantification-oriented model selection, many evaluation measures and protocols used for evaluating quantification methods. QuaPy also integrates commonly used datasets and offers visualization tools for facilitating the analysis and interpretation of results.
import quapy as qp
from sklearn.linear_model import LogisticRegression
= qp.datasets.fetch_twitter('semeval16')
dataset
# create an "Adjusted Classify & Count" quantifier
= qp.method.aggregative.ACC(LogisticRegression())
model
model.fit(dataset.training)
= model.quantify(dataset.test.instances)
prevalences_estim = dataset.test.prevalence()
prevalences_true
= qp.error.mae(prevalences_true, prevalences_estim)
error
print(f'MAE={error:.3f}')
binary, and single-label