Coder Social home page Coder Social logo

xgboost.jl's Introduction

XGBoost.jl

Build Status Latest Version Pkg Eval Dependents

eXtreme Gradient Boosting in Julia

Abstract

This package is a Julia interface of XGBoost. It is an efficient and scalable implementation of distributed gradient boosting framework. The package includes efficient linear model solver and tree learning algorithms. The library is parallelized using OpenMP, and it can be more than 10 times faster than some existing gradient boosting packages. It supports various objective functions, including regression, classification and ranking. The package is also made to be extensible, so that users are also allowed to define their own objectives easily.

Features

  • Sparse feature format, it allows easy handling of missing values, and improve computation efficiency.
  • Advanced features, such as customized loss function, cross validation, see demo folder for walkthrough examples.

Installation

] add XGBoost

or

] develop "https://github.com/dmlc/XGBoost.jl.git"
] build XGBoost

By default, the package installs prebuilt binaries for XGBoost v0.82.0 on Linux, MacOS and Windows. Only the linux version is built with OpenMP.

Minimal examples

To show how XGBoost works, here is an example of dataset Mushroom

  • Prepare Data

XGBoost support Julia Array, SparseMatrixCSC, libSVM format text and XGBoost binary file as input. Here is an example of Mushroom classification. This example will use the function readlibsvm in basic_walkthrough.jl. This function load libsvm format text into Julia dense matrix.

using XGBoost

train_X, train_Y = readlibsvm("data/agaricus.txt.train", (6513, 126))
test_X, test_Y = readlibsvm("data/agaricus.txt.test", (1611, 126))
  • Fit Model
num_round = 2
bst = xgboost(train_X, num_round, label = train_Y, eta = 1, max_depth = 2)

Predict

pred = predict(bst, test_X)
print("test-error=", sum((pred .> 0.5) .!= test_Y) / float(size(pred)[1]), "\n")

Cross-Validation

nfold = 5
param = ["max_depth" => 2,
         "eta" => 1,
         "objective" => "binary:logistic"]
metrics = ["auc"]
nfold_cv(train_X, num_round, nfold, label = train_Y, param = param, metrics = metrics)

Feature Walkthrough

Check demo

Model Parameter Setting

Check XGBoost Documentation

xgboost.jl's People

Contributors

a-lost-wapiti avatar ablaom avatar allardvm avatar andreasnoack avatar antinucleon avatar aviks avatar deepaksuresh avatar fionnan avatar freeboson avatar iblislin avatar jackdunnnz avatar jumutc avatar khosravipasha avatar maximsch2 avatar simonschoelly avatar slundberg avatar staticfloat avatar tanmaykm avatar tqchen avatar tylerjthomas9 avatar zhmz90 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.