[FEATURE REQUEST] Add Perceptron binary classifier
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 78/100
- Issue-Typ
- Feature
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- java
- Bereich
- machine-learning
Rechercherichtung
Beginne damit, die bestehenden Implementierungen von LinearRegression, KNearestNeighbors und MultinomialNaiveBayesClassifier unter src/main/java/com/thealgorithms/machinelearning zu lesen, und sieh dir anschließend den historischen Pull Request als Kontext an. Füge Perceptron.java mit Tests hinzu, die den Konventionen des Repositorys folgen; fertig ist die Aufgabe, wenn separierbare Daten, Vorhersagen für unbekannte Daten und Batch-Vorhersagen, Fehler vor dem Fitten und bei ungültigen Eingaben sowie das dokumentierte Verhalten bei nicht separierbaren Daten funktionieren.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
What would you like to Propose?
Add a Perceptron classifier to src/main/java/com/thealgorithms/machinelearning. The Perceptron is the simplest neural network and would provide an educational binary linear-classification algorithm alongside the existing LinearRegression, KNearestNeighbors, and MultinomialNaiveBayesClassifier implementations.
Issue details
Algorithm name: Perceptron
Problem statement: Given a set of feature vectors and binary class labels, learn a linear decision boundary using the Perceptron learning rule, then classify previously unseen samples. The implementation should make the bias term explicit and document that convergence is guaranteed only for linearly separable data.
Suggested scope:
- Add
Perceptron.javain the machinelearning package. - Use only the Java standard library; no external machine-learning dependency is needed.
- Provide a small, clear API for fitting, predicting one sample, and predicting a batch.
- Support configurable learning rate and maximum epochs, with deterministic zero-weight and zero-bias initialization.
- Validate null or empty data, inconsistent feature dimensions, invalid labels, and invalid hyperparameters with clear exceptions.
- Document the update rule, label convention, and limitations in Javadoc.
Acceptance tests:
- Train on a linearly separable toy dataset such as AND or OR and classify all training samples correctly.
- Verify predictions for unseen samples and batch prediction.
- Verify that prediction before fitting fails clearly.
- Verify invalid labels, mismatched dimensions, null or empty input, and invalid learning-rate or epoch values.
- Include a non-separable-data test that checks documented behavior, such as stopping after the epoch limit without claiming convergence.
A historical pull request, #187, attempted a Perceptron implementation in 2018, but there is no current implementation in the package. This request is for a current Java 21 implementation with tests that follow the repository conventions.
- Vorherrschende Sprache
- Java
- Sterne
- 66.3k
- Forks
- 21.3k
- Ø Merge
- 16 Std. 57 Min.
- Gemergte PRs (30 T.)
- 23
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus TheAlgorithms/Java
-
enhancement
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 78/100
TheAlgorithms/Java#7588 · 2 Kommentare ·
-
enhancement
TheAlgorithms/Java#7579 · 4 Kommentare · 2 zugewiesene Personen ·
-
hacktoberfest help wanted
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 1/100
TheAlgorithms/Java#7546 · 5 Kommentare ·
-
enhancement
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 20/100
TheAlgorithms/Java#6974 · 3 Kommentare ·
Alle Issues in TheAlgorithms/Java
Ähnliche Issues
-
Bug Java Platform: Java
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
getsentry/sentry-java#6138 · 1 Kommentar ·
-
bug needs triage p2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
GoogleCloudPlatform/DataflowTemplates#4273 · 1 Kommentar ·
-
[LNG prod] Release 2.4.6 Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
-
[Studio][Bug] Bulk-deleting a full page of alert rules steps the page back while more rules remain Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
apache/rocketmq-dashboard#4654 · 1 Kommentar ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100