Skip to content

Commit

Permalink
test(frontend): add test for get_n_split method for KFold in sklearn …
Browse files Browse the repository at this point in the history
…frontend
  • Loading branch information
Ishticode committed Aug 31, 2023
1 parent 91741fb commit 2fa8095
Showing 1 changed file with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,40 @@ def test_sklearn_kfold_split(
)


@handle_frontend_method(
class_tree=CLASS_TREE,
init_tree="sklearn.model_selection.KFold",
method_name="get_n_splits",
dtype_x=helpers.dtype_and_values(),
)
def test_sklearn_kfold_get_n_split(
dtype_x,
frontend,
frontend_method_data,
init_flags,
method_flags,
on_device,
backend_fw,
):
input_dtype, x = dtype_x
helpers.test_frontend_method(
init_input_dtypes=input_dtype,
init_all_as_kwargs_np={
"n_splits": 2, # this arg only for compatibility
},
method_input_dtypes=input_dtype,
method_all_as_kwargs_np={
"X": x[0],
},
frontend_method_data=frontend_method_data,
init_flags=init_flags,
method_flags=method_flags,
frontend=frontend,
on_device=on_device,
backend_to_test=backend_fw,
)


@handle_frontend_test(
fn_tree="sklearn.model_selection.train_test_split",
arrays_and_dtypes=helpers.dtype_and_values(
Expand Down

0 comments on commit 2fa8095

Please sign in to comment.