What is a Dummy Regressor (strategy = 'median')?

 Great question! Let’s carefully go through it.


What is a Dummy Regressor (strategy = 'median')?

A DummyRegressor simply ignores the input features XX.

  • With strategy='median', it always predicts the median of the target variable YY in the training data.

  • So, the given test input X=[2.1,3.9,3.2]X = [2.1, 3.9, 3.2] doesn’t matter at all.


Step 1: Collect Y values from dataset

Y=[10.5,12.3,11.1,9.8,10.9,11.5]Y = [10.5, 12.3, 11.1, 9.8, 10.9, 11.5]

Step 2: Sort the Y values

[9.8,10.5,10.9,11.1,11.5,12.3][9.8, 10.5, 10.9, 11.1, 11.5, 12.3]

Step 3: Find the median

Since there are 6 values (even count), median = average of 3rd and 4th values.

Median=10.9+11.12=22.02=11.0\text{Median} = \frac{10.9 + 11.1}{2} = \frac{22.0}{2} = 11.0

Final Answer

The Dummy Regressor will always predict:

11.0\boxed{11.0}

So the correct option is 11.0.


Would you like me to also explain how the answer would change if strategy="mean" instead of "median"?

Comments

Popular posts from this blog

Understanding Data Leakage in Machine Learning: Causes, Examples, and Prevention

🌳 Understanding Maximum Leaf Nodes in Decision Trees (Scikit-Learn)

Linear Regression with and without Intercept: Explained Simply