Skip to content

Instantly share code, notes, and snippets.

@LWFlouisa
Created June 10, 2023 05:33
Show Gist options
  • Save LWFlouisa/eac03b4ee718dbf5915747e48d7046c0 to your computer and use it in GitHub Desktop.
Save LWFlouisa/eac03b4ee718dbf5915747e48d7046c0 to your computer and use it in GitHub Desktop.
Frusterations With Phind

I don't personally think Phind is ready for offering refinements for code, for instance I offered an example of why I might use independant methods of Naive Bayes:

require "naive_bayes"

# Create independant perimeters.
colors = NaiveBayes.new(:black,
                        :white,
                        :grey,
                        :red,
                        :green,
                        :blue
)

shapes = NaiveBayes.new(:line,
                        :square,
)

# Train on specific data.

## Colors
colors.train(:black, 'black', 'black')
colors.train(:white, 'white', 'white')
colors.train(:grey,   'grey',  'grey')
colors.train(:red,     'red',   'red')
colors.train(:green, 'green', 'green')
colors.train(:blue,   'blue',  'blue')

## Shapes
shapes.train(:line,   '+----------+', 'line')
shapes.train(:square, '+----------+
|          |
|          |
|          |
|          |
|          |
',                                  'square')


my_color = "red"
my_shape = "+-------------+"

this_color = colors.classify(*my_color)
this_shape = shapes.classify(*my_shape)

puts this_color
puts this_shape

However when it suggested refinements, it was using a ruby gem that I wasn't even using. More often than not it suggests Python when I'm using Ruby. This is really frusterating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment