Add DecisionTreeExample class

This class will be used in decision trees.
This commit is contained in:
Michał Czekański 2020-05-21 16:52:48 +02:00
parent ad791a299e
commit bdba45de08

View File

@ -0,0 +1,15 @@
from typing import List
from src.AI.DecisionTrees.Attribute import Attribute
from src.AI.DecisionTrees.AttributeDefinition import AttributeDefinition
class DecisionTreeExample:
def __init__(self, classification, attributes: List[Attribute]):
self.attributes = attributes
self.classification = classification
def getAttributeWithDefinition(self, attributeDefinition: AttributeDefinition):
for attr in self.attributes:
if attr.attributeDefinition.id == attributeDefinition.id:
return attr