class_docstr: The ProjectReport class allows to generate general information about a
  Data Science project.
  It analyzes the data and the model used in order to provide interesting
  insights that can be shared with non technical person.
  
  Parameters
  ----------
  explainer : shapash.explainer.smart_explainer.SmartExplainer
      A shapash SmartExplainer object that has already be compiled.
  project_info_file : str
      Path to the yml file containing information about the project (author, description, ...).
  config : dict, optional
      Contains configuration options for the report.
  
  Attributes
  ----------
  explainer : shapash.explainer.smart_explainer.SmartExplainer
       A shapash SmartExplainer object that has already be compiled.
  metadata : dict
      Information about the project (author, description, ...).
  x_train : pd.DataFrame
      DataFrame used for training the model.
  y_test : pd.Series or pd.DataFrame
      Series of labels in the train set.
  y_test : pd.Series or pd.DataFrame
      Series of labels in the test set.
  config : dict, optional
      Configuration options for the report.
class_docstr_tok: ["The","ProjectReport","class","allows","to","generate","general","information","about","a","Data","Science","project",".","It","analyzes","the","data","and","the","model","used","in","order","to","provide","interesting","insights","that","can","be","shared","with","non","technical","person",".","Parameters","--","--","--","--","--","explainer",":","shapash.explainer.smart_explainer.SmartExplainer","A","shapash","SmartExplainer","object","that","has","already","be","compiled",".","project_info_file",":","str","Path","to","the","yml","file","containing","information","about","the","project","(","author",",","description",",","...",")",".","config",":","dict",",","optional","Contains","configuration","options","for","the","report",".","Attributes","--","--","--","--","--","explainer",":","shapash.explainer.smart_explainer.SmartExplainer","A","shapash","SmartExplainer","object","that","has","already","be","compiled",".","metadata",":","dict","Information","about","the","project","(","author",",","description",",","...",")",".","x_train",":","pd.DataFrame","DataFrame","used","for","training","the","model",".","y_test",":","pd.Series","or","pd.DataFrame","Series","of","labels","in","the","train","set",".","y_test",":","pd.Series","or","pd.DataFrame","Series","of","labels","in","the","test","set",".","config",":","dict",",","optional","Configuration","options","for","the","report","."]
code: def __init__(
      self,
      explainer: SmartExplainer,
      project_info_file: str,
      x_train: Optional[pd.DataFrame] = None,
      y_train: Optional[pd.DataFrame] = None,
      y_test: Optional[pd.DataFrame] = None,
      config: Optional[dict] = None,
  ):
      self.explainer = explainer
      self.metadata = load_yml(path=project_info_file)
      self.x_train_init = x_train
      if x_train is not None:
          x_train_pre = inverse_transform(
              x_train, self.explainer.preprocessing
          )
          self.x_train_pre = handle_categorical_missing(x_train_pre)
  
          if self.explainer.postprocessing:
              self.x_train_pre = apply_postprocessing(
                  self.x_train_pre, self.explainer.postprocessing
              )
      else:
          self.x_train_pre = None
      self.x_init = self.explainer.x_init
      self.config = config if config is not None else dict()
      self.col_names = list(self.explainer.columns_dict.values())
      self.df_train_test = self._create_train_test_df(
          test=self.x_init, train=self.x_train_pre
      )
      if self.explainer.y_pred is not None:
          self.y_pred = np.array(self.explainer.y_pred.T)[0]
      else:
          self.y_pred = self.explainer.model.predict(
              self.explainer.x_encoded
          )
      self.y_test, target_name_test = self._get_values_and_name(
          y_test, "target"
      )
      self.y_train, target_name_train = self._get_values_and_name(
          y_train, "target"
      )
      self.target_name = target_name_train or target_name_test
  
      if "title_story" in self.config.keys():
          self.title_story = config["title_story"]
      elif self.explainer.title_story != "":
          self.title_story = self.explainer.title_story
      else:
          self.title_story = "Shapash report"
      self.title_description = (
          self.config["title_description"]
          if "title_description" in self.config.keys()
          else ""
      )
  
      print_css_style()
      print_javascript_misc()
  
      if "metrics" in self.config.keys():
          if not isinstance(
              self.config["metrics"], list
          ) or not isinstance(self.config["metrics"][0], dict):
              raise ValueError(
                  "The metrics parameter expects a list of dict."
              )
          for metric in self.config["metrics"]:
              for key in metric:
                  if key not in ["path", "name", "use_proba_values"]:
                      raise ValueError(
                          f"Unknown key : {key}. Key should be in ['path', 'name', 'use_proba_values']"
                      )
                  if key == "use_proba_values" and not isinstance(
                      metric["use_proba_values"], bool
                  ):
                      raise ValueError(
                          '"use_proba_values" metric key expects a boolean value.'
                      )
  
imports: from typing import Optional, Union, Tuple
  import logging
  import sys
  import os
  from numbers import Number
  from datetime import date
  import jinja2
  import pandas
  import numpy
  import plotly
  from shapash.utils.transform import inverse_transform, apply_postprocessing, handle_categorical_missing
  from shapash import SmartExplainer
  from shapash.utils.io import load_yml
  from shapash.utils.utils import get_project_root, truncate_str
  from shapash.report.visualisation import print_md, print_html, print_css_style, convert_fig_to_html, print_javascript_misc
  from shapash.report.data_analysis import perform_global_dataframe_analysis, perform_univariate_dataframe_analysis
  from shapash.report.plots import generate_fig_univariate, generate_confusion_matrix_plot
  from shapash.report.common import series_dtype, get_callable, compute_col_types, VarType, display_value
  from shapash.webapp.utils.utils import round_to_k
label_desc: Use image node_id 1 to create a new ProjectReport object  with example: obj = ProjectReport(explainer, project_info_file, x_train, y_train, y_test, config)