public override void Init(IRepository repository, IEnumerable <string> releases)
        {
            base.Init(repository, releases);

            regression = new LogisticRegression();

            string previousRevision = null;

            foreach (var revision in TrainReleases)
            {
                foreach (var file in GetFilesInRevision(revision))
                {
                    context
                    .SetCommits(previousRevision, revision)
                    .SetFiles(e => e.IdIs(file.ID));

                    regression.AddTrainingData(
                        GetPredictorValuesFor(context),
                        FileHasDefects(file.ID, revision, previousRevision)
                        );
                }
                previousRevision = revision;
            }

            regression.Train();

            context.SetCommits(TrainReleases.Last(), PredictionRelease);
        }
Exemple #2
0
 private string[] GetPostReleaseDefectiveFilesFromTouchedInRelease()
 {
     return(GetPostReleaseDefectiveFiles(
                repository.SelectionDSL()
                .Commits()
                .AfterRevision(TrainReleases.Last())
                .TillRevision(PredictionRelease)
                ));
 }