module Spark::Mllib

MLlib is Spark’s scalable machine learning library consisting of common learning algorithms and utilities, including classification, regression, clustering, collaborative filtering, dimensionality reduction, as well as underlying optimization primitives.

Constants

MultivariateGaussian

MultivariateGaussian

This class provides basic functionality for a Multivariate Gaussian (Normal) Distribution. In the event that the covariance matrix is singular, the density will be computed in a reduced dimensional subspace under which the distribution is supported.

Arguments:

mu

The mean vector of the distribution

sigma

The covariance matrix of the distribution

Public Class Methods

autoload(klass, location, import=true) click to toggle source
Calls superclass method
# File lib/spark/mllib.rb, line 7
def self.autoload(klass, location, import=true)
  if import
    @for_importing ||= []
    @for_importing << klass
  end

  super(klass, location)
end
autoload_without_import(klass, location) click to toggle source
# File lib/spark/mllib.rb, line 16
def self.autoload_without_import(klass, location)
  autoload(klass, location, false)
end
import(to=Object) click to toggle source
# File lib/spark/mllib.rb, line 83
def self.import(to=Object)
  @for_importing.each do |klass|
    to.const_set(klass, const_get(klass))
  end
  nil
end
mdarray?() click to toggle source
# File lib/spark/mllib.rb, line 94
def self.mdarray?
  Gem::Specification::find_all_by_name('mdarray').any?
end
narray?() click to toggle source
# File lib/spark/mllib.rb, line 90
def self.narray?
  Gem::Specification::find_all_by_name('narray').any?
end
prepare() click to toggle source
# File lib/spark/mllib.rb, line 62
def self.prepare
  return if @prepared

  # if narray?
  #   require 'spark/mllib/narray/vector'
  #   require 'spark/mllib/narray/matrix'
  # elsif mdarray?
  #   require 'spark/mllib/mdarray/vector'
  #   require 'spark/mllib/mdarray/matrix'
  # else
  #   require 'spark/mllib/matrix/vector'
  #   require 'spark/mllib/matrix/matrix'
  # end

  require 'spark/mllib/ruby_matrix/vector_adapter'
  require 'spark/mllib/ruby_matrix/matrix_adapter'

  @prepared = true
  nil
end