Each tweet d becomes a vector of word weights. Bag-of-Words: xw(d) = count(w, d). TF-IDF: xw(d) = count(w, d) · idf(w), where df(w) is the number of the N = 72 tweets that contain w.
idf(w) = ln( N / (1 + df(w)) ) + 1 class centroid mu_c = mean of x(d) over the 24 tweets of class c predict(d) = argmin_c || x(d) - mu_c ||Between two centroids the boundary is the straight line where the two distances are equal, a perpendicular bisector; the coloured regions are exactly these nearest-centroid cells (a Voronoi diagram of the three centroids), which is why they are only drawn when the classifier sees just the two plotted words.
What the 3D page hides. The 3D page rescales every axis to its own maximum before classifying. Multiplying one axis by a constant (the idf of that word) and then dividing by its new maximum gives back the BoW axis, so on that page BoW and TF-IDF always classify identically. With raw weights the idf scale does change distances, so TF-IDF can win or lose a few tweets; try the presets with both scaling buttons.
Simplifications. The corpus is 72 short synthetic tweets (24 per class), accuracy is measured on the same tweets the centroids are computed from (training accuracy, optimistic), there is no stemming, and the nearest-centroid rule is far simpler than the Random Forest or Logistic Regression used on real corpora. Real TF-IDF variants also differ in the idf smoothing and in length normalisation, which is not applied here.