Skip to content

Latest commit

 

History

History
80 lines (49 loc) · 2.81 KB

concrete.ml.common.check_inputs.md

File metadata and controls

80 lines (49 loc) · 2.81 KB

module concrete.ml.common.check_inputs

Check and conversion tools.

Utils that are used to check (including convert) some data types which are compatible with scikit-learn to numpy types.


function check_array_and_assert

check_array_and_assert(X, *args, **kwargs)

sklearn.utils.check_array with an assert.

Equivalent of sklearn.utils.check_array, with a final assert that the type is one which is supported by Concrete ML.

Args:

  • X (object): Input object to check / convert
  • *args: The arguments to pass to check_array
  • **kwargs: The keyword arguments to pass to check_array

Returns: The converted and validated array


function check_X_y_and_assert

check_X_y_and_assert(X, y, *args, **kwargs)

sklearn.utils.check_X_y with an assert.

Equivalent of sklearn.utils.check_X_y, with a final assert that the type is one which is supported by Concrete ML.

Args:

  • X (ndarray, list, sparse matrix): Input data
  • y (ndarray, list, sparse matrix): Labels
  • *args: The arguments to pass to check_X_y
  • **kwargs: The keyword arguments to pass to check_X_y

Returns: The converted and validated arrays


function check_X_y_and_assert_multi_output

check_X_y_and_assert_multi_output(X, y, *args, **kwargs)

sklearn.utils.check_X_y with an assert and multi-output handling.

Equivalent of sklearn.utils.check_X_y, with a final assert that the type is one which is supported by Concrete ML. If y is 2D, allows multi-output.

Args:

  • X (ndarray, list, sparse matrix): Input data
  • y (ndarray, list, sparse matrix): Labels
  • *args: The arguments to pass to check_X_y
  • **kwargs: The keyword arguments to pass to check_X_y

Returns: The converted and validated arrays with multi-output targets.