-3

I've just started building models in Machine Learning and I was wondering why do we have t0 create a random_state variable when we split the data.

Siddarth Krishna S
  • 111
  • 1
  • 2
  • 10

1 Answers1

1

It saves how the split was made. If you were to use the same data and the same random state it would produce the same train test split. This is useful if you want to train two+ models on the same data and compare them. Using the same data and the same random split will ensure the models were trained on the same data, allowing for apples-to-apples comparison of performance

user11924246
  • 174
  • 7