module Scoruby

Constants

VERSION

Attributes

logger[W]

Public Class Methods

load_model(pmml_file_name) click to toggle source
# File lib/scoruby.rb, line 19
def self.load_model(pmml_file_name)
  xml = xml_from_file_path(pmml_file_name)
  ModelFactory.factory_for(xml)
end
load_model_from_string(pmml_string) click to toggle source
# File lib/scoruby.rb, line 24
def self.load_model_from_string(pmml_string)
  xml = xml_from_string(pmml_string)
  ModelFactory.factory_for(xml)
end
logger() click to toggle source
# File lib/scoruby.rb, line 12
def logger
  @logger ||= Logger.new($stdout).tap do |log|
    log.progname = name
  end
end
xml_from_file_path(pmml_file_name) click to toggle source
# File lib/scoruby.rb, line 29
def self.xml_from_file_path(pmml_file_name)
  pmml_string = File.open(pmml_file_name, 'rb').read
  xml_from_string(pmml_string)
end
xml_from_string(pmml_string) click to toggle source
# File lib/scoruby.rb, line 34
def self.xml_from_string(pmml_string)
  xml = Nokogiri::XML(pmml_string, &:noblanks)
  xml.remove_namespaces!
end