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

Зміст курсу

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.

Завдання
test

Swipe to show code editor

  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".

Mark tasks as Completed
Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 1. Розділ 3
We're sorry to hear that something went wrong. What happened?
some-alt