public static Data GetMatchDataBetween(List <Season> seasons, RoundShell fromRoundShell, RoundShell toRoundShell, DataInterpretation interpretation = null) { var data = new Data(); //TODO: It's a little messy to new this up here var league = new League(seasons); var rounds = league.GetRounds(0, 0, toRoundShell.Year, toRoundShell.Number).Where(x => x.Matches.Count > 0).ToList(); var matches = rounds.Where(r => (r.EffectiveId() > fromRoundShell.EffectiveId())) .SelectMany(r => r.Matches); foreach (var m in matches) { var dataPoint = new DataPoint(); var history = rounds.Where(r => !r.Matches.Any(rm => rm.Date >= m.Date)).SelectMany(r => r.Matches).ToList(); dataPoint.Inputs = (BuildInputs(history, m, interpretation)); dataPoint.Outputs = (new List <double>() { Numbery.Normalise(m.HomeScore().Total(), Util.MaxScore), Numbery.Normalise(m.AwayScore().Total(), Util.MaxScore) }); dataPoint.Reference = m.ToTuple(); data.DataPoints.Add(dataPoint); } return(data); }
public bool Equals(RoundShell other) { if (other == null) { return(false); } return(Year.Equals(other.Year) && Number.Equals(other.Number)); }
public Data GetMatchDataFromLeagueBetween(RoundShell fromRoundShell, DateTime date) { Refresh(NumInputs, new List <int>() { DefaultHiddens }, NumOutputs); var round = GetRoundFromDate(date); return(GetMatchDataFromLeagueBetween(fromRoundShell, round)); }
public Data GetMatchDataFromLeagueBetween(RoundShell fromRoundShell, RoundShell toRoundShell, DataInterpretation interpretation = null) { return(GetMatchDataBetween(League.Seasons, fromRoundShell, toRoundShell, interpretation)); }