Ejemplo n.º 1
0
        protected void DoRun()
        {
            Preconditions.CheckArgumentRange(NumFolds >= 2 && NumFolds < Dataset.Count);
            Preconditions.CheckArgument(Models.Any());
            Preconditions.CheckNotNull(Dataset);

            DoBegin();

            if (IsStratified)
            {
                Dataset.GroupLabels(IsShuffle, ShuffleRandom);
            }
            else if (IsShuffle)
            {
                Dataset.Shuffle(ShuffleRandom);
            }

            if (PerfData == null)
            {
                PerfData = new PerfData <LblT>();
            }
            else
            {
                Preconditions.CheckArgument(PerfData.GetDataKeys().All(t => t.Item1 != ExpName),
                                            "PerfData object already contains data for '{0}' experiment", ExpName);
            }
            mFoldModelTimes.Clear();
            for (int i = 0; i < NumFolds; i++)
            {
                DoRunFold(i + 1);
            }

            DoFinish();
        }
Ejemplo n.º 2
0
 protected override PerfMatrix <LblT> GetPerfMatrix(string algName, int foldN)
 {
     lock (mLock)
     {
         return(PerfData.GetPerfMatrix(ExpName, algName, foldN));
     }
 }
Ejemplo n.º 3
0
 protected virtual PerfMatrix <LblT> GetPerfMatrix(string algName, int foldN)
 {
     return(PerfData.GetPerfMatrix(ExpName, algName, foldN));
 }