Sha256: 2deb441c130bcf8b5b2cd2c2b6274ad7ab3b0c1cbd5d0d142072b9fb93922c5b

Contents?: true

Size: 556 Bytes

Versions: 1

Compression:

Stored size: 556 Bytes

Contents

namespace :cabalist do
  
  desc 'Retrain a Cabalist model'
  task :retrain, [:model] => :environment do |t, args|
    unless args.model
      puts "Usage: rake cabalist:retrain[<CLASS NAME>]"
    else
      begin
        args.model.constantize.train_model
      rescue Exception => e
        puts "Could not retrain the classifier"
        puts "Possibly the class is not Cabalist-enabled?"
        puts "Anyway, here is your stack trace:"
        puts e.backtrace
      else
        puts "Classifier retrained successfully"
      end
    end
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cabalist-0.0.4 lib/tasks/retrain.rake