pvcracks.powerloss subpackage

Created on Mon Aug 7 12:04:49 2023

@authors: nrjost

pvcracks.powerloss.powerloss_functions.load_xgb_models(pmpp_model_path: str = 'xgb_model_pmpp_diff_percent_3CH.pkl', voc_model_path: str = 'xgb_model_Voc_diff_percent_3CH.pkl')[source]
Load two XGBoost models from disk:
  • A model trained on pmpp_diff_% (power loss %)

  • A model trained on Voc_diff_%

Parameters
  • pmpp_model_path (str) – Path to the pickle file for the pmpp_diff_% model.

  • voc_model_path (str) – Path to the pickle file for the Voc_diff_% model.

Returns

pmpp_model, voc_model – The loaded XGBRegressor models.

Return type

xgboost.XGBRegressor

pvcracks.powerloss.powerloss_functions.predict_power_and_voc(latent_vectors, pmpp_model, voc_model) DataFrame[source]
Given latent vectors, predict:
  • power loss (%) using the pmpp model

  • Voc difference (%) using the Voc model

Parameters
  • latent_vectors (array-like) –

    Either
    • a 2D numpy array of shape (n_samples, latent_dim), or

    • a 1D object-dtype numpy array / list of 1D arrays (each of length latent_dim)

  • pmpp_model (xgboost.XGBRegressor) – Loaded model for pmpp_diff_%.

  • voc_model (xgboost.XGBRegressor) – Loaded model for Voc_diff_%.

Returns

results

DataFrame with columns:
  • ”power_loss_%”

  • ”Voc_diff_%”

and one row per input latent vector.

Return type

pandas.DataFrame