偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

Kaggle放大招:簡單幾步實(shí)現(xiàn)海量數(shù)據(jù)分析及可視化

大數(shù)據(jù)
近期,Kaggle發(fā)布了新的數(shù)據(jù)分析及可視化工具——Kaggle Kerneler bot,用戶只需上傳數(shù)據(jù)集,便可用Python為用戶自動(dòng)獲取相關(guān)的深度數(shù)據(jù)分析結(jié)果。本文將帶領(lǐng)讀者體驗(yàn)一下這款便捷而又高效的工具。

近期,Kaggle發(fā)布了新的數(shù)據(jù)分析及可視化工具——Kaggle Kerneler bot,用戶只需上傳數(shù)據(jù)集,便可用Python為用戶自動(dòng)獲取相關(guān)的深度數(shù)據(jù)分析結(jié)果。本文將帶領(lǐng)讀者體驗(yàn)一下這款便捷而又高效的工具。

[[239068]]

Kaggle Kerneler bot是一個(gè)自動(dòng)生成的kernel,其中包含了演示如何讀取數(shù)據(jù)以及分析工作的starter代碼。用戶可以進(jìn)入任意一個(gè)已經(jīng)發(fā)布的項(xiàng)目,點(diǎn)擊頂部的“Fork Notebook”來編輯自己的副本。接下來,小編將以最熱門的兩個(gè)項(xiàng)目作為例子,帶領(lǐng)讀者了解該如何使用這款便捷的工具。

好的開始是成功的一半!

要開始這個(gè)探索性分析(exploratory analysis),首先需要導(dǎo)入一些庫并定義使用matplotlib繪制數(shù)據(jù)的函數(shù)。但要注意的是,并不是所有的數(shù)據(jù)分析結(jié)果圖像都能夠呈現(xiàn)出來,這很大程度上取決于數(shù)據(jù)本身(Kaggle Kerneler bot只是一個(gè)工具,不可能做到Jeff Dean或者Kaggle比賽選手們那么***的結(jié)果)。

In [1]:

  1. from mpl_toolkits.mplot3d import Axes3D 
  2. from sklearn.decomposition import PCA 
  3. from sklearn.preprocessing import StandardScaler 
  4. import matplotlib.pyplot as plt  plotting 
  5. import numpy as np  linear algebra 
  6. import os  accessing directory structure 
  7. import pandas as pd  data processing, CSV file I/O (e.g. pd.read_csv) 

在本例中,一共輸入了12個(gè)數(shù)據(jù)集。

In [2]:

  1. print(os.listdir(&39;../input&39;)) 
  2. print(os.listdir(&39;../input/moeimouto-faces/moeimouto-faces/007_nagato_yuki&39;)) 
  3. print(os.listdir(&39;../input/moeimouto-faces/moeimouto-faces/046_alice_margatroid&39;)) 
  4. print(os.listdir(&39;../input/moeimouto-faces/moeimouto-faces/065_sanzenin_nagi&39;)) 
  5. print(os.listdir(&39;../input/moeimouto-faces/moeimouto-faces/080_koizumi_itsuki&39;)) 
  6. print(os.listdir(&39;../input/moeimouto-faces/moeimouto-faces/096_golden_darkness&39;)) 
  7. print(os.listdir(&39;../input/moeimouto-faces/moeimouto-faces/116_pastel_ink&39;)) 
  8. print(os.listdir(&39;../input/moeimouto-faces/moeimouto-faces/140_seto_san&39;)) 
  9. print(os.listdir(&39;../input/moeimouto-faces/moeimouto-faces/144_kotegawa_yui&39;)) 
  10. print(os.listdir(&39;../input/moeimouto-faces/moeimouto-faces/164_shindou_chihiro&39;)) 
  11. print(os.listdir(&39;../input/moeimouto-faces/moeimouto-faces/165_rollo_lamperouge&39;)) 
  12. print(os.listdir(&39;../input/moeimouto-faces/moeimouto-faces/199_kusugawa_sasara&39;)) 
  13. print(os.listdir(&39;../input/moeimouto-faces/moeimouto-faces/997_ana_coppola&39;)) 

接下里,用戶在編輯界面中會(huì)看到四個(gè)已經(jīng)編好的代碼塊,它們定義了繪制數(shù)據(jù)的函數(shù)。而在發(fā)布后的頁面,這些代碼塊會(huì)被隱藏,如下圖所示,只需單擊已發(fā)布界面中的“code”按鈕就可以顯示隱藏的代碼。

 

準(zhǔn)備就緒!讀取數(shù)據(jù)!

首先,讓我們先看一下輸入中的***個(gè)數(shù)據(jù)集:

In [7]:

  1. nRowsRead = 100  specify &39;None&39; if want to read whole file 
  2.  color.csv may have more rows in reality, but we are only loading/previewing the first 100 rows 
  3. df1 = pd.read_csv(&39;../input/moeimouto-faces/moeimouto-faces/080_koizumi_itsuki/color.csv&39;, delimiter=&39;,&39;, nrows = nRowsRead) 
  4. df1.dataframeName = &39;color.csv&39; 
  5. nRow, nCol = df1.shape 
  6. print(f&39;There are {nRow} rows and {nCol} columns&39;) 

 

那么數(shù)據(jù)長什么樣子呢?

In [8]:

  1. df1.head(5) 

Out [8]:

 

數(shù)據(jù)可視化:僅需簡單幾行!

樣本的柱狀圖:

In [9]:

  1. plotHistogram(df1, 10, 5) 

 

二維和三維的PCA圖:

In [10]:

  1. plotPCA(df1, 2)  2D PCA 
  2. plotPCA(df1, 3)  3D PCA 

 

 

同理,更換數(shù)據(jù)集文件的路徑,也可以得到其它數(shù)據(jù)對(duì)應(yīng)的結(jié)果。

當(dāng)然,除了上述幾種可視化的結(jié)果外,根據(jù)輸入數(shù)據(jù)以及需求的不同,也可以得到其它數(shù)據(jù)分析可視化結(jié)果,例如:

相關(guān)矩陣:

In [11]:

  1. plotCorrelationMatrix(df1, 8) 

 

散射和密度圖:

In [12]:

  1. plotScatterMatrix(df1, 20, 10) 

 

針對(duì)數(shù)據(jù)分析、數(shù)據(jù)可視化工作,Kaggle kerneler bot應(yīng)當(dāng)說是相當(dāng)?shù)谋憬莺透咝Я?。那么你是否也想嘗試一下呢?

責(zé)任編輯:未麗燕 來源: 新智元
相關(guān)推薦

2017-01-12 17:28:59

數(shù)據(jù)分析數(shù)據(jù)可視化可視化

2018-12-03 16:50:23

數(shù)據(jù)可視化數(shù)據(jù)分析薪水

2017-03-09 09:54:13

分析數(shù)據(jù)可視化

2020-05-14 10:19:23

Python可視化分析

2017-09-15 10:23:06

可視化Bug數(shù)據(jù)分析

2017-10-14 13:54:26

數(shù)據(jù)可視化數(shù)據(jù)信息可視化

2021-04-25 21:11:48

數(shù)據(jù)工具技術(shù)

2017-04-18 11:01:14

數(shù)據(jù)分析數(shù)據(jù)可視化

2019-09-02 15:40:25

可視化數(shù)據(jù)分析

2020-03-11 14:39:26

數(shù)據(jù)可視化地圖可視化地理信息

2023-08-28 16:19:32

2023-11-24 14:02:00

Python數(shù)據(jù)分析

2021-09-03 08:58:00

數(shù)據(jù)分析可視化

2020-12-07 05:51:49

數(shù)據(jù)分析數(shù)據(jù)可視化數(shù)據(jù)科學(xué)

2014-05-28 15:23:55

Rave

2024-07-01 08:51:19

可視化數(shù)據(jù)分析漏斗

2016-12-29 20:05:56

數(shù)據(jù)可視化大數(shù)據(jù)產(chǎn)品分析

2017-02-21 17:01:32

JavaScript數(shù)據(jù)分析可視化

2018-12-26 15:55:50

數(shù)據(jù)分析數(shù)據(jù)可視化圖表

2017-08-15 18:55:57

大數(shù)據(jù)數(shù)據(jù)可視化圖表
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)