How to make carpet plot using plotly?
MACHINE LEARNING RECIPES DATA CLEANING PYTHON DATA MUNGING PANDAS CHEATSHEET     ALL TAGS

# How to make carpet plot using plotly?

This recipe helps you make carpet plot using plotly

0

## Recipe Objective

How to make carpet plot using plotly. Carpet plot in which the interaction between 2 or more independent variables and 1 or more dependent variables is shown in the 2-Dimensional plot is done by carpet plot. For more interpolate data points the carpet plot is being used.

## Step 1 - Import library

``` import plotly.graph_objects as go ```

## Step 2 - Take Sample Data

``` a = [2,3,4,2,3,4] b = [6,7,8,6,7,8] y = [1,3,5,7,9,2] ```

## Step 3 - Plot the graph

``` fig = go.Figure(go.Carpet(a=a,b=b,y=y)) fig.show() ```

Here in the above figure: a & b are the array which will be containing values for the first parameter. y is the 2 dimensional array of the y coordinates at each carpet point. Carpet is an identifier for this carpet in which the scattercarpet and contourcarpet traces can specify a carpet plot on which they are lieing.

#### Relevant Projects

##### Walmart Sales Forecasting Data Science Project
Data Science Project in R-Predict the sales for each department using historical markdown data from the Walmart dataset containing data of 45 Walmart stores.

##### PySpark Tutorial - Learn to use Apache Spark with Python
PySpark Project-Get a handle on using Python with Spark through this hands-on data processing spark python tutorial.

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

##### Census Income Data Set Project - Predict Adult Census Income
Use the Adult Income dataset to predict whether income exceeds 50K yr based on census data.

##### Build an Image Classifier for Plant Species Identification
In this machine learning project, we will use binary leaf images and extracted features, including shape, margin, and texture to accurately identify plant species using different benchmark classification techniques.

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

##### Build a Music Recommendation Algorithm using KKBox's Dataset
Music Recommendation Project using Machine Learning - Use the KKBox dataset to predict the chances of a user listening to a song again after their very first noticeable listening event.

##### Data Science Project-TalkingData AdTracking Fraud Detection
Machine Learning Project in R-Detect fraudulent click traffic for mobile app ads using R data science programming language.

##### Ensemble Machine Learning Project - All State Insurance Claims Severity Prediction
In this ensemble machine learning project, we will predict what kind of claims an insurance company will get. This is implemented in python using ensemble machine learning algorithms.

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