All Projects → jma127 → Pyltr

jma127 / Pyltr

Licence: bsd-3-clause
Python learning to rank (LTR) toolkit

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Pyltr

Ml Lib
An extensive machine learning library, made from scratch (Python).
Stars: ✭ 102 (-72.94%)
Mutual labels:  machine-learning-algorithms, machine-learning-library
Igel
a delightful machine learning tool that allows you to train, test, and use models without writing code
Stars: ✭ 2,956 (+684.08%)
Mutual labels:  machine-learning-algorithms, machine-learning-library
Machine Learning Concepts
Machine Learning Concepts with Concepts
Stars: ✭ 134 (-64.46%)
Mutual labels:  machine-learning-algorithms, machine-learning-library
Php Ml
PHP-ML - Machine Learning library for PHP
Stars: ✭ 7,900 (+1995.49%)
Mutual labels:  machine-learning-algorithms, machine-learning-library
pycobra
python library implementing ensemble methods for regression, classification and visualisation tools including Voronoi tesselations.
Stars: ✭ 111 (-70.56%)
Mutual labels:  machine-learning-algorithms, machine-learning-library
Modal
A modular active learning framework for Python
Stars: ✭ 1,148 (+204.51%)
Mutual labels:  machine-learning-algorithms, machine-learning-library
M2cgen
Transform ML models into a native code (Java, C, Python, Go, JavaScript, Visual Basic, C#, R, PowerShell, PHP, Dart, Haskell, Ruby, F#, Rust) with zero dependencies
Stars: ✭ 1,962 (+420.42%)
Mutual labels:  machine-learning-algorithms, machine-learning-library
Mlkit
A simple machine learning framework written in Swift 🤖
Stars: ✭ 144 (-61.8%)
Mutual labels:  machine-learning-algorithms, machine-learning-library
densratio py
A Python Package for Density Ratio Estimation
Stars: ✭ 112 (-70.29%)
Mutual labels:  machine-learning-algorithms, machine-learning-library
Pretty Print Confusion Matrix
Confusion Matrix in Python: plot a pretty confusion matrix (like Matlab) in python using seaborn and matplotlib
Stars: ✭ 244 (-35.28%)
Mutual labels:  machine-learning-algorithms, machine-learning-library
Jsat
Java Statistical Analysis Tool, a Java library for Machine Learning
Stars: ✭ 683 (+81.17%)
Mutual labels:  machine-learning-algorithms, machine-learning-library
mljar-examples
Examples how MLJAR can be used
Stars: ✭ 42 (-88.86%)
Mutual labels:  machine-learning-algorithms, machine-learning-library
Machinejs
[UNMAINTAINED] Automated machine learning- just give it a data file! Check out the production-ready version of this project at ClimbsRocks/auto_ml
Stars: ✭ 412 (+9.28%)
Mutual labels:  machine-learning-algorithms, machine-learning-library
Paramonte
ParaMonte: Plain Powerful Parallel Monte Carlo and MCMC Library for Python, MATLAB, Fortran, C++, C.
Stars: ✭ 88 (-76.66%)
Mutual labels:  machine-learning-algorithms, machine-learning-library
Suod
(MLSys' 21) An Acceleration System for Large-scare Unsupervised Heterogeneous Outlier Detection (Anomaly Detection)
Stars: ✭ 245 (-35.01%)
Mutual labels:  machine-learning-algorithms, machine-learning-library
greycat
GreyCat - Data Analytics, Temporal data, What-if, Live machine learning
Stars: ✭ 104 (-72.41%)
Mutual labels:  machine-learning-algorithms, machine-learning-library
spark-transformers
Spark-Transformers: Library for exporting Apache Spark MLLIB models to use them in any Java application with no other dependencies.
Stars: ✭ 39 (-89.66%)
Mutual labels:  machine-learning-algorithms, machine-learning-library
Tensorfow Rbm
Tensorflow implementation of Restricted Boltzmann Machine
Stars: ✭ 290 (-23.08%)
Mutual labels:  machine-learning-algorithms
Fbp
FBP项目全称FootBallPrediction,历经9个月完成的足球比赛预测项目。项目结合大数据+机器学习,不断摸索开发了一个程序。程序根据各大公司赔率多维度预测足球比赛结果(包含胜和不胜)。机器学习用的是自己建立的“三木板模型”算法,已在国家期刊发表论文并被万方数据库收录,详见_ML_文件。目前准确率可达80%。该项目在自己创建的微信群里已经吸引了很多人,附件为群讨论截图,并且每天均有部分人根据预测结果参考投注竞彩,参考的人都获得了相应的收益。 现在想通过认识更多的有识之士,一起探索如何将项目做大做强,找到合伙人,实现共赢。希望感兴趣的同仁联系本人,微信号acredjb。公众号AI金胆(或AI-FBP),每天都有程序预测的足球比赛。程序优势请看Advantages和README文件。程序3.0版本:(第三轮目前13中12) 8月10日:13让负(正确) 8月11日:27让负(正确) 8月12日:11让负(正确) 8月13日:6胜(不正确) 8月14日:25让负(正确) 8月15日:无预测 8月16日:1胜(正确) 8月17日:6让负(正确) 8月18日:16胜(正确) 8月19日:34让负(正确) ... 1.0版本(第一轮为11中9) 2.0版本(第二轮13中11).
Stars: ✭ 337 (-10.61%)
Mutual labels:  machine-learning-algorithms
Sherpa
Hyperparameter optimization that enables researchers to experiment, visualize, and scale quickly.
Stars: ✭ 289 (-23.34%)
Mutual labels:  machine-learning-library

pyltr

|pypi version| |Build status|

.. |pypi version| image:: https://img.shields.io/pypi/v/pyltr.svg :target: https://pypi.python.org/pypi/pyltr .. |Build status| image:: https://secure.travis-ci.org/jma127/pyltr.svg :target: http://travis-ci.org/jma127/pyltr

pyltr is a Python learning-to-rank toolkit with ranking models, evaluation metrics, data wrangling helpers, and more.

This software is licensed under the BSD 3-clause license (see LICENSE.txt).

The author may be contacted at ma127jerry <@t> gmail with general feedback, questions, or bug reports.

Example

Import pyltr::

import pyltr

Import a LETOR <http://research.microsoft.com/en-us/um/beijing/projects/letor/>_ dataset (e.g. MQ2007 <http://research.microsoft.com/en-us/um/beijing/projects/letor/LETOR4.0/Data/MQ2007.rar>_ )::

with open('train.txt') as trainfile, \
        open('vali.txt') as valifile, \
        open('test.txt') as evalfile:
    TX, Ty, Tqids, _ = pyltr.data.letor.read_dataset(trainfile)
    VX, Vy, Vqids, _ = pyltr.data.letor.read_dataset(valifile)
    EX, Ey, Eqids, _ = pyltr.data.letor.read_dataset(evalfile)

Train a LambdaMART <http://research.microsoft.com/pubs/132652/MSR-TR-2010-82.pdf>_ model, using validation set for early stopping and trimming::

metric = pyltr.metrics.NDCG(k=10)

# Only needed if you want to perform validation (early stopping & trimming)
monitor = pyltr.models.monitors.ValidationMonitor(
    VX, Vy, Vqids, metric=metric, stop_after=250)

model = pyltr.models.LambdaMART(
    metric=metric,
    n_estimators=1000,
    learning_rate=0.02,
    max_features=0.5,
    query_subsample=0.5,
    max_leaf_nodes=10,
    min_samples_leaf=64,
    verbose=1,
)

model.fit(TX, Ty, Tqids, monitor=monitor)

Evaluate model on test data::

Epred = model.predict(EX)
print 'Random ranking:', metric.calc_mean_random(Eqids, Ey)
print 'Our model:', metric.calc_mean(Eqids, Ey, Epred)

Features

Below are some of the features currently implemented in pyltr.

Models

  • LambdaMART (pyltr.models.LambdaMART)

    • Validation & early stopping

    • Query subsampling

Metrics

  • (N)DCG (pyltr.metrics.DCG, pyltr.metrics.NDCG)

    • pow2 and identity gain functions
  • ERR (pyltr.metrics.ERR)

    • pow2 and identity gain functions
  • (M)AP (pyltr.metrics.AP)

  • Kendall's Tau (pyltr.metrics.KendallTau)

  • AUC-ROC -- Area under the ROC curve (pyltr.metrics.AUCROC)

Data Wrangling

  • Data loaders (e.g. pyltr.data.letor.read)

  • Query groupers and validators (pyltr.util.group.check_qids, pyltr.util.group.get_groups)

Running Tests

Use the run_tests.sh script to run all unit tests.

Building Docs

cd into the docs/ directory and run make html. Docs are generated in the docs/_build directory.

Contributing

Quality contributions or bugfixes are gratefully accepted. When submitting a pull request, please update AUTHOR.txt so you can be recognized for your work :).

By submitting a Github pull request, you consent to have your submitted code released under the terms of the project's license (see LICENSE.txt).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].