Reformat code
This commit is contained in:
1 parent
51c12cc0ea
commit
60c654936a
31 files changed
+262
-466
No files matched your search
@@ -2,21 +2,22 @@ package machine_learning.perceptron;
|
||||
|
||||
import machine_learning.DataClass;
|
||||
import machine_learning.Vector;
|
||||
import org.junit.jupiter.api.*;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestInstance;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||
class PerceptronTest
|
||||
{
|
||||
class PerceptronTest {
|
||||
List<Vector> positives;
|
||||
List<Vector> negatives;
|
||||
Perceptron perceptron;
|
||||
|
||||
@BeforeAll
|
||||
void initLearnData()
|
||||
{
|
||||
void initLearnData() {
|
||||
final double biasUnit = 1d;
|
||||
this.positives = new ArrayList<>(List.of(
|
||||
new Vector(8d, 4d, biasUnit),
|
||||
@@ -37,8 +38,7 @@ class PerceptronTest
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldClassifyVectorCorrectAsNegative()
|
||||
{
|
||||
void shouldClassifyVectorCorrectAsNegative() {
|
||||
final var vector = new Vector(0d, 0d, 1d);
|
||||
|
||||
final var actualClass = this.perceptron.classify(vector);
|
||||
@@ -48,8 +48,7 @@ class PerceptronTest
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldClassifyVectorCorrectAsPositive()
|
||||
{
|
||||
void shouldClassifyVectorCorrectAsPositive() {
|
||||
final var vector = new Vector(9d, 3d, 1d);
|
||||
|
||||
final var actualClass = this.perceptron.classify(vector);
|
||||
|
||||
Reference in new issue
Block a user