影像组学学习笔记(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.

1.导入包

pip install pingouin # for the first time

import pingouin as pg
import pandas as pd
import numpy as np
import os
  1. 调取内置数据集
data = pg.read_dataset('icc')
print(data)

数据格式大概是这个样子:


ICC_data.JPG
  1. 计算ICC
icc = pg.intraclass_corr(data = data, targets = "Wine", raters = "Judge",
                         ratings = "Scores")
print(icc)

输出结果如下:


ICC-test.JPG
  1. 实战
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)
  1. 以上 ICC_reader_1.xlsx 及处理后的数据形式为:


    reader_1.JPG

    ICC-calculation.JPG

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

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。