ensemblem package
Submodules
ensemblem.metrics module
- ensemblem.metrics.euclidean(point, data)[source]
Euclidean distance is the square root of the sum of the squared differences of their coordinates
- ensemblem.metrics.euclidean_v(x, y)[source]
Vector Euclidean distance is the square root of the sum of the squared differences of their coordinates
- ensemblem.metrics.manhattan_v(x, y)[source]
Vector Manhattan distance is the sum of the absolute differences of their coordinates
- ensemblem.metrics.mean_absolute_percentage_error(actual, predicted)[source]
Local Mean Absolute Percentage Error (LMAPE)
- ensemblem.metrics.metrics_table(actual, predicted, model_name)[source]
Create a table with pivot with results of multiple models and metrics
ensemblem.model module
- class ensemblem.model.KWEnsembler(k=5, bias='False', dist_metric=<function euclidean>)[source]
Bases:
objectKWEnsembler class
This class implements the K-Weighted Ensembler model. It is an ensemble model that uses the k-nearest neighbors of a sample to predict its target value. The weights of the neighbors are calculated using a weight function. The bias of the neighbors can be added to the prediction.
- Parameters
[ParamName] (int, bool, function) – k (default: 5), bias (default: ‘False’), dist_metric (default: euclidean)
- Returns
Predictions of the target values for the test set
- Return type
bytearray
ensemblem.utils module
ensemblem.weights_functions module
- ensemblem.weights_functions.get_k_nearest_neighbors(point, data, k, metric)[source]
Get the k nearest neighbors of a point in a dataset
- ensemblem.weights_functions.get_k_nearest_neighbors_weights(point, data, k, metric, weights)[source]
Get the k nearest neighbors of a point in a dataset weighing the neighbors