Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

A toolbox for preference learning implemented in Python.

Project description

PLT - Preference Learning Toolbox

A toolbox for preference learning implemented in Python.

Image

Preference learning (PL) is a core area of machine learning that handles datasets with ordinal relations. As the number of generated data of ordinal nature such as ranks and subjective ratings is increasing, the importance and role of the PL field becomes central within machine learning research and practice.

The Preference Learning Toolbox (PLT) is an open source software application and package which supports the key data modelling phases incorporating various popular data pre-processing, feature selection and preference learning methods.

Image

PLT may be used either via its GUI or its API. This README is based on the API which is made available via the Python package pyplt. For more information on the GUI or to download the GUI application, please visit the PLT website.

The API documentation may be found at: https://plt.readthedocs.io/.

Features:

  • Dataset Pre-processing (including automatic feature extraction)
  • Automatic Feature Selection (SFS)
  • Preference Learning Algorithms (RankSVM, ANN-Backpropagation, RankNet)
  • Experiment Reporting and Model Storage

Installation:

The Python package for PLT, pyplt, may be installed via pip:

pip install pyplt

Usage Example:

The following example loads a dataset in the single file format (refer to Detailed Guidelines for more information about file formats) and carries out preference learning using the RankSVM algorithm and K-Fold Cross Validation. At the end, the results are saved to file.

from pyplt.experiment import Experiment
from pyplt.plalgorithms.ranksvm import RankSVM
from pyplt.util.enums import KernelType
from pyplt.evaluation.cross_validation import KFoldCrossValidation
import time

exp = Experiment()

# load ratings data
exp.load_single_data("sample data sets\\single_synth.csv", has_ids=True, has_fnames=True)

# set up RankSVM algorithm
pl_algorithm = RankSVM(kernel=KernelType.RBF, gamma=1)
exp.set_pl_algorithm(pl_algorithm)

# set up K-Fold Cross Validation
pl_evaluator = KFoldCrossValidation(k=3)
exp.set_pl_evaluator(pl_evaluator)

# run the experiment
exp.run()

# save the results
t = time.time()
exp.save_exp_log(t, path="my_results.csv")

For more a more detailed usage guide, please check out the tutorial.

Development Setup

PLT has the following package dependencies:

  • keras
  • ttkthemes
  • numpy
  • matplotlib
  • pandas
  • tensorflow
  • scikit_learn
  • scipy

These depenencies may be easily istalled via pip:

pip install -r requirements.txt

Citing

The tool is free for scientific use. If you use PLT in your scientific work, please cite as:

Farrugia, Vincent E., Héctor P. Martínez, and Georgios N. Yannakakis. "The Preference Learning Toolbox." arXiv preprint arXiv:1506.01709 (2015)

License

PLT is licensed under the GNU General Public License v3.0. See LICENSE for more information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pyplt, version 0.2.3
Filename, size File type Python version Upload date Hashes
Filename, size pyplt-0.2.3-py3-none-any.whl (224.1 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size pyplt-0.2.3.tar.gz (245.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page