lmplot
- 02:07
How to use Seaborne's Implot function for visualizing relationships.
For the full list of .lmplot( ) parameters, visit the following link: https://seaborn.pydata.org/generated/seaborn.lmplot.html
Downloads
No associated resources to download.
Glossary
Implot Machine Learning PythonTranscript
Because both of these new features are continuous variables with numeric values. Instead of categorical variables like tier change, you won't analyze relationships with the value counts function. Instead, you'll use seaborn's lmplot function, which allows you to create a color coded scatterplot. This is a useful tool for analyzing the impact of a continuous input feature on a categorical target variable like commit or decline. As a tip, the lmplot function accepts many different optional arguments that allow you to customize your chart. You're only going to use a few in this example X, which defines the X axis variable, Y which defines the Y axis variable, hue which defines the categorical variable used for color coding, data which defines the dataset and fit reg which indicates whether or not to add a simple linear regression line. For the full list of lmplot parameters, you can visit the link here.
Let's try plotting total fees on the x axis and fee percent on the Y axis. That'll give us a sense for the total amount of investment banking fees paid out by each issuer, as well as the share of those fees captured by the investor. Here we're using the seaborn lmplot function with the X argument set to total fees, the Y argument fee percent, the hue, which tells us how to change the color using the commit categorical variable, which is our target variable. The data is coming from our investor data and then we are not fitting a regression line. You can see that the orange decline observations are nested inside the blue commit observations. It looks like investors that are getting more than 30% of the fees never decline, and it also looks like investors rarely decline transactions where total fees exceed about 200 million. That's useful information for our machine learning algorithm. Investors are more likely to commit to transactions for big fee payers where they collect a large percentage of total fees. Intuitively, that makes sense.