GithubHelp home page GithubHelp logo

parkjunghoons2 / pu-learning Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cimeister/pu-learning

0.0 0.0 0.0 22 KB

Pytorch implementation of risk estimators for unbiased and non-negative positive-unlabeled learning

License: GNU General Public License v3.0

Python 100.00%

pu-learning's Introduction

Pytorch implementation of non-negative PU learning and unbiased PU learning

This is a reproducing code for non-negative PU learning [1] and unbiased PU learning [2] in the paper "Positive-Unlabeled Learning with Non-Negative Risk Estimator".

  • loss.py has a pytorch implementation of the risk estimator for non-negative PU (nnPU) learning and unbiased PU (uPU) learning.

  • run_classifier.py is an example code of nnPU learning and uPU learning. Dataset is MNIST [3] preprocessed in such a way that even digits form the P class and odd digits form the N class. The default setting is 1000 P data and 59000 U data of MNIST, and the class prior is the ratio of P class data in U data.

  • Currently, the non-negative risk estimator is not thoroughly tested.

Requirements

  • Python 3
  • Torch >=1.0.1
  • If using GPU, Cuda >=10.0

Quick start

You can run an example code of MNIST for comparing the performance of nnPU learning and uPU learning on GPU.

python run_classifier.py --data_dir=. --output_dir=model_file --do_train

You can see additional options by adding --help.

Example result

Reference

[1] Ryuichi Kiryo, Gang Niu, Marthinus Christoffel du Plessis, and Masashi Sugiyama. "Positive-Unlabeled Learning with Non-Negative Risk Estimator." Advances in neural information processing systems. 2017.

[2] Marthinus Christoffel du Plessis, Gang Niu, and Masashi Sugiyama. "Convex formulation for learning from positive and unlabeled data." Proceedings of The 32nd International Conference on Machine Learning. 2015.

[3] LeCun, Yann. "The MNIST database of handwritten digits." http://yann.lecun.com/exdb/mnist/ (1998).

pu-learning's People

Contributors

cimeister avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.