What is factor plot and how make a factor plot using seaborn?
MACHINE LEARNING RECIPES DATA CLEANING PYTHON DATA MUNGING PANDAS CHEATSHEET     ALL TAGS

What is factor plot and how make a factor plot using seaborn?

What is factor plot and how make a factor plot using seaborn?

This recipe explains what is factor plot and how make a factor plot using seaborn

0

Recipe Objective

what is factor plot? Make a factor plot using seaborn.

Factor plot these plots are used for plotting various types of categorical plot. By default it gives the output of point plot, but by using the kind parameter we can plot other categorical plot.

Step 1 - Import the necessary library

import seaborn as sns import matplotlib.pyplot as plt

Step 2 - load the dataset

titanic_data = sns.load_dataset('titanic') titanic_data.head()

Step 3 - Plot the graph

sns.factorplot(x ='survived', y ='age', data = titanic_data) sns.factorplot(x ='survived', y ='fare', data = titanic_data) plt.show() sns.factorplot(x ='pclass', y ='age', data = titanic_data, kind='violin') plt.show() sns.factorplot(x ='pclass', y ='age', data = titanic_data, kind='bar') plt.show()

Here from the above figures: x - denotes which variable to be plot on x-axis y - denotes which variable to be plot on y-axis data - denotes the Sample data name that we have taken. kind - denotes which type of graph we want for plotting for e.g bar, scatter, violin etc.

Relevant Projects

Choosing the right Time Series Forecasting Methods
There are different time series forecasting methods to forecast stock price, demand etc. In this machine learning project, you will learn to determine which forecasting method to be used when and how to apply with time series forecasting example.

Data Science Project on Wine Quality Prediction in R
In this R data science project, we will explore wine dataset to assess red wine quality. The objective of this data science project is to explore which chemical properties will influence the quality of red wines.

Predict Churn for a Telecom company using Logistic Regression
Machine Learning Project in R- Predict the customer churn of telecom sector and find out the key drivers that lead to churn. Learn how the logistic regression model using R can be used to identify the customer churn in telecom dataset.

Machine Learning or Predictive Models in IoT - Energy Prediction Use Case
In this machine learning and IoT project, we are going to test out the experimental data using various predictive models and train the models and break the energy usage.

Natural language processing Chatbot application using NLTK for text classification
In this NLP AI application, we build the core conversational engine for a chatbot. We use the popular NLTK text classification library to achieve this.

Time Series Forecasting with LSTM Neural Network Python
Deep Learning Project- Learn to apply deep learning paradigm to forecast univariate time series data.

Human Activity Recognition Using Smartphones Data Set
In this deep learning project, you will build a classification system where to precisely identify human fitness activities.

Learn to prepare data for your next machine learning project
Text data requires special preparation before you can start using it for any machine learning project.In this ML project, you will learn about applying Machine Learning models to create classifiers and learn how to make sense of textual data.

Resume parsing with Machine learning - NLP with Python OCR and Spacy
In this machine learning resume parser example we use the popular Spacy NLP python library for OCR and text classification.

Predict Macro Economic Trends using Kaggle Financial Dataset
In this machine learning project, you will uncover the predictive value in an uncertain world by using various artificial intelligence, machine learning, advanced regression and feature transformation techniques.