Menu

Inspecting Training Data in Machine Learning

Inspecting Training Data

It is often useful to verify the size of the training dataset.

Code

**print(X_train.shape)**

**print(y_train.shape)**

Explanation

This confirms:

  • Number of training records
  • Number of feature columns
  • Dataset consistency

Verification helps prevent errors before model training begins.