Li‘s 影像组学视频学习笔记(29)-ICC的计算

本笔记来源于B站Up主: 有Li 的影像组学的系列教学视频
本节(29)主要讲解: 用pingouin包进行ICC的计算
 
 
1、ICC的wikipedia定义

In statistics, the intraclass correlation, or the intraclass correlation coefficient (ICC), is a descriptive statistic that can be used when quantitative measurements are made on units that are organized into groups. It describes how strongly units in the same group resemble each other. While it is viewed as a type of correlation, unlike most other correlation measures it operates on data structured as groups, rather than data structured as paired observations.

2、导入包

pip install pingouin # for the first time

import pingouin as pg
import pandas as pd
import numpy as np
import os

3、调取内置数据集

data = pg.read_dataset('icc')
print(data)

数据格式大概是这个样子:
Li‘s 影像组学视频学习笔记(29)-ICC的计算_第1张图片

4、计算ICC

icc = pg.intraclass_corr(data = data, targets = "Wine", raters = "Judge",
                         ratings = "Scores")
print(icc)

输出结果如下:
Li‘s 影像组学视频学习笔记(29)-ICC的计算_第2张图片

5、实战

folderPath = "C:/Users/RONG/Desktop/ICC_calculation/"

data_1 = pd.read_excel(os.path.join(folderPath,"ICC_reader_1.xlsx"))
data_2 = pd.read_excel(os.path.join(folderPath,"ICC_reader_2.xlsx"))

data_1.insert(0,"reader",np.ones(data_1.shape[0]))
data_2.insert(0,"reader",np.ones(data_2.shape[0])*2)

data_1.insert(0,"target",range(data_1.shape[0]))
data_2.insert(0,"target",range(data_2.shape[0]))

data = pd.concat([data_1,data_2]) # make a data frame like the test data 

icc = pg.intraclass_corr(data = data, targets = "target", raters = "reader",ratings = "featureA")
print(icc)

以上 ICC_reader_1.xlsx 及处理后的数据形式为:

Li‘s 影像组学视频学习笔记(29)-ICC的计算_第3张图片

Li‘s 影像组学视频学习笔记(29)-ICC的计算_第4张图片

在影像组学实际应用中,应用for循环进行批量化计算各个feature的ICC值。

作者:北欧森林
链接:https://www.jianshu.com/p/9e79ac76fed6
来源:简书,已获授权转载

RadiomicsWorld.com “影像组学世界”论坛:
影像组学世界/RadiomicsWorld

你可能感兴趣的:(Li's,影像组学视频学习笔记,机器学习,python,人工智能,数据分析,神经网络)