AIToday
AI Coding AssistantsOpen-Source AIQiita 機械学習Published: Dec 6, 2026, 13:00 JST

Tribuo Naive Bayes iris model hits 0.8333 accuracy at 5.2M

Send on LINE
Tribuo Naive Bayes iris model hits 0.8333 accuracy at 5.2M

3 Key Points

  1. What happened

    A developer built and then reloaded a Naive Bayes iris classifier in Tribuo (Oracle Labs' Java machine-learning library), reporting 0.8333 accuracy and a saved serialized model; the minimal JAR set came to 5.2M, versus 750M+ for tribuo-all.

  2. Why it matters

    Keeping the footprint at 5.2M suggests this approach may suit embedding a classifier in an existing Java application, where shipping every related library is impractical.

Ask AI

Ask the AI about this article. Questions and answers are published on this page

Context & Analysis

The developer had previously written samples using Weka's API but chose to try Tribuo because distributing a product raises license concerns. Tribuo contrasts with the single-library approach of Weka: Tribuo requires different libraries depending on the algorithm or function, which the developer calls cumbersome but also means a specific library alone can work without an all-in-one bundle.

The sample workflow is split into two programs. The first loads iris data from CSV, splits it 80/20 for training and test, trains a Multinomial Naive Bayes model with a Laplace smoothing coefficient of 1.0, prints accuracy and a confusion matrix, and saves the model to a .ser file. The second reads that file, builds an example from four feature values, and prints the predicted class along with scores for each label.

The developer argues that conventional machine learning remains suitable when training data is scarce, predictors are independent, or fast computation is needed, such as in embedded or real-time analysis. The piece closes with a view that choosing traditional methods appropriately, rather than defaulting to LLMs, is part of being an AI professional.

FAQ
How accurate was the Tribuo Naive Bayes model?
The model reported an accuracy of 0.8333 on the test split, with a confusion matrix showing misclassifications only between Iris-versicolor and Iris-virginica.
What is the size difference between the minimal libraries and tribuo-all?
The JARs needed for model building totaled 5.2M, while pulling in tribuo-all with Maven brought in many unused libraries and exceeded 750M.
Which library does the prediction program need?
Loading the saved model and classifying new data required a set of files totaling 4.3M, including tribuo-core, tribuo-data, and tribuo-classification-mnnaivebayes.
Qiita 機械学習Read Original Article
Send on LINE

AI news that matters for your work, delivered every morning.

Pick your industry and the AI tools you use, and get news related to your work every day.

By signing up you agree to the Terms of Service and Privacy Policy.

Free · 30 seconds with Google · unsubscribe anytimeWhat is AIToday? →

Related Articles

Next articleSoftBank buys then dumps SkyVault AI over Megaspeed ties