class_docstr: Allows discretisation of continuous features using mdlp algorithm
  
  Example:
  ::
      >>> import pandas as pd
      >>> import numpy as np
      >>> from causalnex.discretiser.discretiser_strategy import MDLPSupervisedDiscretiserMethod
      >>> from sklearn.datasets import load_iris
      >>> iris = load_iris()
      >>> X, y = iris["data"], iris["target"]
      >>> names = iris["feature_names"]
      >>> data = pd.DataFrame(X, columns=names)
      >>> data["target"] = y
      >>> discretiser = MDLPSupervisedDiscretiserMethod(
      >>>     {"min_depth": 0, "random_state": 2020, "min_split": 1e-3, "dtype": int}
      >>> )
      >>> discretiser.fit(
      >>>     feat_names=["sepal length (cm)"],
      >>>     dataframe=data,
      >>>     target="target",
      >>>     target_continuous=False,
      >>> )
      >>> discretised_data = discretiser.transform(data[["sepal length (cm)"]])
      >>> discretised_data.values.ravel()
  
      array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0,
             0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
             0, 0, 0, 0, 0, 0, 2, 2, 2, 1, 2, 1, 2, 0, 2, 0, 0, 2, 2, 2, 1, 2,
             1, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 2, 0, 2, 2, 2,
             1, 1, 1, 2, 1, 0, 1, 1, 1, 2, 0, 1, 2, 1, 2, 2, 2, 2, 0, 2, 2, 2,
             2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
             2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2])
class_docstr_tok: ["Allows","discretisation","of","continuous","features","using","mdlp","algorithm","Example",":",":",":",">",">",">","import","pandas","as","pd",">",">",">","import","numpy","as","np",">",">",">","from","causalnex.discretiser.discretiser_strategy","import","MDLPSupervisedDiscretiserMethod",">",">",">","from","sklearn.datasets","import","load_iris",">",">",">","iris","=","load_iris","(",")",">",">",">","X",",","y","=","iris","[","``","data","''","]",",","iris","[","``","target","''","]",">",">",">","names","=","iris","[","``","feature_names","''","]",">",">",">","data","=","pd.DataFrame","(","X",",","columns=names",")",">",">",">","data","[","``","target","''","]","=","y",">",">",">","discretiser","=","MDLPSupervisedDiscretiserMethod","(",">",">",">","{","``","min_depth","''",":","0",",","``","random_state","''",":","2020",",","``","min_split","''",":","1e-3",",","``","dtype","''",":","int","}",">",">",">",")",">",">",">","discretiser.fit","(",">",">",">","feat_names=","[","``","sepal","length","(","cm",")","''","]",",",">",">",">","dataframe=data",",",">",">",">","target=","''","target","''",",",">",">",">","target_continuous=False",",",">",">",">",")",">",">",">","discretised_data","=","discretiser.transform","(","data","[","[","``","sepal","length","(","cm",")","''","]","]",")",">",">",">","discretised_data.values.ravel","(",")","array","(","[","0",",","0",",","0",",","0",",","0",",","0",",","0",",","0",",","0",",","0",",","0",",","0",",","0",",","0",",","1",",","1",",","0",",","0",",","1",",","0",",","0",",","0",",","0",",","0",",","0",",","0",",","0",",","0",",","0",",","0",",","0",",","0",",","0",",","1",",","0",",","0",",","1",",","0",",","0",",","0",",","0",",","0",",","0",",","0",",","0",",","0",",","0",",","0",",","0",",","0",",","2",",","2",",","2",",","1",",","2",",","1",",","2",",","0",",","2",",","0",",","0",",","2",",","2",",","2",",","1",",","2",",","1",",","1",",","2",",","1",",","2",",","2",",","2",",","2",",","2",",","2",",","2",",","2",",","2",",","1",",","1",",","1",",","1",",","2",",","0",",","2",",","2",",","2",",","1",",","1",",","1",",","2",",","1",",","0",",","1",",","1",",","1",",","2",",","0",",","1",",","2",",","1",",","2",",","2",",","2",",","2",",","0",",","2",",","2",",","2",",","2",",","2",",","2",",","1",",","1",",","2",",","2",",","2",",","2",",","2",",","2",",","1",",","2",",","2",",","2",",","2",",","2",",","2",",","2",",","2",",","2",",","2",",","2",",","2",",","2",",","2",",","2",",","2",",","2",",","2",",","2",",","2",",","1",",","2",",","2",",","2",",","2",",","2",",","2",",","2","]",")"]
docstr: This method of discretisation applies MDLP to discretise the data
  
  Args:
      min_depth: The minimum depth of the interval splitting.
      min_split: The minmum size to split a bin
      dtype: The type of the array returned by the `transform()` method
      **dlp_args: keyword arguments, which are parameters used for `mdlp.discretization.MDLP`
  Raises:
      ImportError: if mdlp-discretization is not installed successfully
docstr_tok: ["This","method","of","discretisation","applies","MDLP","to","discretise","the","data","Args",":","min_depth",":","The","minimum","depth","of","the","interval","splitting",".","min_split",":","The","minmum","size","to","split","a","bin","dtype",":","The","type","of","the","array","returned","by","the","`","transform","(",")","`","method","*","*","dlp_args",":","keyword","arguments",",","which","are","parameters","used","for","`","mdlp.discretization.MDLP","`","Raises",":","ImportError",":","if","mdlp-discretization","is","not","installed","successfully"]
code: def __init__(
      self,
      mdlp_args: Dict[str, Any] = None,
  ):
      """
      This method of discretisation applies MDLP to discretise the data
  
      Args:
          min_depth: The minimum depth of the interval splitting.
          min_split: The minmum size to split a bin
          dtype: The type of the array returned by the `transform()` method
          **dlp_args: keyword arguments, which are parameters used for `mdlp.discretization.MDLP`
      Raises:
          ImportError: if mdlp-discretization is not installed successfully
      """
      super().__init__()
      mdlp_args = mdlp_args or {
          "min_depth": 0,
          "min_split": 1e-3,
          "dtype": int,
      }
      self.mdlp_args = mdlp_args
      self.feat_names = None
      self.map_feat_transformer = {}
      if MDLP is None:
          raise ImportError(
              "mdlp-discretisation was not installed and imported successfully"
          )
      self.mdlp = MDLP(**mdlp_args)
  
file_path: causalnex/causalnex/discretiser/discretiser_strategy.py
imports: import logging
  from copy import deepcopy
  from typing import Any, Dict, List
  import pandas
  from sklearn.tree import DecisionTreeClassifier, DecisionTreeRegressor
  from causalnex.discretiser.abstract_discretiser import AbstractSupervisedDiscretiserMethod
  from causalnex.utils.decision_tree_tools import extract_thresholds_from_dtree
label_desc: Use image node_id 1 to create a new MDLPSupervisedDiscretiserMethod object from inherited base classes: AbstractSupervisedDiscretiserMethod with example: obj = MDLPSupervisedDiscretiserMethod(mdlp_args)