def PreTrainedFNN(self): LOutPreOther = [] for Name in self.ModelNames: OutPreOther, OutPreSame = self.GetOutPreFromFile(Name) PreLabelsOther, PreLabelsSame = self.PredictClasses( OutPreOther, OutPreSame) #self.MakeConfusionMatrix(Name, PreLabelsOther, PreLabelsSame) Classnum = 13 PlotService.MultiScore("./plots/", OutPreOther[:, Classnum], OutPreSame[:, Classnum], self.DataSet, Name, Classnum) #Score for Sig PlotService.Score("./plots/", OutPreOther[:, Classnum], OutPreSame[:, Classnum], self.DataSet, Name) #Fit(OutPreOther) LOutPreOther.append(OutPreOther[:, 0]) PlotService.RocCurve("./plots/", LOutPreOther, self.DataSet, self.ModelNames)
def EvaluateFNN(self): LOutPreOther = [] for Name in self.ModelNames: if ("BDT" in Name): #Import the BDT Scores as comperison OutPreOther, OutPreSame = self.GetOutPreFromFile(Name) else: OutPreOther, OutPreSame = self.GetOutPreFromRoc(Name) PreLabelsOther, PreLabelsSame = self.PredictClasses( OutPreOther, OutPreSame) self.MakeConfusionMatrix(Name, PreLabelsOther, PreLabelsSame) PlotService.Score("./plots/", OutPreOther[:, 0], OutPreSame[:, 0], self.DataSet, Name) PlotService.MultiScore("./plots/", OutPreOther[:, 0], OutPreSame[:, 0], self.DataSet, Name, 0) #Score for Sig LOutPreOther.append(OutPreOther[:, 0]) PlotService.RocCurve("./plots/", LOutPreOther, self.DataSet, self.ModelNames)
def PreCutScore(OutPreOther, OutPreSame, DataSet, Name): """ Plots a Score distribution after cutting on the signal Score distribution """ cut = 0.8 ScoreNum = 11 train, test = DataSet.GetInput("Even") SigScoreOther = OutPreOther[:, 0] #Choosing the signal Score SigScoreSame = OutPreSame[:, 0] SecScoreOther = (OutPreOther[:, ScoreNum])[SigScoreOther > 0.8] SecScoreSame = (OutPreSame[:, ScoreNum])[SigScoreSame > 0.8] test = DIClasses.DISample(None, test.Weights[SigScoreOther > 0.8], test.OutTrue[SigScoreOther > 0.8], test.MultiClass[SigScoreOther > 0.8]) train = DIClasses.DISample(None, train.Weights[SigScoreSame > 0.8], train.OutTrue[SigScoreSame > 0.8], train.MultiClass[SigScoreSame > 0.8]) DataSet = DIClasses.DIDataSet(train, test, None, None) PlotService.MultiScore("./plots/", SecScoreOther, SecScoreSame, DataSet, Name, ScoreNum)