How to write Naive Bayes classification algorithm in Ruby ruby

How to write Naive Bayes classification algorithm in Ruby

Naive Bayes classification in plain Ruby: how prior and posterior probabilities decide the winning class, then a working spam filter that classifies email titles. Also where the algorithm shines: sentiment analysis, recommendations, and fraud detection.

Feb 10, 2023

Why callbacks are bad in Rails models ruby

Why callbacks are bad in Rails models

ActiveRecord callbacks bring tight coupling, slower transactions, and painful debugging. Why before_save and after_save hooks in Rails models cause trouble, and how replacing them with an explicit process class makes the same flow readable and easy to debug.

Feb 7, 2023

Consider using Apipie gem twice

Consider using Apipie gem twice

Apipie looks like an easy way to document a Rails API, but check its limits first: no advanced type constraints like exactly_one_of, only partial OpenAPI support, and weak handling of output examples. What to weigh before picking the gem for a larger application.