Open In App

How to Install xgboost for Python on Linux?

Last Updated : 14 Feb, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

XGBoost library in Python is used for supervised learning problems, where we use the training data (with multiple features) to predict a target variable. Or we can say that it is a distributed gradient boosting library which is highly efficient, flexible, and portable. It provides a parallel tree boosting that is used to solve different types of data science-related problems very efficiently. It can also implement machine learning algorithms. XGBoost package is also available in PyPI (Python Package Index). It can load data from different formats like NumPy 2D array, SciPy 2D sparse array, Pandas data frame, datatable, cupy 2D array, etc. So in this article, we will be installing the XGBoost package in Python through Pip on Linux Operating System.

Installing xgboost package on Linux using PIP

Requirements:

  1. Python3
  2. Python3-pip

To install the xgboost package in Linux we have to follow the following steps:

Step 1: Install the latest version of Python3 on Linux Machine using the following command in the terminal:

sudo apt-get install python3

Installing-Python3

Step 2: Now, install the pip module which is required to install and manage all the packages of Python3 with the help of the following command:

sudo apt install python3-pip

Installing-the-pip-module

Step 3: Now, install the xgboost package by using the following command:

sudo pip3 install xgboost

Installing-the-xgboost-package

Verifying xgboost package installation on Linux using PIP

To verify if the xgboost package has been successfully installed in your system run the below command in Terminal:

python3 -m pip show xgboost

You’ll get the following output if the installation is completed successfully in your system.

Verifying-xgboost-package-installation


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads