How To See All The Labels In X_Train?

Use `np.unique(y_train)` to view all labels in `y_train`

Use `set(y_train)` to view unique labels if `y_train` is a list

Use `print(y_train.shape)` to check the label array size

Use `print(y_train[:])` to display all labels if the array is small

Use `pd.Series(y_train).value_counts()` to see label counts

Use `np.bincount(y_train)` if labels are non-negative integers

Use `print(sorted(np.unique(y_train)))` to see labels in order

Suggested for You

Trending Today