When rows are not independent, a random split causes leaks. Group validation (GroupKFold) keeps all rows of the same group (customer, patient) on the same side. Time-based validation (TimeSeriesSplit) always trains on the past and tests on the future.
Example
GroupKFold(n_splits=5).split(X, y, groups=df['id_client'])