Exemplo n.º 1
0
        // Pulls all newer ratings from the RatingSummarizer
        public void Update(ExponentialRatingSummarizer summarizer)
        {
            DateTime latestDate = summarizer.LatestKnownDate;

            // fetch any ratings that appeared since our last update
            this.Update(summarizer, this.endDate, latestDate);
        }
Exemplo n.º 2
0
        // Pulls new ratings from the RatingSummarizer within a certain date range and updates metadata (min/max)
        public void Update(ExponentialRatingSummarizer summarizer, DateTime earliestDateToInclude, DateTime latestDateToInclude)
        {
            if (!this.useNonzeroWeightEvenIfEarlierThanFirstSummarizerDatapoint)
            {
                bool earlierThanFirstDatapoint = this.startDate.CompareTo(summarizer.EarliestKnownDate) < 0;
                if (earlierThanFirstDatapoint)
                {
                    return;
                }
            }

            if (earliestDateToInclude.CompareTo(this.startDate) < 0)
            {
                bool endInclusive = (this.values.Weight <= 0);
                this.importData(summarizer, earliestDateToInclude, this.startDate, true, endInclusive);
                this.startDate = earliestDateToInclude;
            }

            bool startInclusive = (this.values.Weight <= 0);
            int  endComparison  = latestDateToInclude.CompareTo(this.endDate);

            if (endComparison > 0 || (startInclusive && endComparison >= 0))
            {
                this.importData(summarizer, this.endDate, latestDateToInclude, startInclusive, true);
                this.endDate = latestDateToInclude;
            }
            this.timeWeight = 1 - (summarizer.GetWeightAfterDate(this.endDate) / summarizer.GetWeightAfterDate(this.startDate));
        }
Exemplo n.º 3
0
 // implements the pull of new data from the RatingSummarizer
 private void importData(ExponentialRatingSummarizer summarizer, DateTime earliestDateToInclude, DateTime latestDateToInclude, bool startInclusive, bool endInclusive)
 {
     this.values = this.values.Plus(summarizer.GetValueDistributionForDates(earliestDateToInclude, latestDateToInclude, startInclusive, endInclusive));
 }
Exemplo n.º 4
0
 public LongtermValuePredictor(ExponentialRatingSummarizer ratingSummarizer)
 {
     this.ratingSummarizer        = ratingSummarizer;
     this.interpolator            = new LazyDimension_Interpolator <Distribution>(new DistributionAdder());
     this.ratingSummariesToUpdate = new List <ScoreSummary>();
 }