<commit_before>#pragma once
#include "species.hpp"
#include "species_manager.hpp"
#include "data.hpp"
#include "trained/neural_network.hpp"
#include "trained/classifier.hpp"
#include "utility/logger.hpp"
#include "body/supervised_learning.hpp"


#include <vector>
#include <memory>

namespace Hippocrates::Training {

class NeuralNetworkTrainer {
public:
	bool loggingEnabled = false;

private:
	SpeciesManager species;
	Utility::Logger logger;
	size_t generationsPassed = 0;

public:
	auto TrainUnsupervised(SpeciesManager::Bodies& bodies) -> Trained::NeuralNetwork;
	template <typename Classification, std::size_t ClassificationCount>
	auto TrainSupervised(const Data<Classification, ClassificationCount>& data, std::size_t trainingInstances) -> Trained::Classifier<Classification>;
	
	auto GetGenerationsPassed() const { return generationsPassed; }

	auto GetJSON() const -> std::string;


private:
	auto TrainGenerationAndLogUsingBodies(SpeciesManager::Bodies& bodies) -> void;
};

template <typename Classification, std::size_t ClassificationCount>
auto NeuralNetworkTrainer::TrainSupervised(const Data<Classification, ClassificationCount>& data, std::size_t trainingInstances) -> Trained::Classifier<Classification> {
	using supervised_body_t = Body::SupervisedLearning<Classification, ClassificationCount>;
	std::vector<supervised_body_t> bodies;
	bodies.reserve(trainingInstances);
	for (std::size_t i = 0; i < trainingInstances; ++i) {
		supervised_body_t body(data);
		bodies.push_back(std::move(body));
	}
	SpeciesManager::Bodies bodyRefs(bodies.begin(), bodies.end());
	auto champ = TrainUnsupervised(bodyRefs);
	return Trained::Classifier<Classification>(std::move(champ));
}

}<commit_msg>Add magic standard value for ugly ease of use<commit_after>#pragma once
#include "species.hpp"
#include "species_manager.hpp"
#include "data.hpp"
#include "trained/neural_network.hpp"
#include "trained/classifier.hpp"
#include "utility/logger.hpp"
#include "body/supervised_learning.hpp"


#include <vector>
#include <memory>

namespace Hippocrates::Training {

class NeuralNetworkTrainer {
public:
	bool loggingEnabled = false;

private:
	SpeciesManager species;
	Utility::Logger logger;
	size_t generationsPassed = 0;

public:
	auto TrainUnsupervised(SpeciesManager::Bodies& bodies) -> Trained::NeuralNetwork;
	template <typename Classification, std::size_t ClassificationCount>
	auto TrainSupervised(const Data<Classification, ClassificationCount>& data, std::size_t trainingInstances) -> Trained::Classifier<Classification>;
	
	auto GetGenerationsPassed() const { return generationsPassed; }

	auto GetJSON() const -> std::string;


private:
	auto TrainGenerationAndLogUsingBodies(SpeciesManager::Bodies& bodies) -> void;
};

template <typename Classification, std::size_t ClassificationCount>
auto NeuralNetworkTrainer::TrainSupervised(const Data<Classification, ClassificationCount>& data, std::size_t trainingInstances = 200) -> Trained::Classifier<Classification> {
	using supervised_body_t = Body::SupervisedLearning<Classification, ClassificationCount>;
	std::vector<supervised_body_t> bodies;
	bodies.reserve(trainingInstances);
	for (std::size_t i = 0; i < trainingInstances; ++i) {
		supervised_body_t body(data);
		bodies.push_back(std::move(body));
	}
	SpeciesManager::Bodies bodyRefs(bodies.begin(), bodies.end());
	auto champ = TrainUnsupervised(bodyRefs);
	return Trained::Classifier<Classification>(std::move(champ));
}

}
{'fraction_non_alphanumeric': 0.11759581881533102, 'fraction_numerical': 0.0020325203252032522, 'mean_word_length': 8.235924932975871, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 35, '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': '6610750', 'n_tokens_mistral': 1102, 'n_tokens_neox': 1025, 'n_words': 221}