<jupyter_start><jupyter_text>EXP1 : internal validation  - In this EXP I choose 30 maybe, 8 OK and 12 fail subjects for ADHD200 total of 50 subjects- Pierre and I Rated them 1 time each<jupyter_code># Load library
import pandas as pd
import os
# paths
path_root = "/home/yassinebha/Drive"
path_qc = os.path.join(path_root,"QC_zooniverse/zooqc_internal_validation")
# read CSV's
qc_pierre = pd.read_csv(os.path.join(path_qc,"intarnal_validation_exp1_Pierre_rating.csv"))
qc_yassine = pd.read_csv(os.path.join(path_qc,"intarnal_validation_exp1_Yassine_rating.csv"))
subject_match_id = pd.read_csv(os.path.join(path_qc,"brain-match-subjects_exp1_internal_rating.csv"))
qc_pierre.head()
qc_yassine.head()
subject_match_id.head()
# retrive subject ID from the list of string in each cell
subjects = subject_match_id.metadata.str[-10:-2]
subject_match_id.loc[:,'ID']=subjects
subject_match_id.head()
# Add subject id Correspondance for Pierre
qc_pierre_id = pd.merge(qc_pierre,subject_match_id[["subject_id","ID"]], how = 'left', on = 'subject_id')
qc_pierre_id.head()
# Add subject id Correspondance for Yassine
qc_yassine_id = pd.merge(qc_yassine,subject_match_id[["subject_id","ID"]], how = 'left', on = 'subject_id')
qc_yassine_id.head()
# merge yassine pierre csv's
merged_qc = pd.merge(qc_pierre_id,qc_yassine_id,on='ID',how='left')
merged_qc
# Replace OK:1 , Maybe:2 and Fail:3
merged_qc.replace({'OK':1,'Maybe':2, 'Fail':3}, inplace=True)
merged_qc.head()
from sklearn import metrics
kappa = metrics.cohen_kappa_score(merged_qc[['most_likely_x']], merged_qc[['most_likely_y']])
print("The kappa betwen Yassine and Pierre is %f " %(kappa))
kappa<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13007159904534607, 'fraction_numerical': 0.014319809069212411, 'mean_word_length': 7.689119170984456, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '280757', 'license': 'MIT', 'n_tokens_mistral': 676, 'n_tokens_neox': 630, 'n_words': 128, 'path': 'zooqc_internal_rating_exp1.ipynb', 'repo_name': 'SIMEXP/zooniverse_qc', 'size': '1676'}