Correções nas classes devido à modularização

This commit is contained in:
Petrônio Cândido de Lima e Silva 2016-09-07 18:51:00 -03:00
parent cf9fbbf5a7
commit eb27fabb4c
3 changed files with 14 additions and 4 deletions

View File

@ -1,3 +1,11 @@
import numpy as np
import pandas as pd
#import matplotlib as plt
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from pyFTS import *
# Erro quadrático médio
def rmse(predictions,targets):
return np.sqrt(np.mean((predictions-targets)**2))

10
chen.py
View File

@ -1,4 +1,6 @@
class FirstOrderFLRG:
from pyFTS import *
class ConventionalFLRG:
def __init__(self,premiss):
self.premiss = premiss
self.consequent = set()
@ -16,9 +18,9 @@ class FirstOrderFLRG:
return tmp + tmp2
class FirstOrderFTS(FTS):
class ConventionalFTS(fts.FTS):
def __init__(self,name):
super(FirstOrderFTS, self).__init__(1,name)
super(ConventionalFTS, self).__init__(1,name)
def defuzzy(self,data):
@ -52,7 +54,7 @@ class FirstOrderFTS(FTS):
if count > self.order:
if last["fuzzyset"] not in self.flrgs:
self.flrgs[last["fuzzyset"]] = FirstOrderFLRG(last["fuzzyset"])
self.flrgs[last["fuzzyset"]] = ConventionalFLRG(last["fuzzyset"])
self.flrgs[last["fuzzyset"]].append(actual["fuzzyset"])
count = count + 1

View File