Rows are rarely independent. Ten reviews by the same author, forty scans of the same patient, a hundred events from the same account: split those at random and the model recognises the author, not the sentiment. The offline number looks excellent and production does not reproduce it.
Write group_split(groups, test_size=0.2, seed=0) returning (train_idx, test_idx) as integer NumPy arrays.
groups[i] is the group that row i belongs to. Every row of a group must end up on the same side of the split. Shuffle the distinct groups using np.random.default_rng(seed) and take groups into the test set until it holds at least test_size of the rows.
You have read the opening. The rest is free with a Bezen account, and no card is needed.
Behind the sign-in