class_docstr: Base class for sklearn backend outlier detection algorithms.
class_docstr_tok: ["Base","class","for","sklearn","backend","outlier","detection","algorithms","."]
docstr: Converts input to frontend data format.
  
  This is an interface method that ensures that the output of the outlier detector is in a common format for
  different backends. If `arg` is a `SklearnOutlierDetectorOutput` object, we unpack it into a `dict` and
  return it.
  
  Parameters
  ----------
  x
      Data to convert.
  
  Returns
  -------
  `np.ndarray` or dictionary containing frontend compatible data.
docstr_tok: ["Converts","input","to","frontend","data","format",".","This","is","an","interface","method","that","ensures","that","the","output","of","the","outlier","detector","is","in","a","common","format","for","different","backends",".","If","`","arg","`","is","a","`","SklearnOutlierDetectorOutput","`","object",",","we","unpack","it","into","a","`","dict","`","and","return","it",".","Parameters","--","--","--","--","--","x","Data","to","convert",".","Returns","--","--","--","-","`","np.ndarray","`","or","dictionary","containing","frontend","compatible","data","."]
code: def _to_frontend_dtype(
      arg: Union[np.ndarray, SklearnOutlierDetectorOutput]
  ) -> Union[np.ndarray, Dict[str, np.ndarray]]:
      """Converts input to frontend data format.
  
      This is an interface method that ensures that the output of the outlier detector is in a common format for
      different backends. If `arg` is a `SklearnOutlierDetectorOutput` object, we unpack it into a `dict` and
      return it.
  
      Parameters
      ----------
      x
          Data to convert.
  
      Returns
      -------
      `np.ndarray` or dictionary containing frontend compatible data.
      """
      if isinstance(arg, SklearnOutlierDetectorOutput):
          return asdict(arg)
      return arg
  
imports: from typing import List, Union, Optional, Dict
  from dataclasses import dataclass, asdict
  from abc import ABC, abstractmethod
  from typing_extensions import Self
  import numpy
  from alibi_detect.exceptions import NotFittedError, ThresholdNotInferredError
label_desc: Use image node_id 3 for calling the SklearnOutlierDetector obj's underlying member method code with example usage: obj._to_frontend_dtype(arg) and returns: arg, asdict