Beispiel #1
0
 public bool IsCover(LearnableExample example)
 {
     foreach (var attribute in example.PredictiveAttributes)
     {
         if (_type.Equals(attribute.Type))
         {
             return(_value.Equals(attribute.Value));
         }
     }
     return(false);
 }
Beispiel #2
0
        public bool IsCover(LearnableExample example)
        {
            if (_members.Count == 0)
            {
                return(true);
            }
            switch (_operation)
            {
            case Operation.Neg:
            {
                return(!_members[0].IsCover(example));
            }
            break;

            case Operation.Con:
            {
                foreach (var member in _members)
                {
                    if (!member.IsCover(example))
                    {
                        return(false);
                    }
                }
                return(true);
            }
            break;

            case Operation.Dis:
            {
                foreach (var member in _members)
                {
                    if (member.IsCover(example))
                    {
                        return(true);
                    }
                    return(false);
                }
            }
            break;
            }
            return(false);
        }
Beispiel #3
0
        public override bool Equals(object obj)
        {
            LearnableExample otc = obj as LearnableExample;

            return(otc != null && (_predictiveAttributes.Equals(otc.PredictiveAttributes) && _decisiveAttribute.Equals(otc.DecisiveAttribute)));
        }
Beispiel #4
0
 public LearnableExample(LearnableExample sample)
 {
     _predictiveAttributes = new List <AttributeValue>(sample.PredictiveAttributes);
     _decisiveAttribute    = sample.DecisiveAttribute;
 }
Beispiel #5
0
 public ExaminableExample(LearnableExample example, AttributeValue value = null) : base(example)
 {
     SetValue(value);
 }