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

Kursinhalt

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.

Aufgabe

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

Lösung

Mark tasks as Completed
Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 1. Kapitel 3
AVAILABLE TO ULTIMATE ONLY
We're sorry to hear that something went wrong. What happened?
some-alt