Sensitivity of Logistic Regression, Decision Tree, and Random Forest Performance to Random Seed Choice
- Publication History
- Published online: November 16, 2026
- DOI
- https://doi.org/10.35877/jetech5583
- Copyright
- Copyright (c) 2026 Agung Tri Utomo; Muh. Qodri Alfairus, Nur Ikhwana, Zulkifli Rais
- User License
- https://creativecommons.org/licenses/by-nc/4.0
Abstract
This study examines how sensitive the predictive performance of logistic regression, a decision tree, and a random forest is to the value passed to set.seed() in R. The study uses four public binary datasets and eight synthetic datasets with a known data-generating process, 60 consecutive seeds, stratified 70/30 hold-out, and stratified 10-fold cross-validation, and measures accuracy, area under the ROC curve, and F1. A second experiment fixes the data split and varies only the model seed. The standard deviation of hold-out accuracy across seeds ranges from 0.012 to 0.089 and is close to the binomial error implied by test-set size; in synthetic data, test-set sampling accounts for a median of 94% of hold-out variance, and the deviation falls approximately as the inverse square root of sample size. Ten-fold cross-validation reduces it by a factor of 1.8 to 12. With a fixed split, logistic regression and an unpruned tree are deterministic, whereas random forest retains a standard deviation of 0.002 to 0.053. Model rankings reverse more often as true differences shrink, and choosing the best of 20 seeds by test accuracy inflates accuracy by about 0.08. The findings suggest that seed sensitivity under hold-out mainly reflects test-set sampling rather than algorithm-specific randomness.
Keywords
Citation
Statements

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.

