<commit_before>package machinelearning.kmeans;

import static org.junit.Assert.assertTrue;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

import org.junit.Test;

public class KMeansAlgorithmDoubleTest {

    @Test
    public void testApply() {
        String scoringMethod = "basic";
        List<Double> dataTest = new ArrayList<Double>();
        dataTest.add(0.15);
        dataTest.add(1.23);
        dataTest.add(2.4);
        dataTest.add(-1.5);
        dataTest.add(-43.9);
        dataTest.add(-27.5);
        dataTest.add(-30.5);
        dataTest.add(-40.5);
        dataTest.add(45.9);
        dataTest.add(33.3);
        dataTest.add(44.6);
        dataTest.add(25.3);
        KMeansAlgorithm<Double> doubleKMAlgorithm = new KMeansAlgorithm<Double>(dataTest, 3, new DoubleTool());
        doubleKMAlgorithm.runMultipleTime(10, scoringMethod);
        List<Cluster<Double>> clusters = doubleKMAlgorithm.getClusters();
        System.out.println("Resultats : \n\n\n");
        for (Cluster<Double> cluster : clusters) {
            System.out.println(cluster.getCentroid() + "\n");
            String pointsOfCluster = cluster.getPoints().stream()
                    .map(i -> i.toString())
                    .collect(Collectors.joining(", "));
            System.out.println(pointsOfCluster + "\n\n");
        }
        assertTrue(clusters.size() == 3);
        assertTrue(clusters.get(0).getSize() == 4);
        assertTrue(clusters.get(1).getSize() == 4);
        assertTrue(clusters.get(2).getSize() == 4);
    }
}<commit_msg>Small correction : suppress specification of a list<commit_after>package machinelearning.kmeans;

import static org.junit.Assert.assertTrue;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

import org.junit.Test;

public class KMeansAlgorithmDoubleTest {

    @Test
    public void testApply() {
        String scoringMethod = "silhouette";
        List<Double> dataTest = new ArrayList<Double>();
        dataTest.add(0.15);
        dataTest.add(1.23);
        dataTest.add(2.4);
        dataTest.add(-1.5);
        dataTest.add(-43.9);
        dataTest.add(-27.5);
        dataTest.add(-30.5);
        dataTest.add(-40.5);
        dataTest.add(45.9);
        dataTest.add(33.3);
        dataTest.add(44.6);
        dataTest.add(25.3);
        KMeansAlgorithm<Double> doubleKMAlgorithm = new KMeansAlgorithm<>(dataTest, 3, new DoubleTool());
        doubleKMAlgorithm.runMultipleTime(10, scoringMethod);
        List<Cluster<Double>> clusters = doubleKMAlgorithm.getClusters();
        System.out.println("Resultats : \n\n\n");
        for (Cluster<Double> cluster : clusters) {
            System.out.println(cluster.getCentroid() + "\n");
            String pointsOfCluster = cluster.getPoints().stream()
                    .map(i -> i.toString())
                    .collect(Collectors.joining(", "));
            System.out.println(pointsOfCluster + "\n\n");
        }
        assertTrue(clusters.size() == 3);
        assertTrue(clusters.get(0).getSize() == 4);
        assertTrue(clusters.get(1).getSize() == 4);
        assertTrue(clusters.get(2).getSize() == 4);
    }
}
{'fraction_non_alphanumeric': 0.14882995319812792, 'fraction_numerical': 0.027457098283931357, 'mean_word_length': 2.523076923076923, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2561693', 'n_tokens_mistral': 1021, 'n_tokens_neox': 979, 'n_words': 156}