本笔记来源于B站Up主: 有Li 的影像组学的系列教学视频
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.
pip install pingouin # for the first time
import pingouin as pg
import pandas as pd
import numpy as np
data = pg.read_dataset('icc')
icc = pg.intraclass_corr(data = data, targets = "Wine", raters = "Judge",
ratings = "Scores")
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 = 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")
以上 ICC_reader_1.xlsx 及处理后的数据形式为：