Commit 9b19d897 authored by Antoine PIGEAU's avatar Antoine PIGEAU
Browse files

improve display result for comparison

parent dfb165a2
......@@ -88,12 +88,18 @@ if __name__ == "__main__":
aucsMerged = resultAllCoursesMerged[idCourse].aucs
aucs = resultsAllCourses[idCourse].aucs
accuraciesMerged = resultAllCoursesMerged[idCourse].accuracies
accuracies = resultAllCoursesMerged[idCourse].accuracies
pvalue = scipy.stats.ttest_ind(aucsMerged, aucs, equal_var=True)
avgAucs = np.nanmean(aucs)
avgAucsMerged = np.nanmean(aucsMerged)
pvalues[t][idCourse] = (pvalue.pvalue, avgAucsMerged > avgAucs, np.abs(avgAucsMerged - avgAucs))
avgAccuracies = np.nanmean(accuracies)
avgAccuraciesMerged = np.nanmean(aucsMerged)
pvalues[t][idCourse] = (pvalue.pvalue, avgAucsMerged > avgAucs, np.abs(avgAucsMerged - avgAucs), np.abs(avgAccuraciesMerged - avgAccuracies))
#print('aucsMerged: ', aucsMerged)
#print('aucs: ', aucs)
......@@ -102,17 +108,21 @@ if __name__ == "__main__":
print("---- traces cut at ", t)
coursesImproved = []
howBetterAucs = []
howBetterAccuracys = []
for idCourse in ConstantModel.ID_COURSES:
(pvalue, isBetter, howBetter) = pvalues[t][idCourse]
(pvalue, isBetter, howBetterAuc, howBetterAccuracy) = pvalues[t][idCourse]
print(idCourse, " : ", pvalue)
if(pvalue < 0.05 and isBetter):
coursesImproved.append((idCourse, howBetter))
coursesImproved.append((idCourse, howBetterAuc, howBetterAccuracy))
howBetterAucs.append(howBetterAuc)
howBetterAccuracys.append(howBetterAccuracy)
print("Course Improved with transfert learning: " , coursesImproved)
print("Course Improved with transfert learning #[",len(coursesImproved),", ", np.mean(howBetterAucs), ", ", np.mean(howBetterAccuracys) ,"] : " , coursesImproved)
stopTime = datetime.now()
print(("end of the classification task ("+str(stopTime-startTime)+")"))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment