Skip to main content

Command Palette

Search for a command to run...

#9 Machine Learning & Data Science Challenge 9

Updated
1 min read
#9 Machine Learning & Data Science Challenge 9
B

Greetings.

I am a machine learning engineer based in India, possessing a sustained interest in machine learning since my undergraduate studies. I have completed Stanford University's machine learning course (Andrew Ng) via Coursera, and IBM's machine learning and deep learning curriculum. My current focus is on machine learning and data science projects, aiming to leverage my expertise for impactful, real-world problem-solving.

Why we can't do a classification problem using Regression?

  • With linear regression, you fit a polynomial through the data - say, like in the example below, we fit a straight line through {tumor size, tumor type} sample set:

01.png

  • Above, malignant tumors get 1, and non-malignant ones get 0, and the green line is our hypothesis h(x). To make predictions, we may say that for any given tumor size x, if h(x) gets bigger than 0.5, we predict malignant tumors.

  • Otherwise, we predict benignly. It looks like this way, we could correctly predict every single training set sample, but now let's change the task a bit.

  • Intuitively it's clear that all tumors larger than a certain threshold are malignant. So let's add another sample with a huge tumor size, and run linear regression again:

02.png

  • Now our h(x)>0.5→malignant doesn't work anymore. To keep making correct predictions, we need to change it to h(x)>0.2 or something - but that is not how the algorithm should work.

  • We cannot change the hypothesis each time a new sample arrives. Instead, we should learn it off the training set data, and then (using the hypothesis we've learned) make correct predictions for the data we haven't seen before.

Linear regression is unbounded.

Machine Learning & Data Science Interview Challenges

Part 1 of 50

Machine learning and data science are increasingly among the most sought-after skills in tech. Read this article for advice on how to prepare for machine learning and data science interviews.

More from this blog