IStreamable <Microsoft.StreamProcessing.Empty, RankedSentiment> TwitterAnalytics(IStreamable <Microsoft.StreamProcessing.Empty, Tweet> input) { return // Sample analytics query - output average sentiment score per tweet topic (input .GroupApply(e => e.Topic, str => str.HoppingWindowLifetime(TimeSpan.FromMinutes(5).Ticks, TimeSpan.FromSeconds(5).Ticks) .Average(e => e.SentimentScore), (g, c) => new RankedSentiment { Topic = g.Key, AvgSentiment = c }) //.TopK(10) .AlterEventDuration(1) ); }