Exemple #1
0
 def train(self, ndata, **kwargs):
     tmpdata = FuzzySet.fuzzyfy(ndata,
                                partitioner=self.partitioner,
                                method='maximum',
                                mode='sets')
     flrs = FLR.generate_recurrent_flrs(tmpdata)
     self.generate_FLRG(flrs)
Exemple #2
0
    def train(self, data, **kwargs):

        if self.method == 'unconditional':
            window_size = kwargs.get('parameters', 1)
            tmpdata = common.fuzzySeries(data, self.partitioner.sets,
                                         self.partitioner.ordered_sets,
                                         window_size, method='fuzzy')
        else:
            tmpdata = common.fuzzySeries(data, self.partitioner.sets,
                                 self.partitioner.ordered_sets,
                                 method='fuzzy', const_t=0)

        flrs = FLR.generate_recurrent_flrs(tmpdata)
        self.generate_flrg(flrs)

        if self.method == 'conditional':
            self.forecasts = self.forecast(data, no_update=True)
            self.residuals = np.array(data[1:]) - np.array(self.forecasts[:-1])

            self.variance_residual = np.var(self.residuals)  # np.max(self.residuals
            self.mean_residual = np.mean(self.residuals)

            self.residuals = self.residuals[-self.memory_window:].tolist()
            self.forecasts = self.forecasts[-self.memory_window:]
            self.inputs = np.array(data[-self.memory_window:]).tolist()
Exemple #3
0
    def train(self, data, **kwargs):

        parameters = kwargs.get('parameters', 'fuzzy')

        if parameters == 'monotonic':
            tmpdata = FuzzySet.fuzzyfy_series_old(data, self.sets)
            flrs = FLR.generate_recurrent_flrs(tmpdata)
            self.generateFLRG(flrs)
        else:
            self.generate_flrg(data)
Exemple #4
0
    def train(self, data, **kwargs):

        window_size = kwargs.get('parameters', 1)
        tmpdata = common.fuzzySeries(data,
                                     self.sets,
                                     self.partitioner.ordered_sets,
                                     window_size,
                                     method='fuzzy')
        flrs = FLR.generate_recurrent_flrs(tmpdata)
        self.generate_flrg(flrs)
Exemple #5
0
    def train(self, data, **kwargs):

        self.configure_lags(**kwargs)
        parameters = kwargs.get('parameters','fuzzy')

        if parameters == 'monotonic':
            tmpdata = self.partitioner.fuzzyfy(data, mode='sets', method='maximum')
            flrs = FLR.generate_recurrent_flrs(tmpdata)
            self.generate_flrg(flrs)
        else:
            self.generate_flrg(data)
Exemple #6
0
 def train(self, data, **kwargs):
     if kwargs.get('sets', None) is not None:
         self.sets = kwargs.get('sets', None)
     tmpdata = FuzzySet.fuzzyfy_series_old(data, self.sets)
     flrs = FLR.generate_recurrent_flrs(tmpdata)
     self.generate_flrg(flrs)
Exemple #7
0
 def train(self, data, **kwargs):
     tmpdata = self.partitioner.fuzzyfy(data, method='maximum', mode='sets')
     flrs = FLR.generate_recurrent_flrs(tmpdata)
     self.generate_flrg(flrs, self.c)
Exemple #8
0
    def train(self, ndata, **kwargs):

        tmpdata = FuzzySet.fuzzyfy_series(ndata, self.sets, method='maximum')
        flrs = FLR.generate_recurrent_flrs(tmpdata)
        self.generate_flrg(flrs)