def performSessCategoryBasedOnNegCorrelation(thresholdP, pearson, pearson_p, corr_Cat, focType): import db_queries, utility dictToRet = {} sessHeaviness = [0, 1, 2] catList = ["None", "Idle", "System", "Code", "Debug", "Build", "Navi"] res = [] for catType in catList: for he_ in sessHeaviness: res.append( utility.convertDictToVal( db_queries.performSessCategoryBasedOnNegCorrelation( thresholdP, he_, catType, pearson, pearson_p, corr_Cat, focType))) dictToRet[catType] = res res = [] return dictToRet
def performSessCategoryBasedOnNegCorrelation( thresholdP, pearson, pearson_p, corr_Cat, focType ): import db_queries, utility dictToRet={} sessHeaviness = [0, 1 , 2] catList = ["None", "Idle", "System", "Code", "Debug", "Build", "Navi"] res = [] for catType in catList: for he_ in sessHeaviness: res.append(utility.convertDictToVal( db_queries.performSessCategoryBasedOnNegCorrelation( thresholdP, he_, catType, pearson, pearson_p, corr_Cat, focType)) ) dictToRet[catType] = res res= [] return dictToRet
def doMIC(thresholdParam): print "M!-I!-C! (MIC) !!!" print "File interleaving .... " print "#####" ###############SPEARMAN !! ######## query58 = db_queries.query58(thresholdParam) #print "Query 58: >=0.5, file interleaving ", query58 query59 = db_queries.query59(thresholdParam) #print "Query 59: >=0.0 and <=0.499, file interleaving ", query59 query60 = db_queries.query60(thresholdParam) #print "Query 60: <0.0, file interleaving ", query60 ############# print "Project interleaving .... " print "#####" query61 = db_queries.query61(thresholdParam) #print "Query 61: < 0.0, project interleaving", query61 query62 = db_queries.query62(thresholdParam) #print "Query 62: >=0.0 and <=0.499, project interleaving", query62 query63 = db_queries.query63(thresholdParam) #print "Query 63: >=0.5, project interleaving ", query63 ############# print "State interleaving .... " print "#####" query64 = db_queries.query64(thresholdParam) #print "Query 64: < 0.0, state interleaving", query64 query65 = db_queries.query65(thresholdParam) #print "Query 65: >=0.0 and <=0.499, state interleaving", query65 query66 = db_queries.query66(thresholdParam) #print "Query 66: >=0.5, state interleaving ", query66 ############# print "Namespace interleaving .... " print "#####" query67 = db_queries.query67(thresholdParam) #print "Query 67: < 0.0, Namespace interleaving", query67 query68 = db_queries.query68(thresholdParam) #print "query68: >=0.0 and <=0.499, Namespace interleaving", query68 query69 = db_queries.query69(thresholdParam) #print "Query 69: >=0.5, Namespace interleaving ", query69 ## MIC val_query58 = utility.convertDictToVal(query58) val_query59 = utility.convertDictToVal(query59) val_query60 = utility.convertDictToVal(query60) val_query61 = utility.convertDictToVal(query61) val_query62 = utility.convertDictToVal(query62) val_query63 = utility.convertDictToVal(query63) val_query64 = utility.convertDictToVal(query64) val_query65 = utility.convertDictToVal(query65) val_query66 = utility.convertDictToVal(query66) val_query67 = utility.convertDictToVal(query67) val_query68 = utility.convertDictToVal(query68) val_query69 = utility.convertDictToVal(query69) print "Printing M-I-C ... " MICList = [ val_query58, val_query59, val_query60, val_query63, val_query62, val_query61, val_query66, val_query65, val_query64, val_query69, val_query68, val_query67 ] print "Plotting M-I-C as bar graphs ... " plotter.plotCorrelations("MIC", MICList)
def doSpearman(thresholdParam): print "S-P-E-A-R-M-A-N !!!" print "File interleaving .... " print "#####" ###############SPEARMAN !! ######## query46 = db_queries.query46(thresholdParam) #print "Query 46: >=0.5, file interleaving ", query46 query47 = db_queries.query47(thresholdParam) #print "Query 47: >=0.0 and <=0.499, file interleaving ", query47 query48 = db_queries.query48(thresholdParam) #print "Query 48: <0.0, file interleaving ", query48 ############# print "Project interleaving .... " print "#####" query49 = db_queries.query49(thresholdParam) #print "Query 49: < 0.0, project interleaving", query49 query50 = db_queries.query50(thresholdParam) #print "Query 50: >=0.0 and <=0.499, project interleaving", query50 query51 = db_queries.query51(thresholdParam) #print "Query 51: >=0.5, project interleaving ", query51 ############# print "State interleaving .... " print "#####" query52 = db_queries.query52(thresholdParam) #print "Query 52: < 0.0, state interleaving", query52 query53 = db_queries.query53(thresholdParam) #print "Query 53: >=0.0 and <=0.499, state interleaving", query53 query54 = db_queries.query54(thresholdParam) #print "Query 54: >=0.5, state interleaving ", query54 ############# print "Namespace interleaving .... " print "#####" query55 = db_queries.query55(thresholdParam) #print "Query 55: < 0.0, Namespace interleaving", query55 query56 = db_queries.query56(thresholdParam) #print "query56: >=0.0 and <=0.499, Namespace interleaving", query56 query57 = db_queries.query57(thresholdParam) #print "Query 57: >=0.5, Namespace interleaving ", query57 ## SPEARMAN val_query46 = utility.convertDictToVal(query46) val_query47 = utility.convertDictToVal(query47) val_query48 = utility.convertDictToVal(query48) val_query49 = utility.convertDictToVal(query49) val_query50 = utility.convertDictToVal(query50) val_query51 = utility.convertDictToVal(query51) val_query52 = utility.convertDictToVal(query52) val_query53 = utility.convertDictToVal(query53) val_query54 = utility.convertDictToVal(query54) val_query55 = utility.convertDictToVal(query55) val_query56 = utility.convertDictToVal(query56) val_query57 = utility.convertDictToVal(query57) print "Printting S-P-E-A-R-M-A-N ... " #print "Query-46", val_query46 #print "Query-47", val_query47 #print "Query-48", val_query48 #print "Query-49", val_query49 #print "Query-50", val_query50 #print "Query-51", val_query51 #print "Query-52", val_query52 #print "Query-53", val_query53 #print "Query-54", val_query54 #print "Query-55", val_query55 #print "Query-56", val_query56 #print "Query-57", val_query57 spearmanList = [ val_query46, val_query47, val_query48, val_query51, val_query50, val_query49, val_query54, val_query53, val_query52, val_query57, val_query56, val_query55 ] print "Plotting S-P-E-A-R-M-A-N as bar graphs ... " plotter.plotCorrelations("Spearman", spearmanList)
def doCorrelationDBQueries(thresholdParam): print "P-E-A-R-S-O-N !!!" print "File interleaving .... " print "#####" queryOneRes = db_queries.queryOne(thresholdParam) #print "Query One: >=0.5, file interleaving ", queryOneRes queryTwoRes = db_queries.queryTwo(thresholdParam) #print "Query two: >=0.0 and <=0.499, file interleaving ", queryTwoRes queryThreeRes = db_queries.queryThree(thresholdParam) #print "Query three: <0.0, file interleaving ", queryThreeRes ############# print "Project interleaving .... " print "#####" queryFourRes = db_queries.queryFour(thresholdParam) #print "Query Four: < 0.0, project interleaving", queryFourRes queryFiveRes = db_queries.queryFive(thresholdParam) #print "Query Five: >=0.0 and <=0.499, project interleaving", queryFiveRes querySixRes = db_queries.querySix(thresholdParam) #print "Query Six: >=0.5, project interleaving ", querySixRes ############# print "State interleaving .... " print "#####" query7Res = db_queries.query7(thresholdParam) #print "Query 7: < 0.0, state interleaving", query7Res query8Res = db_queries.query8(thresholdParam) #print "Query 8: >=0.0 and <=0.499, state interleaving", query8Res query9Res = db_queries.query9(thresholdParam) #print "Query 9: >=0.5, state interleaving ", query9Res ############# print "Namespace interleaving .... " print "#####" query10 = db_queries.query10(thresholdParam) #print "Query 10: < 0.0, Namespace interleaving", query10 query11 = db_queries.query11(thresholdParam) #print "Query 11: >=0.0 and <=0.499, Namespace interleaving", query11 query12 = db_queries.query12(thresholdParam) #print "Query 12: >=0.5, Namespace interleaving ", query12 ##PEARSON val_query1 = utility.convertDictToVal(queryOneRes) val_query2 = utility.convertDictToVal(queryTwoRes) val_query3 = utility.convertDictToVal(queryThreeRes) val_query4 = utility.convertDictToVal(queryFourRes) val_query5 = utility.convertDictToVal(queryFiveRes) val_query6 = utility.convertDictToVal(querySixRes) val_query7 = utility.convertDictToVal(query7Res) val_query8 = utility.convertDictToVal(query8Res) val_query9 = utility.convertDictToVal(query9Res) val_query10 = utility.convertDictToVal(query10) val_query11 = utility.convertDictToVal(query11) val_query12 = utility.convertDictToVal(query12) pearsonList = [ val_query1, val_query2, val_query3, val_query6, val_query5, val_query4, val_query9, val_query8, val_query7, val_query12, val_query11, val_query10 ] print "Plotting P-E-A-R-S-O-N as bar graphs ... " plotter.plotCorrelations("Pearson", pearsonList)
def doCorrelationDBQueries(thresholdParam): print "P-E-A-R-S-O-N !!!" print "File interleaving .... " print "#####" queryOneRes = db_queries.queryOne(thresholdParam) #print "Query One: >=0.5, file interleaving ", queryOneRes queryTwoRes = db_queries.queryTwo(thresholdParam) #print "Query two: >=0.0 and <=0.499, file interleaving ", queryTwoRes queryThreeRes = db_queries.queryThree(thresholdParam) #print "Query three: <0.0, file interleaving ", queryThreeRes ############# print "Project interleaving .... " print "#####" queryFourRes = db_queries.queryFour(thresholdParam) #print "Query Four: < 0.0, project interleaving", queryFourRes queryFiveRes = db_queries.queryFive(thresholdParam) #print "Query Five: >=0.0 and <=0.499, project interleaving", queryFiveRes querySixRes = db_queries.querySix(thresholdParam) #print "Query Six: >=0.5, project interleaving ", querySixRes ############# print "State interleaving .... " print "#####" query7Res = db_queries.query7(thresholdParam) #print "Query 7: < 0.0, state interleaving", query7Res query8Res = db_queries.query8(thresholdParam) #print "Query 8: >=0.0 and <=0.499, state interleaving", query8Res query9Res = db_queries.query9(thresholdParam) #print "Query 9: >=0.5, state interleaving ", query9Res ############# print "Namespace interleaving .... " print "#####" query10 = db_queries.query10(thresholdParam) #print "Query 10: < 0.0, Namespace interleaving", query10 query11 = db_queries.query11(thresholdParam) #print "Query 11: >=0.0 and <=0.499, Namespace interleaving", query11 query12 = db_queries.query12(thresholdParam) #print "Query 12: >=0.5, Namespace interleaving ", query12 ##PEARSON val_query1=utility.convertDictToVal(queryOneRes) val_query2=utility.convertDictToVal(queryTwoRes) val_query3=utility.convertDictToVal(queryThreeRes) val_query4=utility.convertDictToVal(queryFourRes) val_query5=utility.convertDictToVal(queryFiveRes) val_query6=utility.convertDictToVal(querySixRes) val_query7=utility.convertDictToVal(query7Res) val_query8=utility.convertDictToVal(query8Res) val_query9=utility.convertDictToVal(query9Res) val_query10=utility.convertDictToVal(query10) val_query11=utility.convertDictToVal(query11) val_query12=utility.convertDictToVal(query12) pearsonList = [val_query1, val_query2, val_query3, val_query6, val_query5, val_query4, val_query9, val_query8, val_query7, val_query12, val_query11, val_query10] print "Plotting P-E-A-R-S-O-N as bar graphs ... " plotter.plotCorrelations("Pearson", pearsonList)
def doMIC(thresholdParam): print "M!-I!-C! (MIC) !!!" print "File interleaving .... " print "#####" ###############SPEARMAN !! ######## query58 = db_queries.query58(thresholdParam) #print "Query 58: >=0.5, file interleaving ", query58 query59 = db_queries.query59(thresholdParam) #print "Query 59: >=0.0 and <=0.499, file interleaving ", query59 query60 = db_queries.query60(thresholdParam) #print "Query 60: <0.0, file interleaving ", query60 ############# print "Project interleaving .... " print "#####" query61 = db_queries.query61(thresholdParam) #print "Query 61: < 0.0, project interleaving", query61 query62 = db_queries.query62(thresholdParam) #print "Query 62: >=0.0 and <=0.499, project interleaving", query62 query63 = db_queries.query63(thresholdParam) #print "Query 63: >=0.5, project interleaving ", query63 ############# print "State interleaving .... " print "#####" query64 = db_queries.query64(thresholdParam) #print "Query 64: < 0.0, state interleaving", query64 query65 = db_queries.query65(thresholdParam) #print "Query 65: >=0.0 and <=0.499, state interleaving", query65 query66 = db_queries.query66(thresholdParam) #print "Query 66: >=0.5, state interleaving ", query66 ############# print "Namespace interleaving .... " print "#####" query67 = db_queries.query67(thresholdParam) #print "Query 67: < 0.0, Namespace interleaving", query67 query68 = db_queries.query68(thresholdParam) #print "query68: >=0.0 and <=0.499, Namespace interleaving", query68 query69 = db_queries.query69(thresholdParam) #print "Query 69: >=0.5, Namespace interleaving ", query69 ## MIC val_query58=utility.convertDictToVal(query58) val_query59=utility.convertDictToVal(query59) val_query60=utility.convertDictToVal(query60) val_query61=utility.convertDictToVal(query61) val_query62=utility.convertDictToVal(query62) val_query63=utility.convertDictToVal(query63) val_query64=utility.convertDictToVal(query64) val_query65=utility.convertDictToVal(query65) val_query66=utility.convertDictToVal(query66) val_query67=utility.convertDictToVal(query67) val_query68=utility.convertDictToVal(query68) val_query69=utility.convertDictToVal(query69) print "Printing M-I-C ... " MICList = [ val_query58, val_query59, val_query60, val_query63, val_query62, val_query61, val_query66, val_query65, val_query64, val_query69, val_query68, val_query67] print "Plotting M-I-C as bar graphs ... " plotter.plotCorrelations("MIC", MICList)
def doSpearman(thresholdParam): print "S-P-E-A-R-M-A-N !!!" print "File interleaving .... " print "#####" ###############SPEARMAN !! ######## query46 = db_queries.query46(thresholdParam) #print "Query 46: >=0.5, file interleaving ", query46 query47 = db_queries.query47(thresholdParam) #print "Query 47: >=0.0 and <=0.499, file interleaving ", query47 query48 = db_queries.query48(thresholdParam) #print "Query 48: <0.0, file interleaving ", query48 ############# print "Project interleaving .... " print "#####" query49 = db_queries.query49(thresholdParam) #print "Query 49: < 0.0, project interleaving", query49 query50 = db_queries.query50(thresholdParam) #print "Query 50: >=0.0 and <=0.499, project interleaving", query50 query51 = db_queries.query51(thresholdParam) #print "Query 51: >=0.5, project interleaving ", query51 ############# print "State interleaving .... " print "#####" query52 = db_queries.query52(thresholdParam) #print "Query 52: < 0.0, state interleaving", query52 query53 = db_queries.query53(thresholdParam) #print "Query 53: >=0.0 and <=0.499, state interleaving", query53 query54 = db_queries.query54(thresholdParam) #print "Query 54: >=0.5, state interleaving ", query54 ############# print "Namespace interleaving .... " print "#####" query55 = db_queries.query55(thresholdParam) #print "Query 55: < 0.0, Namespace interleaving", query55 query56 = db_queries.query56(thresholdParam) #print "query56: >=0.0 and <=0.499, Namespace interleaving", query56 query57 = db_queries.query57(thresholdParam) #print "Query 57: >=0.5, Namespace interleaving ", query57 ## SPEARMAN val_query46=utility.convertDictToVal(query46) val_query47=utility.convertDictToVal(query47) val_query48=utility.convertDictToVal(query48) val_query49=utility.convertDictToVal(query49) val_query50=utility.convertDictToVal(query50) val_query51=utility.convertDictToVal(query51) val_query52=utility.convertDictToVal(query52) val_query53=utility.convertDictToVal(query53) val_query54=utility.convertDictToVal(query54) val_query55=utility.convertDictToVal(query55) val_query56=utility.convertDictToVal(query56) val_query57=utility.convertDictToVal(query57) print "Printting S-P-E-A-R-M-A-N ... " #print "Query-46", val_query46 #print "Query-47", val_query47 #print "Query-48", val_query48 #print "Query-49", val_query49 #print "Query-50", val_query50 #print "Query-51", val_query51 #print "Query-52", val_query52 #print "Query-53", val_query53 #print "Query-54", val_query54 #print "Query-55", val_query55 #print "Query-56", val_query56 #print "Query-57", val_query57 spearmanList = [val_query46, val_query47, val_query48, val_query51, val_query50, val_query49, val_query54, val_query53, val_query52, val_query57, val_query56, val_query55] print "Plotting S-P-E-A-R-M-A-N as bar graphs ... " plotter.plotCorrelations("Spearman", spearmanList)