Sha256: 6c9c5d6ecabd5f6957007a2c1f14b6f9debc3a7229167d12e5eafb4296a4888e

Contents?: true

Size: 767 Bytes

Versions: 3

Compression:

Stored size: 767 Bytes

Contents

require 'big_ml/base'

module BigML
  class Model < Base
    MODEL_PROPERTIES = [
      :category, :code, :columns, :created, :credits, 
      :dataset, :dataset_status, :description, :holdout, 
      :input_fields, :locale, :max_columns, :max_rows, :model, 
      :name, :number_of_predictions, :objective_fields, :private, 
      :range, :resource, :rows, :size, :source, :source_status, 
      :status, :tags, :updated
    ]

    attr_reader *MODEL_PROPERTIES

    def to_prediction(options)
      Prediction.create(resource, options)
    end

    class << self
      def create(dataset, options = {})
        response = client.post("/#{resource_name}", options, { :dataset => dataset })
        self.new(response) if response.success?
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
big_ml-0.1.3 lib/big_ml/model.rb
big_ml-0.1.2 lib/big_ml/model.rb
big_ml-0.1.1 lib/big_ml/model.rb