Online · Rijeka · Croatia

STEM Robotics Workshops for Kids in Rijeka

STEM robotics workshops for kids in Rijeka turn passive screen time into productive building challenges—motors, sensors and circuitry explored first on free software simulators, then optionally with physical kits under adult supervision.

STEM Rijeka

Chapter 110 – How Random Forest Works — Part 1

1. Introduction & The Committee Analogy

A single decision tree is easy to visualize but can overfit and show high variance when trained on the full dataset. Random Forest trains many trees on different samples and combines their outputs for more stable, accurate predictions—like a committee of experts instead of one decision-maker.

Different trees see different sub-samples, so they prioritize different features at the root. That diversity helps neutralize feature bias across the forest.

2. Bootstrapping: Sampling with Replacement

Bootstrapping draws n samples from the main dataset with replacement: a row that is picked stays in the pool and can be picked again. The result for each tree:

  • Some records appear more than once in that tree’s training subset
  • Some records are never selected for that tree
  • Each tree trains on a distinct sub-sample and learns a different view of the problem

3. Out-of-Bag (OOB) Samples

Records not selected for a tree’s bootstrap sample are its Out-of-Bag (OOB) samples. Example: 10 records total, 8 selected → 2 OOB. Because the tree never saw those OOB rows during training, they act as a built-in internal test set and support early checks on generalization without an extra external split.

4. Bagging (Bootstrap Aggregating)

After trees are trained on their bootstrap samples, predictions are combined:

  • Classification — majority vote (mode). Example (Iris): 5 trees vote Setosa, Setosa, Virginica, Setosa, Versicolor → final class Setosa.
  • Regression — mean of the continuous outputs from all trees.

Aggregation keeps bias low while reducing variance and improving stability.

5. Python Implementation with Scikit-Learn (Iris)

from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import accuracy_score

iris = load_iris()
X, y = iris.data, iris.target

X_train, X_test, y_train, y_test = train_test_split(
    X, y, test_size=0.3, stratify=y, random_state=42
)

rf_model = RandomForestClassifier(
    n_estimators=50,    # 50 trees
    max_depth=None,     # no depth limit
    bootstrap=True,     # sampling with replacement
    random_state=42,
    n_jobs=-1           # use all CPU cores
)

rf_model.fit(X_train, y_train)
y_pred = rf_model.predict(X_test)
accuracy = accuracy_score(y_test, y_pred)
print(f"Random Forest Test Accuracy: {accuracy * 100:.1f}%")

On this setup the model reaches about 88.9% accuracy on the held-out test set.

6. Bootstrapping vs Bagging

Dimension Bootstrapping Bagging
Core process Random sampling with replacement Combining predictions from many bootstrapped trees
Stage Dataset preparation (per tree) Inference / final prediction
Main goal Diversity + OOB samples Lower variance, more stable predictions
Aggregation N/A Majority vote (class) / mean (regression)

Lesson Q&A

Bootstrapping randomly selects n records from the main dataset to train one tree. Sampling with replacement means a selected record stays in the pool and can be chosen again, so some rows may appear multiple times in a tree’s subset and others may be missing. Each tree therefore trains on a distinct sub-sample.

OOB samples are the records not selected for a given tree’s bootstrap subset. Because that tree never trained on them, they form a built-in internal validation set. Analysts use OOB results to check generalization before relying on a separate external test set.

Classification uses majority voting: the class with the most votes across trees is the final label (e.g. 3 of 5 trees vote Setosa → Setosa). Regression averages the continuous outputs of all trees into a single predicted value.

What children can learn

WhatsApp +92 322 421 7059

AI and Robotics Club | The 100 Mission AI & Robotics Hero Journey

Recommended self-paced course for parents & educators

Robotics Miniature Modeling for Kids on Udemy.

Disclosure: This page contains affiliate links. We may earn from qualifying purchases at no extra cost to you. Links are intended for parents and educators, not as marketing directed at young children.

Hardware Prototyping: Motors, Sensors, and Circuitry for Kids in Rijeka

Rijeka workshops emphasise hands-on thinking without requiring kits on day one. Simulators teach circuit paths and motor control; physical components come later under guardian supervision. We state only verified curriculum details and avoid inflated career claims. Enquire WhatsApp +92 322 4217059 or support@aiandroboticsclub.com.

Frequently asked questions

How do project-based STEM workshops help students in Rijeka?

Practical building challenges encourage creative problem-solving and turn passive screen time into productive learning.

Are physical hardware kits required before joining?

No, students can start with free software simulators before acquiring physical hardware kits.

How does the club maintain high educational standards?

We deliver structured, honest instruction without making inflated career or skill claims.

Explore related learning

ZagrebRobotics · Zagreb SplitPython · Split LjubljanaRobotics · Ljubljana