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.
- 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
.csvfiles (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.
- Efficient loading of datasets from
- 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.propertiesfile 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.
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
- Java Development Kit (JDK) 17 or higher
- Apache Maven (version 3.6.0+)
- Clone the repository:
git clone https://github.com/your-username/ml-library.git # Replace with your actual repository URL cd ml-library
- Build the project using Maven:
mvn clean install
After a successful build, you can launch the JavaFX GUI directly from the project root:
mvn javafx:run