机器学习笔记 seaborn笔记

import seaborn as sns
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import pandas as pd
import warnings
warnings.filterwarnings("ignore")

sns.set(color_codes = True)
np.random.seed(sum(map(ord,"distributions")))
tips = sns.load_dataset("tips")
#iris = sns.load_dataset("iris")
titanic = sns.load_dataset("titanic")
sns.stripplot(x = "day", y = "total_bill",data = tips,jitter=True) #jitter=True 对点进行偏移 避免重叠
<matplotlib.axes._subplots.AxesSubplot at 0x2cec641e780>

在这里插入图片描述

sns.swarmplot(x = "day", y = "total_bill",data = tips,hue = "sex") 
<matplotlib.axes._subplots.AxesSubplot at 0x2cec7867c50>

在这里插入图片描述

sns.boxplot(x = "day",y = "total_bill" , hue = "time", data = tips) #盒图 看离群点
<matplotlib.axes._subplots.AxesSubplot at 0x2cec78c9dd8>

在这里插入图片描述

sns.barplot(x = "sex",y = "survived",hue = "class",data = titanic)
<matplotlib.axes._subplots.AxesSubplot at 0x2cec79917f0>

在这里插入图片描述

sns.pointplot(x = "sex",y = "survived",hue = "class",data = titanic) #点图
<matplotlib.axes._subplots.AxesSubplot at 0x2cec79f4b00>

在这里插入图片描述

sns.factorplot(x = "day",y = "total_bill", hue = "smoker",data = tips)
<seaborn.axisgrid.FacetGrid at 0x2cec7aa9b00>

在这里插入图片描述

    sns.factorplot(x = "day",y = "total_bill", hue = "smoker",
                   col = "time",data = tips,kind = "swarm") #swarm树图
<seaborn.axisgrid.FacetGrid at 0x2cec7984cc0>

在这里插入图片描述

seaborn.factorplot(x=None, y=None, hue=None, data=None, row=None, col=None, col_wrap=None, estimator=, ci=95, n_boot=1000, units=None, order=None, hue_order=None, row_order=None, col_order=None, kind=‘point’, size=4, aspect=1, orient=None, color=None, palette=None, legend=True, legend_out=True, sharex=True, sharey=True, margin_titles=False, facet_kws=None, **kwargs)

Parameters:

  • x,y,hue 数据集变量 变量名
  • date 数据集 数据集名
  • row,col 更多分类变量进行平铺显示 变量名
  • col_wrap 每行的最高平铺数 整数
  • estimator 在每个分类中进行矢量到标量的映射 矢量
  • ci 置信区间 浮点数或None
  • n_boot 计算置信区间时使用的引导迭代次数 整数
  • units 采样单元的标识符,用于执行多级引导和重复测量设计 数据变量或向量数据
  • order, hue_order 对应排序列表 字符串列表
  • row_order, col_order 对应排序列表 字符串列表
    +kind : 可选:point 默认, bar 柱形图, count 频次, box 箱体, violin 提琴, strip 散点,swarm 分散点 size 每个面的高度(英寸) 标量 aspect 纵横比 标量 orient 方向 “v”/“h” color 颜色 matplotlib颜色 palette 调色板 seaborn颜色色板或字典 legend hue的信息面板 True/False legend_out 是否扩展图形,并将信息框绘制在中心右边 True/False share{x,y} 共享轴线 True/False
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值