分類結果可視化python_可視化分類結果的另一種方法

分類結果可視化python

I love good data visualizations. Back in the days when I did my PhD in particle physics, I was stunned by the histograms my colleagues built and how much information was accumulated in one single plot.

我喜歡出色的數據可視化。 早在我獲得粒子物理學博士學位時,我就被同事建立的直方圖以及在一張圖中積累了多少信息而感到震驚。

繪圖中的信息 (Information in Plots)

It is really challenging to improve existing visualization methods or to transport methods from other research fields. You have to think about the dimensions in your plot and the ways to add more of them. A good example is the path from a boxplot to a violinplot to a swarmplot. It is a continuous process of adding dimensions and thus information.

改善現有的可視化方法或從其他研究領域轉移方法確實是一項挑戰。 您必須考慮繪圖中的尺寸以及添加更多尺寸的方法。 一個很好的例子是從箱形圖到小提琴圖再到黑線的路徑。 這是添加維度和信息的連續過程。

The possibilities of adding information or dimensions to a plot are almost endless. Categories can be added with different marker shapes, color maps like in a heat map can serve as another dimension and the size of a marker can give insight to further parameters.

向地塊添加信息或尺寸的可能性幾乎是無限的。 可以添加具有不同標記形狀的類別,像熱圖一樣的顏色圖可以用作另一個維度,標記的大小可以洞察其他參數。

分類器效果圖 (Plots of Classifier Performance)

When it comes to machine learning, there are many ways to plot the performance of a classifier. There is an overwhelming amount of metrics to compare different estimators like accuracy, precision, recall or the helpful MMC.

在機器學習方面,有許多方法可以繪制分類器的性能。 有大量指標可以比較不同的估算器,例如準確性,準確性,召回率或有用的MMC。

All of the common classification metrics are calculated from true positive, true negative, false positive and false negative incidents. The most popular plots are definitely ROC curve, PRC, CAP curve and the confusion matrix.

所有常見分類指標都是根據真實肯定,真實否定錯誤肯定錯誤否定事件計算的。 最受歡迎的圖肯定是ROC曲線,PRC,CAP曲線和混淆矩陣。

I won’t get into detail of the three curves, but there are many different ways to handle the confusion matrix, like adding a heat map.

我不會詳細介紹這三個曲線,但是有許多不同的方法來處理混淆矩陣,例如添加熱圖。

Image for post
A seaborn heatmap of a confusion matrix.
混淆矩陣的海洋熱圖。

分類拼接圖 (A Classification Mosaic Diagram)

For many cases, this is probably sufficient and easy to pick up all relevant information, but for a multi class problem, it can get much harder to do so.

在許多情況下,這可能足夠容易地提取所有相關信息,但是對于多類問題,這樣做會變得更加困難。

While reading some papers, I stumbled across:

在閱讀一些論文時,我偶然發現:

Jakob Raymaekers, Peter J. Rousseeuw, Mia Hubert. Visualizing classification results. arXiv:2007.14495 [stat.ML]

Jakob Raymaekers,Peter J.Rousseeuw和Mia Hubert。 可視化分類結果。 arXiv:2007.14495 [stat.ML]

and from there to

然后從那里

Friendly, Michael. “Mosaic Displays for Multi-Way Contingency Tables.” Journal of the American Statistical Association, vol. 89, no. 425, 1994, pp. 190–200. JSTOR, www.jstor.org/stable/2291215. Accessed 13 Aug. 2020.

友好,邁克爾。 “多向列聯表的馬賽克顯示。” 美國統計協會雜志 ,第一卷。 89號 425,1994,第190-200頁。 JSTOR , www.jstor.org / stable / 2291215。 于2020年8月13日訪問。

The authors propose a mosaic diagram to plot discrete values. We can transport this idea to the field of machine learning with the predicted classes as the discrete values.

作者提出了一個馬賽克圖來繪制離散值。 我們可以將這種思想以預測的類作為離散值傳輸到機器學習領域。

In a multi class environment, such a plot would look like the following:

在多類環境中,這種繪圖如下所示:

Image for post
Mosaic plot of a classification result with four classes.
具有四個類別的分類結果的鑲嵌圖。

It has several advantages over a classical confusion matrix. One can easily see the predicted classes on the y-axis and the number proportion of each class on the x-axis. The big difference from a simple bar plot is the width of the bars, which are giving an idea of the class imbalance.

與經典的混淆矩陣相比,它具有多個優點。 可以輕松地在y軸上看到預測的類別,并在x軸上看到每個類別的數量比例。 與簡單條形圖的最大區別在于條形的寬度,這使人們對類的不平衡有所了解。

You can find the code for such a plot fed with a confusion matrix here:

您可以在此處找到此類代碼的代碼,其中包含混淆矩陣:

Have fun plotting your next classification results!

祝您規劃下一個分類結果愉快!

翻譯自: https://towardsdatascience.com/a-different-way-to-visualize-classification-results-c4d45a0a37bb

分類結果可視化python

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/389333.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/389333.shtml
英文地址,請注明出處:http://en.pswp.cn/news/389333.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

算法組合 優化算法_算法交易簡化了風險價值和投資組合優化

算法組合 優化算法Photo by Markus Spiske (left) and Jamie Street (right) on UnsplashMarkus Spiske (左)和Jamie Street(右)在Unsplash上的照片 In the last post, we saw how actual algorithms are developed and tested. In this post, we will figure out the level of…

Symbol Mc1000 快捷鍵 的 設置 事件 開發

switch (e.KeyCode) { ///數據 case Keys.F1://清除數據 if(File.Exists("Storage Card/CG.sdf")) { Mc.gConn.Close(); Mc.gConn.Dispose(); File.Delete("Storage Card/CG.sdf"); } MessageBox.S…

pandas合并concatmerge和plot畫圖

3.6,3.7pandas合并concat&merge 頭文件: import pandas as pd import numpy as npconcat基礎合并用法 df1 pd.DataFrame(np.ones((3,4))*0,columns [a,b,c,d]) df2 pd.DataFrame(np.ones((3,4))*1,columns [a,b,c,d]) df3 pd.DataFrame(np.ones…

Android跳轉WIFI界面的四種方式

第一種 Intent intent new Intent(); intent.setAction("android.net.wifi.PICK_WIFI_NETWORK"); startActivity(intent); 第二種 startActivity(new Intent(android.provider.Settings.ACTION_WIFI_SETTINGS)); 第三種 Intent i new Intent(); if(android.os.Buil…

PS摳發絲技巧 「選擇并遮住…」

PS摳發絲技巧 「選擇并遮住…」 現在的海報設計,大多數都有模特MM,然而MM的頭發實用太多了,有的還飄起來…… 對于設計師(特別是淘寶美工)沒有一個強大、快速、實用的摳發絲技巧真的混不去哦。而PS CC 2017版本開始,就有了一個強大…

covid 19如何重塑美國科技公司的工作文化

未來 , 技術 , 觀點 (Future, Technology, Opinion) Who would have thought that a single virus would take down the whole world and make us stay inside our homes? A pandemic wave that has altered our lives in such a way that no human (bi…

Symbol Mc1000 Text文本閱讀器整體代碼

using System; using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Collections;using System.IO;namespace text{ /// <summary> /// Form1 的摘要說明。 /// </summary> public c…

python生日悖論分析_生日悖論

python生日悖論分析If you have a group of people in a room, how many do you need to for it to be more likely than not, that two or more will have the same birthday?如果您在一個房間里有一群人&#xff0c;那么您需要多少個才能使兩個或兩個以上的人有相同的生日&a…

統計0-n數字中出現k的次數

/*** 統計0-n數字中出現k的次數&#xff0c;其中k范圍為0-9 */ public static int countOne(int k, int n) {if (k > n) {return 0;}int sum 0;int right 0;for (int i 0; n > 0; i) {int last n % 10;sum last * i * (int) Math.pow(10, i - 1);if (k 0) {sum - (…

房價預測 search Search 中對數據預處理的學習

對于缺失的數據&#xff1a; 我們對連續數值的特征做標準化&#xff08;standardization&#xff09;&#xff1a;設該特征在整個數據集上的均值為 μ &#xff0c;標準差為 σ 。那么&#xff0c;我們可以將該特征的每個值先減去 μ 再除以 σ 得到標準化后的每個特征值。對于…

3.6.1.非阻塞IO

本節講解什么是非阻塞IO&#xff0c;如何將文件描述符修改為非阻塞式 3.6.1.1、阻塞與非阻塞 &#xff08;1&#xff09;阻塞是指函數調用會被阻塞。本質是當前進程調用了函數&#xff0c;進入內核里面去后&#xff0c;因為當前進程的執行條件不滿足&#xff0c;內核無法里面完…

rstudio 管道符號_R中的管道指南

rstudio 管道符號R基礎知識 (R Fundamentals) Data analysis often involves many steps. A typical journey from raw data to results might involve filtering cases, transforming values, summarising data, and then running a statistical test. But how can we link al…

蒙特卡洛模擬預測股票_使用蒙特卡洛模擬來預測極端天氣事件

蒙特卡洛模擬預測股票In a previous article, I outlined the limitations of conventional time series models such as ARIMA when it comes to forecasting extreme temperature values, which in and of themselves are outliers in the time series.在上一篇文章中 &#…

iOS之UITraitCollection

UITraitCollection 為表征 size class 而生&#xff0c;用來區分設備。你可以在它身上獲取到足以區分所有設備的特征。 UITraitEnvironment 協議、UIContentContainer 協議 UIViewController 遵循了這兩個協議&#xff0c;用來監聽和設置 traitCollection 的變化。 protocol UI…

直方圖繪制與直方圖均衡化實現

一&#xff0c;直方圖的繪制 1.直方圖的概念&#xff1a; 在圖像處理中&#xff0c;經常用到直方圖&#xff0c;如顏色直方圖、灰度直方圖等。 圖像的灰度直方圖就描述了圖像中灰度分布情況&#xff0c;能夠很直觀的展示出圖像中各個灰度級所 占的多少。 圖像的灰度直方圖是灰…

eclipse警告與報錯的修復

1.關閉所有eclipse校驗 windows->perference->validation disable all 2.Access restriction: The constructor BASE64Decoder() is not API (restriction on required library C:\Program Files\Java\jdk1.8.0_131\jre\lib\rt.jar) 在builde path 移除jre&#xff0c;再…

時間序列因果關系_分析具有因果關系的時間序列干預:貨幣波動

時間序列因果關系When examining a time series, it is quite common to have an intervention influence that series at a particular point.在檢查時間序列時&#xff0c;在特定時間點對該序列產生干預影響是很常見的。 Some examples of this could be:例如&#xff1a; …

微生物 研究_微生物監測如何工作,為何如此重要

微生物 研究Background背景 While a New York Subway station is bustling with swarms of businessmen, students, artists, and millions of other city-goers every day, its floors, railings, stairways, toilets, walls, kiosks, and benches are teeming with non-huma…

Linux shell 腳本SDK 打包實踐, 收集assets和apk, 上傳FTP

2019獨角獸企業重金招聘Python工程師標準>>> git config user.name "jenkins" git config user.email "jenkinsgerrit.XXX.net" cp $JENKINS_HOME/maven.properties $WORKSPACE cp $JENKINS_HOME/maven.properties $WORKSPACE/app cp $JENKINS_…