From 42f5e83b50e346f41f92efb2e6cba16ef66eae5a Mon Sep 17 00:00:00 2001 From: Niklas Birk Date: Tue, 13 Apr 2021 18:20:47 +0200 Subject: [PATCH] add final to some variables --- src/machine_learning/nearest_neighbour/CrossValidation.java | 4 ++-- src/machine_learning/nearest_neighbour/KNearestNeighbour.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/machine_learning/nearest_neighbour/CrossValidation.java b/src/machine_learning/nearest_neighbour/CrossValidation.java index f19f4d6..8087217 100644 --- a/src/machine_learning/nearest_neighbour/CrossValidation.java +++ b/src/machine_learning/nearest_neighbour/CrossValidation.java @@ -12,8 +12,8 @@ import java.util.stream.IntStream; public class CrossValidation { - private int paramMin; - private int paramMax; + private final int paramMin; + private final int paramMax; public CrossValidation(int paramMin, int paramMax) { diff --git a/src/machine_learning/nearest_neighbour/KNearestNeighbour.java b/src/machine_learning/nearest_neighbour/KNearestNeighbour.java index 2dea8c7..6e63038 100644 --- a/src/machine_learning/nearest_neighbour/KNearestNeighbour.java +++ b/src/machine_learning/nearest_neighbour/KNearestNeighbour.java @@ -15,9 +15,9 @@ public class KNearestNeighbour implements MachineLearning private List positives; private List negatives; - private Distance distance; + private final Distance distance; - private int k; + private final int k; public KNearestNeighbour(Distance distance) {