예제 #1
0
    def calculateAllSimilarities(self, similarityMetric):

        self.similarityMetric = similarityMetric

        self.outputFilename = "ldaSimilarities_A%s_B%s_T%s_I%s_S%s_N%s_M%s.txt" % (
            self.alpha, self.beta, self.numTopics, self.iterations,
            self.initialRandomSeed, self.normalizationMethod,
            self.similarityMetric)

        normTypeName = norm.getNormMethodName(self.normalizationMethod)

        self.the_simMatrix = simMatrix.simMatrix()
        simMetricName = self.the_simMatrix.getSimMetricName(similarityMetric)
        updateString = "%s %s %s\n" % (self.outputFilename, normTypeName,
                                       simMetricName)

        self.the_simMatrix.assignTargetInfo(self.rowTypeSubList,
                                            self.rowTypeSubDict,
                                            self.rowTypeSubIndexDict)
        self.the_simMatrix.assignMatrixData(self.rowTopic_Matrix)

        self.the_simMatrix.initNewSimMatrix(self.chainDirectory,
                                            self.outputFilename, updateString)
        self.the_simMatrix.calculateAllSimilarities(similarityMetric)
        self.the_simMatrix.outputSimilarityMatrix()
예제 #2
0
    def calculateAllSimilarities(self, similarityMetric):

        self.similarityMetric = similarityMetric

        self.outputFilename = "tdSimilarities_N%s_M%s.txt" % (
            self.normalizationMethod, self.similarityMetric)
        normTypeName = norm.getNormMethodName(self.normalizationMethod)

        self.the_simMatrix = simMatrix.simMatrix()
        simMetricName = self.the_simMatrix.getSimMetricName(
            self.similarityMetric)
        updateString = "%s %s %s\n" % (self.outputFilename, normTypeName,
                                       simMetricName)

        self.the_simMatrix.assignTargetInfo(self.subTargetList,
                                            self.subTargetDict,
                                            self.subTargetIndexDict)
        self.the_simMatrix.assignColumnInfo(self.subDocumentList,
                                            self.subDocumentDict,
                                            self.subDocumentIndexDict)
        self.the_simMatrix.assignMatrixData(
            self.normalizedTargetDocumentMatrix)

        self.the_simMatrix.initNewSimMatrix(self.matrixDirectory,
                                            "tdSimilarities",
                                            self.outputFilename, updateString)
        self.the_simMatrix.calculateAllSimilarities(similarityMetric)
        self.the_simMatrix.outputSimilarityMatrix()
예제 #3
0
파일: svd.py 프로젝트: fidiego/supermatrix
    def calculateAllRowSimilarities(self, similarityMetric):
    
        self.similarityMetric = similarityMetric
        self.outputFilename = "svdSimilarities_D%s_N%s_M%s.txt" % (self.numDimensions, self.normalizationMethod, self.similarityMetric)
        normTypeName = norm.getNormMethodName(self.normalizationMethod)

        self.the_simMatrix = simMatrix.simMatrix()
        simMetricName = self.the_simMatrix.getSimMetricName(similarityMetric)
        updateString = "%s %s %s\n" % (self.outputFilename, normTypeName, simMetricName)

        self.the_simMatrix.assignTargetInfo(self.rowSubList, self.rowSubDict, self.rowSubIndexDict)
        self.the_simMatrix.assignMatrixData(self.normRowMatrix)
        
        self.the_simMatrix.initNewSimMatrix(self.svdDirectory, "svdSimilarities", self.outputFilename, updateString)
        self.the_simMatrix.calculateAllSimilarities(self.similarityMetric)
        self.the_simMatrix.outputSimilarityMatrix()
예제 #4
0
    def calculateAllRowSimilarities(self, similarityMetric):
    
        self.similarityMetric = similarityMetric
        self.outputFilename = "rvaSimilarities_N%s_M%s.txt" % (self.normalizationMethod, self.similarityMetric)
        normTypeName = norm.getNormMethodName(self.normalizationMethod)

        self.the_simMatrix = simMatrix.simMatrix()
        simMetricName = self.the_simMatrix.getSimMetricName(similarityMetric)
        updateString = "%s %s %s\n" % (self.outputFilename, normTypeName, simMetricName)

        self.the_simMatrix.assignTargetInfo(self.rowSubList, self.rowSubDict, self.rowSubIndexDict)
        self.the_simMatrix.assignMatrixData(self.normMemMatrix)
        
        self.the_simMatrix.initNewSimMatrix(self.rvaDirectory, self.outputFilename, updateString)
        self.the_simMatrix.calculateAllSimilarities(self.similarityMetric)
        self.the_simMatrix.outputSimilarityMatrix()
예제 #5
0
파일: lda.py 프로젝트: fidiego/supermatrix
    def calculateAllSimilarities(self, similarityMetric):
    
        self.similarityMetric = similarityMetric
        
        self.outputFilename = "ldaSimilarities_A%s_B%s_T%s_I%s_S%s_N%s_M%s.txt" % (self.alpha, self.beta, self.numTopics, self.iterations, self.initialRandomSeed, self.normalizationMethod, self.similarityMetric)
        
        normTypeName = norm.getNormMethodName(self.normalizationMethod)

        self.the_simMatrix = simMatrix.simMatrix()
        simMetricName = self.the_simMatrix.getSimMetricName(similarityMetric)
        updateString = "%s %s %s\n" % (self.outputFilename, normTypeName, simMetricName)
        
        self.the_simMatrix.assignTargetInfo(self.rowTypeSubList, self.rowTypeSubDict, self.rowTypeSubIndexDict)
        self.the_simMatrix.assignMatrixData(self.rowTopic_Matrix)
        
        self.the_simMatrix.initNewSimMatrix(self.chainDirectory, self.outputFilename, updateString)
        self.the_simMatrix.calculateAllSimilarities(similarityMetric)
        self.the_simMatrix.outputSimilarityMatrix()
예제 #6
0
    def calculateAllSimilarities(self, similarityMetric):
    
        self.similarityMetric = similarityMetric
        
        self.outputFilename = "tdSimilarities_N%s_M%s.txt" % (self.normalizationMethod, self.similarityMetric)
        normTypeName = norm.getNormMethodName(self.normalizationMethod)

        self.the_simMatrix = simMatrix.simMatrix()
        simMetricName = self.the_simMatrix.getSimMetricName(self.similarityMetric)
        updateString = "%s %s %s\n" % (self.outputFilename, normTypeName, simMetricName)
        
        self.the_simMatrix.assignTargetInfo(self.subTargetList, self.subTargetDict, self.subTargetIndexDict)
        self.the_simMatrix.assignColumnInfo(self.subDocumentList, self.subDocumentDict, self.subDocumentIndexDict)
        self.the_simMatrix.assignMatrixData(self.normalizedTargetDocumentMatrix)
        
        self.the_simMatrix.initNewSimMatrix(self.matrixDirectory, "tdSimilarities", self.outputFilename, updateString)
        self.the_simMatrix.calculateAllSimilarities(similarityMetric)
        self.the_simMatrix.outputSimilarityMatrix()