Class: Saulabs::TrueSkill::Layers::SkillsToPerformances

Inherits:
Base
  • Object
show all
Defined in:
lib/saulabs/trueskill/layers/skills_to_performances.rb

Instance Attribute Summary

Attributes inherited from Base

#factors, #graph, #input, #output

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Saulabs::TrueSkill::Layers::Base

Instance Method Details

#buildObject



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/saulabs/trueskill/layers/skills_to_performances.rb', line 9

def build
  @input.each do |team|
    team_performances = []
    team.each do |rating|
      variable = TrueSkill::Rating.new(0.0, 0.0, rating.activity, rating.tau)
      @factors << Factors::Likelihood.new(@graph.beta_squared, variable, rating)
      team_performances << variable
    end
    @output << team_performances
  end
end

#posterior_scheduleObject



25
26
27
# File 'lib/saulabs/trueskill/layers/skills_to_performances.rb', line 25

def posterior_schedule
  Schedules::Sequence.new(@factors.map { |f| Schedules::Step.new(f, 1) })
end

#prior_scheduleObject



21
22
23
# File 'lib/saulabs/trueskill/layers/skills_to_performances.rb', line 21

def prior_schedule
  Schedules::Sequence.new(@factors.map { |f| Schedules::Step.new(f, 0) })
end