示例#1
0
    def fitWindowing(self, samples, windowSize, wordLength, symbols, normMean,
                     lowerBounding):
        self.transformation = MFT(windowSize, normMean, lowerBounding)
        sa = {}
        index = 0

        for i in range(samples["Samples"]):
            new_list = getDisjointSequences(samples[i], windowSize, normMean)
            for j in range(len(new_list)):
                sa[index] = new_list[j]
                index += 1

        sa["Samples"] = index
        self.fitTransform(sa, wordLength, symbols, normMean)
示例#2
0
    def fitTransformDouble(self, samples, wordLength, symbols, normMean):
        if self.initialized == False:
            self.initialize(wordLength, symbols, normMean)

            if self.transformation == None:
                self.transformation = MFT(len(samples[0].data), normMean,
                                          self.lowerBounding, self.MUSE_Bool)

        transformedSamples = self.fillOrderline(samples, wordLength)

        if self.HistogramType == "EQUI_DEPTH":
            self.divideEquiDepthHistogram()
        elif self.HistogramType == "EQUI_FREQUENCY":
            self.divideEquiWidthHistogram()
        elif self.HistogramType == "INFORMATION_GAIN":
            self.divideHistogramInformationGain()

        return transformedSamples
示例#3
0
    def fitWindowing(self, samples, Labels, windowSize, wordLength, symbols,
                     normMean, lowerBounding):
        self.transformation = MFT(windowSize, normMean, lowerBounding)

        labels = []
        sa = []
        for i in range(samples.shape[0]):
            new_list = getDisjointSequences(samples.iloc[i, :].tolist(),
                                            windowSize, normMean)
            for j in range(len(new_list)):
                sa.append(new_list[j])
                labels.append(Labels[i])

        SA = pd.DataFrame(np.zeros((len(sa), len(sa[0]))))
        for r in range(len(sa)):
            for c in range(len(sa[0])):
                SA.iloc[r, c] = sa[r][c]

        if self.SUP:
            self.fitTransformSupervised(SA, labels, wordLength, symbols,
                                        normMean)
        else:
            self.fitTransform(SA, labels, wordLength, symbols, normMean)