XGBoost is a big part of our Machine Learning and Predictive Analytics toolkit here at PicNet. We use it almost heavily for our proof of concept and prototype work and it is always present in ensembles for production systems. We usually host our python models on a Linux server and communicate with other back-end systems using RabbitMQ. However, this architecture is very often too big and cumbersome for simple systems and given the fact that .Net and Python integration is terrible we decided to build our own .Net wrappers to XGBoost.

Note: Currently this package only supports x64 bit applications.

I will be writing a tutorial soon to show how to use this but in the meantime this short set of instructions should be enough to get you going.

Create a .Net project

Install the package from NuGet by opening the NuGet Package Manager Console and use the following command:

Install-Package PicNet. XGBoost

Use it in your class:

Add the using statement: using XGBoost;

Create either a XGBClassifier or XGBRegressor

Train using the Fit method which takes two parameters:

Training data, which is a 2D float array (n_rows & n_columns)

Training labels which is a float array (n_rows)

Predict using:

Predict: For regression and classification

PredictProba: Probabilities for classification

The train and predict (Fit / Predict / Predict Proba) methods are heavily inspired by the sklearn API. So please read this to get a better idea of how these work.

The following code is an example of using this package in a Unit Test:

Related

Do you have a moment to write a review?

If you enjoy working with us, please take a few minutes to leave a review on our Google Business Page. Your feedback will help us to improve and get the word out to other businesses that may benefit from our services.

About the Author

Guido Tapia

Over the last 5 years Guido has been involved in building three predictive analytics and deep learning libraries for both the .Net platform and the Python language. These libraries and Guido’s machine learning experience have placed PicNet at the forefront of predictive analytics services in Australia.

For the last 13 years Guido has been the Software and Data Manager at PicNet and in that time Guido has delivered hundreds of successful software and data projects. An experience architect and all round ‘technologist’ Guido has been responsible for giving PicNet its ‘quality software provider’ reputation.

Prior to PicNet, Guido was in the gaming space working on advanced graphics engines, sound (digital signal processing) engines, AI players and other great technologies.