<commit_before>import iris from 'js-datasets-iris';
import NeuralNetwork from '../../src/neural-network.js';
iris.shuffle();

const data = iris.data;
let trainingSet = [];

function dressData() {
    data.forEach(row => {
        trainingSet.push({
            input: row.slice(0, 4),
            output: row.slice(4)
        });
    });
}

function mapStringClassesToNumber() {
    let names = new Set();

    trainingSet.forEach(row => {
        names.add(row.output[0]);
    });

    names = [...names];

    trainingSet = trainingSet.map(row=>{
        row.output[0] = names.indexOf(row.output[0]);
        return row;
    });
}

dressData();
mapStringClassesToNumber();

const net = new NeuralNetwork();

net.train(trainingSet, {
    log: true,
});<commit_msg>adjust output<commit_after>import iris from 'js-datasets-iris';
import NeuralNetwork from '../../src/neural-network.js';
iris.shuffle();

const data = iris.data;
let trainingSet = [];

function dressData() {
    data.forEach(row => {
        trainingSet.push({
            input: row.slice(0, 4),
            output: row.slice(4)
        });
    });
}

function mapStringClassesToNumber() {
    let names = new Set();

    trainingSet.forEach(row => {
        names.add(row.output[0]);
    });

    names = [...names];

    trainingSet = trainingSet.map(row=>{
        let index = names.indexOf(row.output[0]);
        row.output = [0,0,0];
        row.output[index] = 1;
        return row;
    });
}

dressData();
mapStringClassesToNumber();

console.log(trainingSet);
// const net = new NeuralNetwork();

// net.train(trainingSet, {
    // log: true,
// });
{'fraction_non_alphanumeric': 0.1716923076923077, 'fraction_numerical': 0.009230769230769232, 'mean_word_length': 2.5973451327433628, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '6480068', 'n_tokens_mistral': 535, 'n_tokens_neox': 525, 'n_words': 103}