SynapseML is a minimal machine learning library written in pure Java. It implements popular classification algorithms from scratch with a clean, modular structure — ideal for learning, experimentation, and demonstration purposes.
✔️ Implemented ML Models:
- Perceptron (single-layer binary classifier)
- k-Nearest Neighbors (KNN)
- Naive Bayes (binary classification with Laplace smoothing)
- Logistic Regression (gradient descent based)
- Decision Tree (ID3 / Information Gain)
- Decision Tree (Gini Index)
✔️ Framework Utilities:
- Common model interface:
MLModel - Sample usage in
ExampleApp.java - Predicts binary outputs for toy datasets
- Easily extendable for new models and utilities
synapse/ ├── models/ │ ├── Perceptron.java │ ├── KNN.java │ ├── NaiveBayes.java │ ├── LogisticRegression.java │ ├── DecisionTreeID3.java │ ├── DecisionTreeGini.java │ └── MLModel.java ← shared model interface └── ExampleApp.java ← demo of models
MLModel model = new DecisionTreeID3();
model.train(X, y);
double prediction = model.predict(new double[] {1.0, 0.0});You can easily switch between models like:
MLModel model = new LogisticRegression();All models implement:
interface MLModel {
void train(double[][] X, double[] y);
double predict(double[] x);
}Metrics to be added soon:
-
Accuracy
-
Precision, Recall, F1-Score
-
Confusion Matrix
-
k-Fold Cross Validation
-
Load datasets from .csv
-
Feature normalization
-
Multiclass classification
-
Cross-validation
-
CLI or JavaFX UI frontend
-
Build as .jar file with CLI flags
-
Graph/tree visualizer for decision trees
High school student (10th grade) | Self-taught programmer | ML & CS enthusiast 🇰🇿 Based in Kazakhstan