sharkpy.explaining ================== .. py:module:: sharkpy.explaining Attributes ---------- .. autoapisummary:: sharkpy.explaining.explain_with_shapash Functions --------- .. autoapisummary:: sharkpy.explaining._create_temp_plot sharkpy.explaining._add_table_to_doc sharkpy.explaining._add_metrics_table_to_doc sharkpy.explaining._export_deep_explanation_docx sharkpy.explaining._convert_docx_to_pdf sharkpy.explaining._get_data_insights sharkpy.explaining.explain_model sharkpy.explaining.demo_explanation Module Contents --------------- .. py:data:: explain_with_shapash :value: None .. py:function:: _create_temp_plot(model, features, target, kind: str, width: int = 8, height: int = 6) -> str Create a temporary plot and return its path .. py:function:: _add_table_to_doc(doc: docx.Document, df: pandas.DataFrame, title: str) Helper function to add a pandas DataFrame as a table to DOCX .. py:function:: _add_metrics_table_to_doc(doc: docx.Document, cv_results, train_metrics) Add performance metrics table to DOCX document .. py:function:: _export_deep_explanation_docx(docx_path, deep_explanation, model, features, target, feature_df, depth='deep') Export explanation to DOCX with specified depth level .. py:function:: _convert_docx_to_pdf(docx_path, pdf_path) Convert DOCX to PDF using docx2pdf .. py:function:: _get_data_insights(features, target, target_name, data, label_encoder, is_regression) Extract dynamic insights from the data .. py:function:: 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') Generate model explanation with customizable depth and export options .. py:function:: demo_explanation() Demo the explanation system