algorithm_evaluation#
- caf.brain.ml.algorithm_evaluation(model_choice, data, output_path, target, custom_index=None, weight=None, classification_prediction=None)[source]#
Evaluate which algorithm is best performing.
Algorithms must be from the Models enum class. It is advised to ensure data is in an optimal state in order to get accurate results. This means data is encoded and scaled where applicable and feature selection is applied. This can be done with:
from caf.brain.ml import feat_selection, transform_data, algorithm_evaluation- Parameters:
model_choice (list[Models] | Models) – List or one algorithm to use as the base of the model. Available algorithms can be seen in _ml_inputs.py or __info__.py.
data (DataFrame) – Pandas Dataframe of your data. Structured or semi-structured tabular format.
target (str) – Column in your data that is the target variable (Y, dependent variable), what you want to predict.
weight (str | None) – Optional string column value to be used as weight.
classification_prediction (tuple[int, ...] | None) – List of integers that correspond to the target column. The value(s) to predict in a classification problem.
custom_index (list[str] | None) – Columns in your data that are to be indexed e.g. year, geography etc.
- Return type:
Initialised best performing model.