<jupyter_start><jupyter_text>Release wise stats test<jupyter_code>count = 0
dfs = ['process','product','process+product']
orders = ["P", "C", "P+C"]
all_results = pd.DataFrame()
for k in range(len(dfs)):
    df = dfs[k]
    order = orders[k]
    result_df = pd.DataFrame()
    final_result = pd.read_pickle('results/Performance/commit_guru_file_specific/' + df +'_700_rf_release_devanvu_set3.pkl')
    for metric in final_result.keys():
        final_df = pd.DataFrame()
        release = [[],[],[]]
        for projects in final_result[metric].keys():
            if len(final_result[metric][projects]) < 3:
                continue
            count += 1
            i = 0
            for value in final_result[metric][projects]:
                if metric == 'ifa':
                    value = value/100
                release[i].append(value)
                i += 1
                if i == 3:
                    break
        for j in range(3):
            score_df = pd.DataFrame(release[j], columns = ['scores'])
            score_df['release'] = [j+1]*score_df.shape[0]
            final_df = pd.concat([final_df,score_df], axis = 0)
        final_df['metrics'] = [metric]*final_df.shape[0]
        result_df = pd.concat([result_df,final_df], axis = 0)
    result_df['Metric Type'] = [order]*result_df.shape[0]
    all_results = pd.concat([all_results,result_df])
all_results = all_results[all_results['metrics'] != 'featue_importance']
all_results = all_results.dropna()
for metric in all_results.metrics.unique():
    sub_df = all_results[all_results['metrics'] == metric]
    with open('results/Stats/Release_stability/' + metric + '.txt', 'w') as f:
        for mType in sub_df['Metric Type'].unique():
            sub_sub_df = sub_df[sub_df['Metric Type'] == mType]
            for rel in sub_sub_df.release.unique():
                f.write(mType + "_" + str(rel) + "\n")
                sub_sub_sub_df = sub_sub_df[sub_sub_df['release'] == rel]
                for score in sub_sub_sub_df.scores.values:
                    f.write("%s " % score)
                f.write("\n\n")
    f.close()<jupyter_output><empty_output><jupyter_text>correlation Stats Test<jupyter_code>metrics = ['process','product','process+product']
exp_types = ['JIT','release']
all_results = pd.DataFrame()
for exp_type in exp_types:
    final_df = pd.DataFrame()
    for metric in metrics:
        project_corr = pd.read_pickle('results/Performance/Correlations/' + metric + '_corr_' + exp_type + '.pkl')
        flat_list = [np.nanmedian(sublist) for sublist in list(project_corr.values())]
        project_corr_df = pd.DataFrame(flat_list, columns = ['scores'])
        project_corr_df['metrics'] = [metric]*project_corr_df.shape[0]
        final_df = pd.concat([final_df,project_corr_df], axis = 0)
    final_df['type'] = [exp_type]*final_df.shape[0]
    all_results = pd.concat([all_results,final_df], axis = 0)
all_results = all_results.dropna()
with open('results/Stats/Correlations/file_corr.txt', 'w') as f:
    for metric in all_results.metrics.unique():
        sub_df = all_results[all_results['metrics'] == metric]
        for _type in sub_df.type.unique():
            sub_sub_df = sub_df[sub_df['type'] == _type]
            f.write(metric + "_" + _type + "\n")
            for score in sub_sub_df.scores.values:
                f.write("%s " % score)
            f.write("\n\n")
f.close()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14636283961437335, 'fraction_numerical': 0.007011393514460999, 'mean_word_length': 2.7918050941306753, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 9, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '169157', 'license': 'Apache-2.0', 'n_tokens_mistral': 1157, 'n_tokens_neox': 1110, 'n_words': 210, 'path': 'Stats.ipynb', 'repo_name': 'ai-se/process-product', 'size': '3423'}