python并行运算库

HiPlot is Facebook’s Python library to support visualization of high-dimensional data table, released this January. It is particularly well known for its sophisticated interactive parallel plot.

HiPlot是Facebook的Python库,用于支持高维数据表的可视化,该库于今年1月发布。 它以其复杂的交互式并行绘图而闻名。

Before anything, take a look at their compelling demo video. This explains how high its interactivity is, which we would appreciate when we do EDA.

在开始之前,请看一下他们引人注目的演示视频 。 这解释了它的交互性有多高,在进行EDA时我们将不胜感激。

, and play around their demo app with sample data here. Do not forget to select the range on axis and hold-and-move to check the interactivity.

,并在此处使用示例数据试用他们的演示应用程序。 不要忘记选择轴上的范围并按住不放以检查交互性。

HiPlot is not just good looking, but also has following four appreciated characteristics:

HiPlot不仅外观漂亮,而​​且还具有以下四个令人赞赏的特征:

  • Very easy to implement

    非常容易实现

Implementing the parallel plot using their hiplot module is literally by one line and almost a no-brainer.

实际上,使用他们的hiplot模块实现并行绘图只需一行,几乎可以轻松完成

  • Highly interactive

    高度互动

As you can see in the demo video above, the plot is highly interactive. Giving some mouse clicks lets you deep dive to any subset of data.

正如您在上面的演示视频中看到的那样,该情节具有高度的交互性。 只需单击一下鼠标,您就可以深入探究任何数据子集。

  • Run fast

    快跑

Despite its appearance, the runtime to visualize the large dataset as a parallel plot is short. Let’s see this later.

尽管有它的外观,但以并行绘图的形式可视化大型数据集的运行时间很短。 让我们稍后再看。

  • Native HTML rendering function

    本机HTML呈现功能

They prepared a native function to turn the parallel plot to HTML code (hooray!!) Produced HTML page can be downloaded as .html file or deployed from Flask with almost no additional rendering effort. I tried to run it on heroku through Flask in the exercise below.

他们准备了一个本机函数,可以将并行绘图转换为HTML代码(万岁!)。生成HTML页面可以作为.html文件下载,也可以从Flask进行部署,而几乎无需进行其他渲染。 我在下面的练习中尝试通过Flask在Heroku上运行它。

Thanks to these benefits, I believe HiPlot is one of first-choice tool sets for EDA in data analysis project before jumping in other time-consuming visualizations.

由于这些好处,我相信HiPlot是数据分析项目中EDA的首选工具集之一,然后再跳入其他耗时的可视化过程。

Let’s take a look at each of the benefits one by one.

让我们一一看一下每个好处。

Iris数据入门 (Getting Started with Iris Data)

Let’s see how easy it is to get you started with HiPlot using the famous iris data set.

让我们看看使用著名的虹膜数据集开始使用HiPlot是多么容易。

Image for post
https://archive.ics.uci.edu/ml/datasets/iris)https://archive.ics.uci.edu/ml/datasets/iris )

Installation of HiPlot is just as easy as ordinary modules. Just use pip:

HiPlot的安装与普通模块一样容易。 只需使用pip:

pip install -U hiplot

To use external csv file, you even do not have to use Pandas DataFrame. They prepared a native method to run parallel plot directly from csv file as such Experiment.from_csv(). When you need to use DataFrame, use Experiment.from_dataframe() instead. And it is totally fine to use Jupyter Notebook.

要使用外部csv文件,您甚至不必使用Pandas DataFrame。 他们准备了一种本地方法,可以直接从csv文件运行平行绘图,例如Experiment.from_csv() 。 当您需要使用DataFrame时,请改用Experiment.from_dataframe() 。 并且使用Jupyter Notebook完全可以。

import hiplot as hipiris_hiplot = hip.Experiment.from_csv('iris.csv')iris_hiplot.display()

And here’s what you will see:

这是您将看到的:

Image for post
Iris data HiPlot
虹膜数据HiPlot

HiPlot具有高度的交互性 (HiPlot is Highly Interactivity)

You are going to love HiPlot once you start playing around.

一旦开始玩耍,您就会爱上HiPlot。

As you already saw in the demo movie above, here are some examples of the uses of interactive chart.

正如您在上面的演示影片中已经看到的那样,下面是一些使用交互式图表的示例。

Image for post
Gray rectangles are where I selected the range in each variable. We can also move the range by hold-and-move.
灰色矩形是我在每个变量中选择范围的地方。 我们也可以按住并移动范围。
Image for post
Pointing the record in interest by mouse immediately highlights the record in the chart.
用鼠标指向感兴趣的记录将立即在图表中突出显示该记录。

HiPlot运行快 (HiPlot Runs Fast)

To test the run time to show the parallel plot for larger data, I used Kaggle FIFA 19 complete player dataset. It is a dataset from a video game “FIFA 19”, as the name explains a game of soccer (or you may call football), where you can play as a team manager of a actual soccer team or as an actual soccer player. The dataset contains the all playable characters list with their skill levels (e.g. how good they are at heading, free kick etc.) The number of rows is 18,207 and of columns is 89. The first row is Messi from Argentina.

为了测试运行时显示更大数据的平行图,我使用了Kaggle FIFA 19完整播放器数据集 。 它是来自视频游戏“ FIFA 19”的数据集,顾名思义,这是一场足球比赛(或者您可以称为足球),您可以在其中扮演实际足球队的球队经理或实际足球运动员的角色。 数据集包含所有可玩角色列表以及他们的技能水平(例如,他们的头球,任意球等水平)。行数为18207,列数为89。第一行是阿根廷的梅西。

To do the performance test, I intentionally make the data size 10 times larger. I concatenated the FAFA 19 dataset 10 times, ended up with having 182,070 rows. Usually, visualizing large data set takes time to run and causes huge latency after the chart shows up. Interactivity? Forget and rerun the script! What about HiPlot?

为了进行性能测试,我故意将数据大小增大了10倍。 我将FAFA 19数据集连接了10次,最终有182,070行。 通常,可视化大数据集需要时间才能运行,并且在图表显示后会导致巨大的延迟。 互动性? 忘记并重新运行脚本! 那HiPlot呢?

I ran HiPlot on 182,070 rows x 89 columns dataset without any edits. It took 81 seconds to process and additional 5 mins to display the graph. I think it is short enough for its size.

我在182,070行x 89列数据集上运行了HiPlot,没有进行任何编辑。 处理花了81秒,另外花了5分钟显示图形。 我认为它足够短。

fifa = pd.read_csv('fifa19_data.csv',index_col='Unnamed: 0')fifa_extended = pd.concat([fifa,fifa,fifa,fifa,fifa,fifa,fifa,fifa,fifa,fifa],axis=0,ignore_index=True,sort=False)fifa_hiplot = hip.Experiment.from_dataframe(fifa_extended)fifa_hiplot.display()
Image for post
This is how messy it looks like by the way…
顺便说一句,这看起来很混乱……

What is even greater about HiPlot is that data size does not harm its interactivity too much. After selecting the range on axis, it tries to show only the plots belonging to the range. This change re-renders the plot almost within a second, which is surprising quick compared to other visualization tools.

HiPlot更重要的是,数据大小不会太大地损害其交互性。 在轴上选择范围后,它将尝试仅显示属于该范围的图。 此更改几乎在一秒钟内即可重新渲染图,与其他可视化工具相比,这是令人惊讶的快速。

Image for post
Test selecting the ranges.
测试选择范围。

本机HTML渲染功能 (Native HTML Rendering Function)

When we want to share the plot with someone else, we may run the code on notebook and copy-and-paste the plot, but it removes the graph interactivity.

当我们想与其他人共享绘图时,我们可以在笔记本上运行代码并复制并粘贴绘图,但是它删除了图形交互性。

HiPlot has its native HTML rendering function Experience.to_html(), which returns HTML file with the plot embedded with just one line of code.

HiPlot具有其本机HTML呈现功能Experience.to_html() ,该函数返回HTML文件,其中嵌入的图仅包含一行代码。

Let me go with the original rows and fewer columns from FIFA 19 dataset for simplicity.

为了简单起见,让我来看一下FIFA 19数据集中的原始行和较少的列。

fifa = pd.read_csv('fifa19_data.csv',index_col='Unnamed: 0')fifa_small = fifa[['Age','Nationality','Value','Height', 'Weight', 'Crossing', 'Finishing', 'HeadingAccuracy', 'ShortPassing', 'Volleys', 'Dribbling', 'Curve', 'FKAccuracy', 'LongPassing', 'BallControl', 'Acceleration']]fifa_hiplot = hip.Experiment.from_dataframe(fifa_small)fifa_hiplot.display()

This code will produce a new .html file on your local with the plot.

此代码将在您的本地图上生成一个新的.html文件。

_ = fifa_hiplot.to_html("fifa_hiplot.html")

Now you can share the .html file directly with your team members to let them play around the plot.

现在,您可以直接与团队成员共享.html文件,让他们在剧情中玩耍。

Image for post
Rendered as ‘fifa_hiplot.html
渲染为'fifa_hiplot.html

Since Experience.to_html() returns html code, it’s even just easily connected to web server and deploy the plot externally.

由于Experience.to_html()返回html代码,因此它甚至可以轻松连接到Web服务器并在外部部署绘图。

Let me try it with Flask and Heroku. As I explained a lot here, I needed four files pushed to GitHub repository, to be synced with Heroku app.

让我与Flask和Heroku一起尝试。 正如我在这里所做的很多解释,我需要将四个文件推送到GitHub存储库,以便与Heroku应用程序同步。

  • fifa19_data.csv: FIFA19 dataset file.

    fifa19_data.csv :FIFA19数据集文件。

  • hiplot_fifa.py: Python code to run and kick off Flask app.

    hiplot_fifa.py :运行和启动Flask应用程序的Python代码。

import hiplot as hipimport pandas as pdfrom flask import Flaskapp = Flask(__name__)@app.route('/')def fifa_experiment():    fifa = pd.read_csv('fifa19_data.csv',index_col='Unnamed: 0')    fifa_hiplot = hip.Experiment.from_dataframe(fifa[['Age','Nationality','Value','Height', 'Weight', 'Crossing','Finishing', 'HeadingAccuracy', 'ShortPassing', 'Volleys', 'Dribbling', 'Curve', 'FKAccuracy', 'LongPassing', 'BallControl', 'Acceleration']])

    return fifa_hiplot.to_html()if __name__ == "__main__":    app.run()
  • requirements.txt: a requirement file for Heroku to install the necessary modules.

    requirements.txt :Heroku安装必需模块的需求文件。

gunicorn==19.9.0pandas==0.24.2hiplot==0.1.12Flask==1.1.1
  • Procfile: a start-up command for Heroku to run when it starts the app.

    Procfile :Heroku在启动应用程序时运行的启动命令。

web: gunicorn hiplot_fifa:app

Sync the code files and make a set up on Heroku. Opening the web app gives the following HiPlot graph page, which is globally accessible through domain name.

同步代码文件,并在Heroku上进行设置。 打开Web应用程序将显示以下HiPlot图表页面,该页面可通过域名进行全局访问。

Image for post
Deployed HiPlot plot through Flask and served by Heroku.
通过Flask部署了HiPlot图,并由Heroku提供服务。

尾注 (Ending Note)

In this post, I introduced the HiPlot the current best option of parallel plot to start EDA to take a look at the variable interaction overview.

在本文中,我介绍了HiPlot(当前并行绘图的最佳选择)以启动EDA,以了解变量交互作用概述。

It is easy to run, highly interactive, fast, and with much shareable through HTML file or code.

它易于运行,高度交互,快速且可通过HTML文件或代码共享。

Although the data science projects definitely need further investigation such as looking at the shape of distribution of values, imputing the missing values etc, HiPlot would be a much help to start off the data preprocessing and understanding.

尽管数据科学项目确实需要进一步研究,例如查看值的分布形状,估算缺失值等,但HiPlot将对启动数据预处理和理解提供很大帮助。

翻译自: https://towardsdatascience.com/introduction-to-best-parallel-plot-python-library-hiplot-8387f5786d97

python并行运算库

http://www.taodudu.cc/news/show-894196.html

相关文章:

  • 克服浮躁_设计思维:您克服并赢得低迷的最终工具。
  • 识别人声_演唱人声的5个技巧
  • 游戏 新手引导 设计_我认为每个新手设计师都应该知道什么
  • 交互规则_您必须永不中断的10条交互设计规则
  • 如何创建和谐的色彩系统
  • ai中导入sketch_在Sketch中营造深度感
  • figma下载_何时在Figma中使用组或框架
  • 注释标记的原则_它关系到平台如何标记操纵的媒体。 这是设计师应遵循的12条原则。
  • web mp4第一帧_Web成帧器就在这里!
  • 美学设计评价_死亡的孩子无法使用的设计美学
  • 方法重载_方法
  • 同态加法_同态—当旧趋势突然变酷时
  • 安全态势感知产品对比_设计中的对比和人的感知
  • 人工智能和Adobe Sensei
  • 素描的几大基础知识点_2020年让您感到惊奇的5大素描资源
  • 排版人员 快速排版_选择排版前应了解的事项
  • imessage_重新设计iMessage以获得更好的用户体验— UX案例研究
  • 插图 引用 同一行两个插图_插图的目的
  • 最少的编码
  • 单选按钮步骤流程向导 js_创建令人愉快的按钮的6个步骤
  • 护肤产生共鸣_通过以人为本的设计编织共鸣的20个指针
  • 谷歌抽屉_Google(最终)会杀死导航抽屉吗?
  • sketch钢笔工具_设计工具(Sketch,Adobe XD,Figma和InVision Studio)中奇怪的一项功能
  • sketch浮动布局_使用智能布局和调整大小在Sketch中创建更好的可重用符号
  • 保持危机感和紧迫感_什么是紧迫的:您需要知道的一切
  • ui边框设计图_UI设计形状和对象基础知识:填充和边框
  • figma下载_素描vs Figma困境
  • 硬币 假硬币 天平_小东西叫硬币
  • 检测输入路径是否存在错误_为什么存在用户输入错误
  • Baymard Institute:基于UX的最佳实践的光荣的,循证的工具

python并行运算库_最佳并行绘图Python库简介:“ HiPlot”相关推荐

  1. python编程基础_月隐学python第2课

    python编程基础_月隐学python第2课 学习目标 掌握变量的输入和输出 掌握数据类型的基本概念 掌握算数运算 1.变量的输入和输出 1.1 变量输入 使用input输入 input用于输入数据 ...

  2. 查看Python的版本_查看当前安装Python的版本

    一.查看Python的版本_查看当前安装Python的版本 具体方法: 首先按[win+r]组合键打开运行: 然后输入cmd,点击[确定]: 最后执行[python --version]命令即可. 特 ...

  3. python gis库_使用开放的python库自动化GIS和遥感工作流

    python gis库 Over my career I've worked on many geospatial related projects using the ArcGIS platform ...

  4. python好用的第三方库_非常有用的 Python 第三方库

    http requests 易读易懂的 http libary django-rest-framework 基于django 用以构建web api eve 基于Flask, mongodb的 RES ...

  5. python如何离线安装第三方库_离线环境安装python第三方库

    python 离线环境安装python第三方库 author: yafeishi tags: AntDB,python python对于运维工作确实方便了很多,但很多比较实用的库都是第三方提供,在os ...

  6. python库_计算机二级教程 Python语言程序设计,第10章python第三方库概览

    第十章学习知识导图 考点主要是: 1) 第三方库的获取和安装 2) 脚本程序转变为可执行程序的第三方库 : PyInstaller库(必选) 3) 第三方库: jieba库(必选).wordcloud ...

  7. 10个常用python标准库_【循序渐进学Python】11.常用标准库

    安装完Python之后,我们也同时获得了强大的Python标准库,通过使用这些标准库可以为我们节省大量的时间.这里是一些常用标准库的简单说明.更多的标准库的说明,可以参考Python文档 sys 模块 ...

  8. net能和python结合吗_如何不用安装python就能在.NET里调用Python库

    前言 Pythonnet这个屌爆的项目的出现,使得我们可以用一种新的方式,让C#可以和Python之间进行互操作.但是它的设置和部署可能有点问题,真的是这样吗? 本文我会介绍Python.Includ ...

  9. anaconda python3 安装库_痛点:Anaconda3 python第三方库批量安装

    工作中,是不是会一不小心python的IDE环境突然出bug了,崩了,进不去了.烦躁的有时候想重新装一遍IDE环境来解决问题.比如使用anaconda,也是要一个个的去conda安装或者pip安装,安 ...

最新文章

  1. 我发现一条惊人规律,年后跳槽BATJ,都是这种人....
  2. dede修改mysql,Dedecms(织梦)程序MySQL修复表和文章路径修改方法
  3. winform中通过FileStream实现将文件上传
  4. mysql 取字符串首字母_MySQL通过函数获取字符串汉字拼音首字母大写字符串
  5. 中国机器人市场增速震惊全世界!这6大机器人你听过几个?
  6. Scratch下载(各版本都可下载)
  7. 控制浏览器窗口的可以缩放的最小高度和宽度
  8. MediaInfo与wmv3 wma3 的解码器
  9. html图片轮播思路,css3如何实现轮播图?css3实现轮播图片的方法
  10. GOROOT 和 GOPATH 的区别
  11. HCL_H3CNE综合实验
  12. 分享一些网页设计的素材
  13. Xilinx Zynq ZynqMP DNA
  14. 自顾不暇的大搜车能为吉利汽车做些什么?
  15. mysql 索引太长_修改Mysql索引长度限制
  16. isEnable() 和 isDisplayed() 和 isSelected()
  17. ‍swf文件格式解析入门(tag解析)
  18. 美图秀秀头像插件与七牛云结合
  19. 垃圾回收机制的各种疑问
  20. HDU - 1846

热门文章

  1. 计算机如何打开无线网络适配器,win7系统下网络适配器打不开怎么解决
  2. android获取button宽度,android – 如何获得Button的高度和宽度
  3. ubuntu14.04 python2.7 安装配置OpenCV3.0
  4. IE(IE6/IE7/IE8)支持HTML5标签--20150216
  5. 简化工作——我的bat文件
  6. 正则表达式限制文本框只能输入数字
  7. oracle 存储过程 stored procedure 查询一条记录或多条记录
  8. 计算机二级offic考试题库2017,2017年9月计算机二级MSOffice考试题「带答案」
  9. 全国计算机等级考试题库二级C操作题100套(第69套)
  10. python按键盘上哪个键运行_python根据键盘输入进行相应操作