pqagent.pqagent moduleο
- class pqagent.pqagent.PqAgent(config_path: str = None, name: str = 'default')[source]ο
Bases:
object- evaluate_model(dataset: DataSet, model_to_use: str) dict[source]ο
Evaluates the performance of a model on a given dataset. This method applies the selected model to the provided dataset, generates predictions, and computes evaluation metrics. It returns both the calculated metrics and the predictions for further analysis.
- Parameters:
dataset (DataSet) β The dataset on which the modelβs performance is to be evaluated. Should contain the data and corresponding labels.
model_to_use β A string specifying the model to be used for predictions.
- Returns:
A dictionary containing evaluation metrics and a DataFrame with the generated predictions.
- Return type:
tuple(dict, pd.DataFrame)
- property get_models: listο
- load_model_from_checkpoint(model_name: str, trial_id: str = None, checkpoint_path: str = None) None[source]ο
- predict(data: DataSet | DataFrame, model_to_use: str, get_comparison: bool = False) DataFrame[source]ο
- preprocessor: Preprocessorο
- retrain(dataset: DataSet, base_model: str, strategy: Callable, model_name: str | None = None, update_config_path: str = None) None[source]ο
- save(file_path: str = None, folder_path: str = None) None[source]ο
Save the model and preprocessor to a specified file or folder.
Parameters: - file_path (str, optional): The path to save the file directly. - folder_path (str, optional): The folder path to save the file with a default naming convention.
Raises: - ValueError: If neither file_path nor folder_path is provided.
- train_model(data: DataSet, model_name: str = 'base', train_val_split_feature_groups: list = None, save_train_data: bool = False) None[source]ο