Sha256: 98dc98ede4c5e25a486b87a8d99f506e2185f67851716b219f4854cea0daf593

Contents?: true

Size: 580 Bytes

Versions: 3

Compression:

Stored size: 580 Bytes

Contents

require 'spec_helper'

describe FisherClassifier do
  before do
    # Use in-memory classifier
    @classifier = FisherClassifier.create_in_memory
  end

  it 'should calculate feature prob' do
    expect(@classifier).to be

    @classifier.train 'the quick rabbit jumps fences', :good
    @classifier.train 'buy pharmaceuticals now', :bad

    cat =  @classifier.classify('buy now')
    expect(cat).to eq :bad

    cat =  @classifier.classify('buy stuff now')
    expect(cat).to eq :bad

    cat =  @classifier.classify('rabbit jumps now')
    expect(cat).to eq :good
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fisher_classifier-0.0.4 spec/fisher_classifier_spec.rb
fisher_classifier-0.0.3 spec/fisher_classifier_spec.rb
fisher_classifier-0.0.2 spec/fisher_classifier_spec.rb