Machine Learningο
This module contains Machine Learning tools.
Created on Wed Sep 8 00:00:00 2021
@author: Jose Manuel Tapia Avitia, e-mail: josetapia@exatec.tec.mx
This module provides Machine Learning utilities that can power a neural-network-based hyper-heuristic. It wraps TensorFlow models and includes data-processing pipelines for operator-sequence prediction.
Note
This module requires TensorFlow. Install it with pip install customhys[ml].
Key classes:
DatasetSequencesβ converts raw operator sequences and fitness values into training samples suitable for supervised learning.ModelPredictorβ a configurable feed-forward neural network for predicting the next operator in a sequence.
Quick usage:
from customhys.machine_learning import DatasetSequences, ModelPredictor
ds = DatasetSequences(sequences, fitnesses, num_operators=13)
model = ModelPredictor(num_operators=13)
model.train(ds)
- customhys.machine_learning.obtain_sample_weight(sample_fitness, fitness_to_weight='rank')[source]ο
Using decreasing functions to give more priority to samples with less fitness :param list sample_fitness: The fitness associated value for each sample :param str fitness_to_weight: Specify which function use to convert fitness to weight :return: An array that associates a weight to each sample
- class customhys.machine_learning.DatasetSequences(sequences, fitnesses, num_operators=None, fitness_to_weight=None)[source]ο
Bases:
object