Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Leer Exploratory Data Analysis | Logistic Regression Mastering
Logistic Regression Mastering
course content

Cursusinhoud

Logistic Regression Mastering

book
Exploratory Data Analysis

In this chapter, we will explore some of our data's features. Specifically, we will see how the target variable is distributed in the following variables: "gender", "relevent_experience", "enrolled_university", "education_level", "major_discipline", "experience", "company_size", "company_type".

Methods description

  • import matplotlib.pyplot as plt: Imports the pyplot module from the matplotlib library and assigns it an alias plt. pyplot provides a MATLAB-like interface for creating plots and visualizations in Python;

  • import seaborn as sns: Imports the seaborn library and assigns it an alias sns. Seaborn is a Python visualization library based on matplotlib that provides a high-level interface for drawing attractive statistical graphics;

  • plt.figure(figsize=[15, 18]): Creates a new figure object with a specified figure size of 15 inches in width and 18 inches in height;

  • features = [...]: Defines a list of feature names;

  • plt.subplot(5, 2, n): Divides the figure into a grid of 5 rows and 2 columns, then selects the subplot at position n;

  • sns.countplot(...): Generates a count plot for the specified feature (x=f) with counts separated by the hue variable (here, "target"), using data from the data DataFrame;

  • plt.title(...): Sets the title for the subplot with the name of the feature;

  • plt.tight_layout(): Adjusts the subplot layout to make sure the plot elements fit within the figure area properly;

  • plt.show(): Displays the plot.

Taak

Swipe to start coding

  1. Import matplotlib and seaborn (as sns) libraries.

  2. Plot the following features: "gender", "relevent_experience", "enrolled_university", "education_level", "major_discipline", "experience", "company_size", "company_type".

Oplossing

Mark tasks as Completed
Switch to desktopSchakel over naar desktop voor praktijkervaringGa verder vanaf waar je bent met een van de onderstaande opties
Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 1. Hoofdstuk 3
AVAILABLE TO ULTIMATE ONLY
Onze excuses dat er iets mis is gegaan. Wat is er gebeurd?
some-alt