Context-sensitive ranking and choice
Project description
NOTE
This library has recently been migrated from tensorflow to PyTorch. The 2.0 version marks a breaking change. Some of the previous functionality is now unavailable and some classes behave differently. You can use the latest 1.x release if you are looking for the tensorflow based estimators.
CS-Rank
CS-Rank is a Python package for context-sensitive ranking and choice algorithms.
We implement the following new object ranking/choice architectures:
FATE (First aggregate then evaluate)
FETA (First evaluate then aggregate)
In addition, we also implement these algorithms for choice functions:
RankNetChoiceFunction
GeneralizedLinearModel
PairwiseSVMChoiceFunction
These are the state-of-the-art approaches implemented for the discrete choice setting:
GeneralizedNestedLogitModel
MixedLogitModel
NestedLogitModel
PairedCombinatorialLogit
RankNetDiscreteChoiceFunction
PairwiseSVMDiscreteChoiceFunction
Getting started
As a simple “Hello World!”-example we will try to learn the Pareto problem:
import csrank as cs
from csrank import ChoiceDatasetGenerator
gen = ChoiceDatasetGenerator(dataset_type='pareto',
n_objects=30,
n_features=2)
X_train, Y_train, X_test, Y_test = gen.get_single_train_test_split()
All our learning algorithms are implemented using the scikit-learn estimator API. Fitting our FATENet architecture is as simple as calling the fit method:
fate = cs.FATEChoiceFunction()
fate.fit(X_train, Y_train)
Predictions can then be obtained using:
fate.predict(X_test)
Installation
The latest release version of CS-Rank can be installed from Github as follows:
pip install git+https://github.com/kiudee/cs-ranking.git
Another option is to clone the repository and install CS-Rank using:
python setup.py install
Dependencies
CS-Rank depends on PyTorch, skorch, NumPy, SciPy, matplotlib, scikit-learn, joblib and tqdm. For data processing and generation you will also need PyGMO, H5Py and pandas.
Citing CS-Rank
You can cite our arXiv papers:
@article{csrank2019, author = {Karlson Pfannschmidt and Pritha Gupta and Eyke H{\"{u}}llermeier}, title = {Learning Choice Functions: Concepts and Architectures }, journal = {CoRR}, volume = {abs/1901.10860}, year = {2019} } @article{csrank2018, author = {Karlson Pfannschmidt and Pritha Gupta and Eyke H{\"{u}}llermeier}, title = {Deep architectures for learning context-dependent ranking functions}, journal = {CoRR}, volume = {abs/1803.05796}, year = {2018} }
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for csrank-2.0.0rc2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 632f5cb76440e46e6dacfc6b9e9498550abcfc3aef795e2137d128624006595c |
|
MD5 | bf1b93436de6afe86c0f0c0296a02ad3 |
|
BLAKE2b-256 | 07d9e3059f3254652ec0e00c1964e0763a009dae221b6049489f18a0ba99af43 |