Skip to content

how to solve this error? thanks #2

@zzzhmy

Description

@zzzhmy

TypeError Traceback (most recent call last)
in <cell line: 1>()
----> 1 f1_per_fold = perform_kfold_cv(df, models, optims, criterion, k_folds, device=device, n_epochs=10)

3 frames
/usr/local/lib/python3.10/dist-packages/sklearn/utils/validation.py in _num_samples(x)
333 if hasattr(x, "shape") and x.shape is not None:
334 if len(x.shape) == 0:
--> 335 raise TypeError(
336 "Singleton array %r cannot be considered a valid collection." % x
337 )

TypeError: Singleton array array(<Flags(allows_duplicate_labels=True)>, dtype=object) cannot be considered a valid collection.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions