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



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

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



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

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

#prior_scheduleObject



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

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