public override void SetUp() { base.SetUp(); context = new PredictorContext(this); p = new Prediction().AddFilesTouchCountInCommitsPredictor(); p.Init(this, new string[] { "1", "2" }); }
private static CodeBlockSelectionExpression CodeInFilesTillRevision(this PredictorContext c) { c.SetValue("commits", (Func <CommitSelectionExpression, CommitSelectionExpression>)(e => e.TillRevision(c.GetValue <string>("till_revision")) )); return(CodeInCommitsInFiles(c)); }
private static CodeBlockSelectionExpression CodeInCommitsInFiles(this PredictorContext c) { return(c.SelectionDSL() .Commits().Reselect( c.GetValue <Func <CommitSelectionExpression, CommitSelectionExpression> >("commits") ) .Files().Reselect( c.GetValue <Func <ProjectFileSelectionExpression, ProjectFileSelectionExpression> >("files") ) .Modifications().InCommits().InFiles() .CodeBlocks().InModifications()); }
public virtual void Init(IRepositoryResolver repositories, IEnumerable<string> releases) { this.repositories = repositories; PredictionRelease = releases.Last(); if (releases.Count() > 1) { TrainReleases = releases.Take(releases.Count() - 1); } else { TrainReleases = releases; } context = new PredictorContext(repositories); }
public double[] GetPredictorValuesFor(PredictorContext c) { return predictors.Select(p => p(c)).ToArray(); }