一次可视化高维数据

问题描述 投票:-1回答:1

我正在尝试可视化我的数据,以便我可以逐个查看所有200列。我希望有一种更直观的方式来理解我的数据。

我试过谷歌,但在可视化高维数据方面没有得到任何帮助。人们说要使用PCA,但我想在列中可视化我的原始数据。

Data set Link

我的代码

x0=df[df["target"]==0]
x1=df[df["target"]==1]

x0_100=x0[1:300]
x1_100=x1[1:300]
x=x1_100.append(x0_100)
y=x["target"]
x=x.drop("target",axis=1)

import matplotlib.pyplot as plt
fig = plt.figure(figsize = (60, 60))
j = 0
for i in x:
    plt.subplot(51,4, j+1)
    j += 1
    sns.boxplot(x=y,y=x[i])

I am getting this type of small figures really difficult to understand

python matplotlib visualization seaborn
1个回答
1
投票

我建议绘制两个不同的箱形图,每个条形图上有一百列:

import numpy as np; np.random.seed(0)
import pandas as pd
import cufflinks as cf

df = cf.datagen.box(200)

df.iloc[:,0:100].plot(kind='box', rot=90, figsize=(14, 8))
plt.tight_layout()

df.iloc[:,100:].plot(kind='box', rot=90, figsize=(14, 8))
plt.tight_layout()

Box plot 1 Box plot 2

最新问题
© www.soinside.com 2019 - 2024. All rights reserved.