Skip to content

AdrianBobish/Java-Thyroid-ML-Classifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

J-MLFlow: Building & Benchmarking Classifiers for Thyroid Health

Overview

This project presents a modular and extensible machine learning library developed in Java, specifically designed for binary classification tasks. Adhering to a robust UML-driven architectural design, it offers a flexible framework for implementing and experimenting with various classification algorithms, evaluating their performance, and interactively managing the entire machine learning workflow through an intuitive JavaFX graphical user interface.

The framework emphasizes clean object-oriented principles, generic programming, and extensibility, providing comprehensive functionalities for data loading, preprocessing, model training, prediction, and in-depth performance evaluation using standard metrics.

Features

  • Diverse Classification Algorithms:
    • Logistic Regression: A fundamental linear classifier, trained using an iterative gradient descent optimization.
    • Decision Tree: A non-linear, rule-based model that constructs a hierarchical structure by identifying optimal feature splits based on Gini impurity.
    • Naive Bayes: A probabilistic classifier leveraging Bayes' theorem, assuming Gaussian distributions for feature likelihoods within each class.
  • Robust Data Pipeline:
    • Efficient loading of datasets from .csv files (e.g., thyroidDF.csv) located within project resources.
    • Comprehensive feature engineering capabilities, including conversion of boolean and categorical attributes to numerical representations, and handling of missing numerical values.
    • Configurable train-test splitting for rigorous model validation and evaluation.
  • In-depth Performance Evaluation:
    • Calculates essential classification metrics: Accuracy, Precision, Recall, and F1-Score.
    • Generates a detailed Confusion Matrix, providing granular insights into model performance relative to a user-defined positive class.
  • Interactive JavaFX GUI:
    • A user-friendly interface for loading datasets, selecting classifiers, and adjusting hyperparameters.
    • Real-time visualization of model training progress and comprehensive test results.
    • Controls for dynamically setting the train-test split ratio.
  • Model Persistence: Supports serialization and deserialization of trained models, enabling efficient saving and loading for future use without retraining.
  • Externalized Configuration: Utilizes a config.properties file for easy management and customization of default classifier settings, hyperparameters, and other operational parameters.
  • Core Java Skill Showcase: Demonstrates advanced application of Java's object-oriented paradigms (interfaces, inheritance, polymorphism), generics, collections, exception handling, I/O streams, serialization, and functional interfaces.

Project Structure

The project adheres to a standard Maven directory layout, with a logical organization of packages:

src/main/java/ro/ubbcluj/apm/ml/

├── data/ # Data models (Instance, ThyroidData), data loading, and splitting utilities

├── eval/ # Interfaces and implementations for various evaluation measures

├── gui/ # JavaFX application entry point, controller, and FXML layout

├── model/ # Core ML model interface and concrete classifier implementations

└── util/ # Utility classes for configuration loading and model serialization

src/main/resources/

├── thyroidDF.csv # Primary dataset for the project

└── config.properties # Application configuration, including default settings and hyperparameters

└── ro/ubbcluj/apm/ml/gui/app-view.fxml # JavaFX GUI layout definition

Getting Started

Prerequisites

  • Java Development Kit (JDK) 17 or higher
  • Apache Maven (version 3.6.0+)

Building the Project

  1. Clone the repository:
    git clone https://github.com/your-username/ml-library.git # Replace with your actual repository URL
    cd ml-library
  2. Build the project using Maven:
    mvn clean install

Running the Application

After a successful build, you can launch the JavaFX GUI directly from the project root:

mvn javafx:run

About

This project is a modular, extensible Java machine learning library for binary classification. Built on a UML-driven architecture, it supports implementing and testing multiple classifiers, evaluating performance, and managing the full ML workflow through an intuitive JavaFX GUI.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages