def generating_Training_Graph(self):
        if not os.path.exists(
                Formating.get_abs_file_path(self.filePathTrainingGraph)):
            if self.graph == None:
                print "Reading Full graphs", datetime.today()
                self.graph = Formating.reading_graph(self.filePathGraph)

            print "Generating Trainnig graphs", datetime.today()

            self.trainnigGraph = Formating.get_graph_from_period(
                self.graph, self.t0, self.t0_)

            networkx.write_graphml(
                self.trainnigGraph,
                Formating.get_abs_file_path(self.filePathTrainingGraph))
        else:
            print "Reading Trainnig graph", datetime.today()
            self.trainnigGraph = Formating.reading_graph(
                self.filePathTrainingGraph)

        for w_score in self.WeightedScoresChoiced:
            w_score[0].graph = self.trainnigGraph
        for score in self.ScoresChoiced:
            score[0].graph = self.trainnigGraph
        for w in self.WeightsChoiced:
            w[0].graph = self.trainnigGraph
 def generating_Test_Graph(self ):
     if not os.path.exists(Formating.get_abs_file_path(self.filePathTestGraph)):
         if self.graph == None:
             print "Reading Full graphs", datetime.today()
             self.graph = Formating.reading_graph(self.filePathGraph)
         print "Generating Testing graphs", datetime.today()
     
         self.testGraph = Formating.get_graph_from_period(self.graph, self.t1, self.t1_)
         networkx.write_graphml(self.testGraph, Formating.get_abs_file_path(self.filePathTestGraph))
     else:
         print "Reading testing graph", datetime.today()
         self.testGraph = Formating.reading_graph(self.filePathTestGraph)
示例#3
0
    def generating_Test_Graph(self):
        if not os.path.exists(
                Formating.get_abs_file_path(self.filePathTestGraph)):
            if self.graph == None:
                print "Reading Full graphs", datetime.today()
                self.graph = Formating.reading_graph(self.filePathGraph)
            print "Generating Testing graphs", datetime.today()

            self.testGraph = Formating.get_graph_from_period(
                self.graph, self.t1, self.t1_)
            networkx.write_graphml(
                self.testGraph,
                Formating.get_abs_file_path(self.filePathTestGraph))
        else:
            print "Reading testing graph", datetime.today()
            self.testGraph = Formating.reading_graph(self.filePathTestGraph)
 def generating_Training_Graph(self):
     if not os.path.exists(Formating.get_abs_file_path(self.filePathTrainingGraph)):
         if self.graph == None:
             print "Reading Full graphs", datetime.today()
             self.graph = Formating.reading_graph(self.filePathGraph)
         
         print "Generating Trainnig graphs", datetime.today()
        
         self.trainnigGraph = Formating.get_graph_from_period(self.graph, self.t0, self.t0_)
         
         networkx.write_graphml(self.trainnigGraph, Formating.get_abs_file_path(self.filePathTrainingGraph))
     else:
         print "Reading Trainnig graph", datetime.today()
         self.trainnigGraph = Formating.reading_graph(self.filePathTrainingGraph)
     
     for feature in self.featuresChoice:
         feature[0].graph = self.trainnigGraph