Hey Ahmet, appreciate you coming back with more.
on the sample size thing, you're completely right and I should've flagged it. did the math: at n=30, one sample is 3.33 points of accuracy, so standard error is around 3.3 points, meaning a rough 95% CI is something like ±6.4 points on any single accuracy number here. that's a genuinely useful thing to sit with, small differences between models on iris are basically noise, and it's another reason the cross-validation fix from your last comment matters even more than I framed it.
on the train/test gap, mostly agree but checked the actual numbers and there's a nuance worth mentioning. the tree in the post is capped at max_depth=3, and that one gets 98.33% train vs 96.67% test, a 1.67 point gap, not dramatic. the "100% on train" thing you're describing shows up if you let the tree grow unrestricted (max_depth=None), which in my case hits exactly 100% train vs 93.33% test, a 6.67 point gap. so the principle is dead on, just wanted to be precise about which version of the tree actually does that.
added a note on the test set size to the post, since that one directly changes how much trust to put in the numbers already there. leaving the train/test gap as something to carry forward rather than folding it into the post itself, it's a good diagnostic but this one's meant to stay intro-level and I don't want to stack on more than it needs. appreciate you pushing on both points though.
Comparing two algorithms on the same split is the right habit to build early. The caveat worth knowing before the numbers mean much: Iris is 150 rows, so a test split is around 30 samples and one flower changing sides moves accuracy by three points. Two models that look different here are usually inside the noise, which is exactly why cross-validation exists - it is not extra ceremony, it is the only way to get a stable comparison on a dataset this size. The other thing this pairing teaches nicely is that the decision tree will happily reach 100 percent on training data while the logistic regression will not. That gap between train and test score is the most useful diagnostic you will carry forward, long after Iris.