class XLearn::FM

Public Class Methods

new(**options) click to toggle source
Calls superclass method
# File lib/xlearn/fm.rb, line 3
def initialize(**options)
  @model_type = "fm"
  super
end

Public Instance Methods

latent_factors() click to toggle source

shape is [i, k] for v_{i}

# File lib/xlearn/fm.rb, line 10
def latent_factors
  factor = []
  read_txt do |line|
    if line.start_with?("v_")
      factor << line.split(": ").last.split(" ").map(&:to_f)
    end
  end
  factor
end