
Security News
CISA’s 2025 SBOM Guidance Adds Hashes, Licenses, Tool Metadata, and Context
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
This is a very simple Naive Bayesian classifier, build just for fun.
I decided to use it as an example while learning to package ruby code.
The algorithm used here is not original, but an adaptation from Burak Kanber's Machine Learning in Javascript series.
Add this line to your application's Gemfile:
gem 'bayes_naive_jdp'
And then execute:
$ bundle
Or install it yourself as:
$ gem install bayes_naive_jdp
# create an instance of the Classifier
classifier = BayesNaiveJdp::Classifier.new
# Train the Classifier using many samples from each valid category
# documents are strings, categories are strings, symbols, or integers
classifier.train(document_a_1, category_a)
classifier.train(document_a_2, category_a)
classifier.train(document_a_3, category_a)
..
classifier.train(document_b_1, category_b)
classifier.train(document_b_2, category_b)
classifier.train(document_b_3, category_b)
..
# use the classifier to categorize an unknown document
results = classifier.classify(mystery_document)
category = results[:winner][:classification]
confidence = results[:winner][:confidence]
# also, results[:all_scores] is a hash
# with categories as indices and confidence levels as values
FAQs
Unknown package
We found that bayes_naive_jdp demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.