sharkpy.explaining

Attributes

explain_with_shapash

Functions

_create_temp_plot(→ str)

Create a temporary plot and return its path

_add_table_to_doc(doc, df, title)

Helper function to add a pandas DataFrame as a table to DOCX

_add_metrics_table_to_doc(doc, cv_results, train_metrics)

Add performance metrics table to DOCX document

_export_deep_explanation_docx(docx_path, ...[, depth])

Export explanation to DOCX with specified depth level

_convert_docx_to_pdf(docx_path, pdf_path)

Convert DOCX to PDF using docx2pdf

_get_data_insights(features, target, target_name, ...)

Extract dynamic insights from the data

explain_model(model, features, target, target_name[, ...])

Generate model explanation with customizable depth and export options

demo_explanation()

Demo the explanation system

Module Contents

sharkpy.explaining.explain_with_shapash = None[source]
sharkpy.explaining._create_temp_plot(model, features, target, kind: str, width: int = 8, height: int = 6) str[source]

Create a temporary plot and return its path

sharkpy.explaining._add_table_to_doc(doc: docx.Document, df: pandas.DataFrame, title: str)[source]

Helper function to add a pandas DataFrame as a table to DOCX

sharkpy.explaining._add_metrics_table_to_doc(doc: docx.Document, cv_results, train_metrics)[source]

Add performance metrics table to DOCX document

sharkpy.explaining._export_deep_explanation_docx(docx_path, deep_explanation, model, features, target, feature_df, depth='deep')[source]

Export explanation to DOCX with specified depth level

sharkpy.explaining._convert_docx_to_pdf(docx_path, pdf_path)[source]

Convert DOCX to PDF using docx2pdf

sharkpy.explaining._get_data_insights(features, target, target_name, data, label_encoder, is_regression)[source]

Extract dynamic insights from the data

sharkpy.explaining.explain_model(model, features, target, target_name, data=None, label_encoder=None, cv_results=None, train_metrics=None, export_path=None, format='txt', depth='deep')[source]

Generate model explanation with customizable depth and export options

sharkpy.explaining.demo_explanation()[source]

Demo the explanation system