Data Science 365

Bring data into actionable insights.

Member-only story

Yellowbrick for Visualizing Features’ Importances Using a Single Line of Code

Select the best features with the most predictive power

Rukshan Pramoditha
Data Science 365
Published in
5 min readMay 6, 2022

--

Image by PublicDomainPictures from Pixabay

When creating machine learning models, visualizing features' importances is really important because not all features contribute the same to the model. Some features are less important to the model so we can remove those features from the model. This will also reduce the complexity of the model and remove the unnecessary noise generated from less-important features.

We need to plot feature importance scores for each feature on a horizontal bar chart. The Y-axis contains the names of the features and the X-axis contains the feature importance scores. To create such a plot, we need to write more codes. That is a tedious task. To create the same plot with a single line of code, we can use the Yellowbrick FeatureImportances visualizer!

Installing Yellowbrick

Yellowbrick is a Python 3 library. The easiest way to install it is from the Python pip package installer.

pip install yellowbrick

If you’re using Google Colab notebooks, just run the above command to install Yellowbrick.

If you’re using Anaconda, you can install Yellowbrick through the conda utility by…

--

--

Rukshan Pramoditha
Rukshan Pramoditha

Written by Rukshan Pramoditha

3,000,000+ Views | BSc in Stats (University of Colombo, Sri Lanka) | Top 50 Data Science, AI/ML Technical Writer on Medium

Responses (1)