Utils module

pyro_risks.models.utils.check_x(X: pandas.core.frame.DataFrame)pandas.core.frame.DataFrame[source]

Validate inputs for tranformers.

Parameters

X – Training dataset features pd.DataFrame.

Raises

TypeError – Transformer methods expect pd.DataFrame as inputs.

Returns

Copy of the inputs.

pyro_risks.models.utils.check_xy(X: pandas.core.frame.DataFrame, y: pandas.core.series.Series)Tuple[pandas.core.frame.DataFrame, pandas.core.series.Series][source]

Validate inputs for transformers.

Parameters
  • X – Training dataset features pd.DataFrame.

  • y – Training dataset target pd.Series.

Raises

TypeError – Transformer methods expect pd.DataFrame and pd.Series as inputs.

Returns

Copy of the inputs.

pyro_risks.models.utils.discretizer(x: float)int[source]

Discretize values.

Parameters

x (python:float) – value to be discretized

Returns

discretized value

Return type

int