Giter Site home page Giter Site logo

xgbrankertopmml's Introduction

XGBRanker2PMML

The existing sklearn2pmml library (https://github.com/jpmml/sklearn2pmml) does not support XGBRanker. The goal is to slightly modify sklearn2pmml library (with minimum efforts), to get around it and support converting XGBRanker model pipeline to pmml. It supports objective='rank:pairwise' and objective='rank:ndcg'.

How to convert a XGBRanker to pmml:

  • pip install sklearn2pmml==0.46.0
  • Replace jpmml-xgboost-1.3-SNAPSHOT.jar in site-packages/sklearn2pmml/resources
  • model training
gbm = XGBRegressor(learning_rate=0.1)
gbm_dummy = XGBRanker(learning_rate=0.1, objective='rank:ndcg')
gbm_dummy.fit(x, y, group)
gbm._Booster = gbm_dummy._Booster
pipeline = Pipeline([
 ("predictor", gbm), 
])
pmmlpipeline = make_pmml_pipeline(pipeline, target_fields=['score']) 
sklearn2pmml(pmmlpipeline, "Model.xml")

Update (2019/07/10): I shared what I did in this issue jpmml/jpmml-sklearn#105, and the author decided to support XGBRanker officially.

xgbrankertopmml's People

Contributors

liyinxiao avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

useric

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.