public static Roc <T> GetInstance(string otherInfoHeaderWithNoTabs, string positiveClassName, string negativeClassName, string fileName) { Roc <T> roc = GetInstance(otherInfoHeaderWithNoTabs, positiveClassName, negativeClassName); roc.Append(fileName); return(roc); }
public static Roc <T> GetInstance(string otherInfoHeaderThatCanContainTabs, string positiveClassName, string negativeClassName) { Roc <T> aRoc = new Roc <T>(); aRoc.RocRowCollection = new List <RocRow <T> >(); aRoc.PositiveClassName = positiveClassName; aRoc.NegativeClassName = negativeClassName; aRoc.OtherInfoHeader = otherInfoHeaderThatCanContainTabs; return(aRoc); }
static public void UnitTest() { //!!!still need to test linelimit, filtering, and ties Roc <int> roc = Roc <int> .GetInstance("the index", "GoodEmail", "Spam"); Random random = new Random("Roc.UnitTest".GetHashCode()); for (int i = 0; i < 1000; ++i) { double prediction = random.NextDouble(); bool isTrue = Math.Sqrt(prediction) > random.NextDouble(); roc.Add(i, isTrue, prediction); } TextWriter textWriter = new StreamWriter(Console.OpenStandardOutput()); roc.ReportRocCurve(textWriter); }