geochemistrypi.data_mining.utils package#
Submodules#
geochemistrypi.data_mining.utils.base module#
- check_package(package_name: str) bool[source]#
Check whether the package is installed.
- Parameters:
package_name (str) – The name of the package.
- Returns:
Whether the package is installed.
- Return type:
bool
- create_geopi_output_dir(experiment_name: str, run_name: str, sub_run_name: str | None = None) None[source]#
Create the output directory for the current run and store the related pathes as environment variable.
- Parameters:
experiment_name (str) – The name of the experiment.
run_name (str) – The name of the run.
sub_run_name (str, default=None) – The name of the sub run.
- install_package(package_name: str) None[source]#
Install the package.
- Parameters:
package_name (str) – The name of the package.
- save_data(df: DataFrame, df_name: str, local_data_path: str, mlflow_artifact_data_path: str | None = None, index: bool = False) None[source]#
Save the dataset in the local directory and in mlflow specialized directory.
- Parameters:
df (pd.DataFrame) – The dataset to store.
df_name (str) – The name of the data sheet.
local_data_path (str) – The path to store the data sheet
mlflow_artifact_data_path (str, default=None) – The path to store the data sheet in mlflow.
index (bool, default=False) – Whether to write the index.
- save_fig(fig_name: str, local_image_path: str, mlflow_artifact_image_path: str | None = None, tight_layout: bool = True) None[source]#
Save the figure in the local directory and in mlflow specialized directory.
- Parameters:
fig_name (str) – Figure name.
local_image_path (str) – The path to store the image.
mlflow_artifact_image_path (str, default=None) – The path to store the image in mlflow.
tight_layout (bool, default=True) – Automatically adjust subplot parameters to give specified padding.
- save_model(model: object, model_name: str, data_sample: DataFrame, local_model_path: str, mlflow_artifact_model_path: str | None = None) None[source]#
Save the model in the local directory and in mlflow specialized directory.
- Parameters:
model (object) – The model to store.
model_name (str) – The name of the model.
data_sample (pd.DataFrame) – The sample of the dataset.
local_model_path (str) – The path to store the model.
mlflow_artifact_model_path (str, default=None) – The path to store the model in mlflow.
- save_text(string: str, text_name: str, local_text_path: str, mlflow_artifact_text_path: str | None = None) None[source]#
Save the text.
- Parameters:
string (str) – The text to store.
text_name (str) – The name of the text.
local_text_path (str) – The path to store the text.
mlflow_artifact_text_path (str, default=None) – The path to store the text in mlflow.