public string TraverseTree(DNARecord item, Node tree) { if (tree.children.Count == 0) { return(tree.leafClass); } var attibute = item.sequence[tree.label]; var attributeIndex = (int)((AttributeValues.valueIndex)Enum.Parse(typeof(AttributeValues.valueIndex), attibute.ToString())); try { return(TraverseTree(item, tree.children[attributeIndex])); } catch (System.ArgumentOutOfRangeException e) { return("Could not classify"); } }
public bool IsCorrectClassification(DNARecord item, string prediction) { return(item.classifier == prediction); }