Correções nas classes devido à modularização
This commit is contained in:
parent
cf9fbbf5a7
commit
eb27fabb4c
@ -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
|
# Erro quadrático médio
|
||||||
def rmse(predictions,targets):
|
def rmse(predictions,targets):
|
||||||
return np.sqrt(np.mean((predictions-targets)**2))
|
return np.sqrt(np.mean((predictions-targets)**2))
|
||||||
|
10
chen.py
10
chen.py
@ -1,4 +1,6 @@
|
|||||||
class FirstOrderFLRG:
|
from pyFTS import *
|
||||||
|
|
||||||
|
class ConventionalFLRG:
|
||||||
def __init__(self,premiss):
|
def __init__(self,premiss):
|
||||||
self.premiss = premiss
|
self.premiss = premiss
|
||||||
self.consequent = set()
|
self.consequent = set()
|
||||||
@ -16,9 +18,9 @@ class FirstOrderFLRG:
|
|||||||
return tmp + tmp2
|
return tmp + tmp2
|
||||||
|
|
||||||
|
|
||||||
class FirstOrderFTS(FTS):
|
class ConventionalFTS(fts.FTS):
|
||||||
def __init__(self,name):
|
def __init__(self,name):
|
||||||
super(FirstOrderFTS, self).__init__(1,name)
|
super(ConventionalFTS, self).__init__(1,name)
|
||||||
|
|
||||||
def defuzzy(self,data):
|
def defuzzy(self,data):
|
||||||
|
|
||||||
@ -52,7 +54,7 @@ class FirstOrderFTS(FTS):
|
|||||||
|
|
||||||
if count > self.order:
|
if count > self.order:
|
||||||
if last["fuzzyset"] not in self.flrgs:
|
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"])
|
self.flrgs[last["fuzzyset"]].append(actual["fuzzyset"])
|
||||||
count = count + 1
|
count = count + 1
|
||||||
|
Loading…
Reference in New Issue
Block a user