Giter Site home page Giter Site logo

representation-based-multilabel-learning's Introduction

Representation-based-Multilabel-Learning

This project provides representation-based learning methods for multi-label classification, even the number of labels is extremely large, include:

  • Web Scale Annotation by Image Embedding (WSABIE)

    Weston, Jason, Samy Bengio, and Nicolas Usunier. "Wsabie: Scaling up to large vocabulary image annotation." IJCAI. Vol. 11. 2011.

  • Low rank Empirical risk minimization for Multi-Label Learning (LEML)

    Yu, Hsiang-Fu, et al. "Large-scale multi-label learning with missing labels." arXiv preprint arXiv:1307.5101 (2013).

  • Representation-based Multi-label Learning with Sampling (RMLS)

    Li et al. "Towards Label Imbalance in Multi-label Classification with Many Labels" arXiv preprint arXiv:1604.01304 (2016).

Data Format

The first line of the training data file is "#num_feature={$1} num_label={$2}", where $1 denotes the number of features and $2 denotes the number of labels. For example, if we have 20 features and 6 labels, the first line shall be "#num_feature=20 num_label=6".

The following lines denote training data. Each line denotes an instance. '1,2 1:4.5 2:3' denotes an instance with the 2-th and 3-th label. The weight of the 1-th feature is 4.5 and the weight of the 2-th feature is 3. The index of feature and label starts with zero.

Here is an example:

#num_feature=20 num_label=6
1,2 1:4.5 2:3
2,4 19:1 2:5
1,5 10:2 8:1

Train, Predict and Eval

1.1 Train

You can use train_wsabie.py and train_leml.py to train a model for a multi-label classification with many labels problem. Usage:

Usage: python train_wsabie.py(or train_leml.py) [options] train_file model_file

If you don't know how to set up the options, you just need "python train_wsabie.py" and the program will give detailed information.

1.2 Predict

You can use predict.py to make predictions with a trained model.

Usage: python predict.py test_file result_file model_file

1.3 Eval

You can use eval.py to evaluate the predictions

Usage: python eval.py result_file true_file

Requirements

Now I only test the code with Python2.7 and I will test it with Python3 as soon as possible.

To run this code, you should installed the following modules:

- numpy
- scipy

Contributors

representation-based-multilabel-learning's People

Contributors

algorithmdog avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  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.