Giter Site home page Giter Site logo

ranklib-gini's Introduction

RankLib-Gini

Gini feature importance for RankLib random forest:

Ranklib provides a feature manager that generates feature use statistics. This only provides the frequency of each feature used in the learning to rank model to identify which feature contributes more in the model. The importance or efficacy of the feature, however, might not be correlated with its frequency.

Gini importance of a feature is, on the other hand, more commonly used and accepted in learning to rank researches as the criterion of the most affective features.

How to Use

Run

You will need python3 to run this code. The model used in this code is created by ranklib-2.1 or higher versions.

You can run the code in terminal by putting the inputs in the same order as below:

python Gini.py <num_features> <path_to\training_data> <path_to\RF_model> <trees directory> <output_file>

An example with the dataset and model provided in this repository:

python Gini.py 67 train_data.txt model.txt trees gini.txt

This program is also tested on MQ2008 from the LETOR 4.0 dataset.

Input Description

  • num_features: The number of features exist in your training data. Note that this is not necessarily equal to the number of features used in the model.

  • training data: The training data used for the ranklib model.

  • RF model: The model created by ranklib.

  • trees directory: The directory that you want to save your trees. You may need an empty directory as usually many trees will be created.

  • output file: A .txt file to save the results of the gini importance.

Sponsor

Laboratory for Systems, Software and Semantics (LS3), Toronto Metropolitan University, ON, Canada

ranklib-gini's People

Contributors

sorooshsorkhani avatar

Stargazers

 avatar  avatar  avatar

Watchers

 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.