Can you describe a situation where you would use linear regression over logistic regression?
Short Answer
Pick one specific situation where you needed to predict a continuous outcome, such as a numerical value. Explain that you chose linear regression because the dependent variable was continuous, not binary. Describe the continuous variable you were predicting and the independent variables you used, and end with the positive outcome or insight gained from using linear regression in that scenario.
What a Strong Answer Covers
- Predict a continuous outcome.
- Dependent variable was continuous.
- Describe the continuous variable.
- Mention independent variables used.
- State the positive outcome or insight.
Sample Answers
Example 1: Academic Project - Predicting Student Scores
During my final year in college, I worked on a project where we aimed to predict students' final exam scores based on their study hours and attendance. Since the scores were continuous, we opted for linear regression. We collected data on various students and created a model that helped us understand how much their study habits influenced their scores. By analyzing the results, we found that more study hours positively correlated with higher scores, reinforcing the importance of consistent study habits.
Example 2: Part-time Job - Analyzing Sales Data
In a part-time role at a retail store, I was tasked with analyzing monthly sales data. I noticed that sales figures were continuous and varied month to month. Using linear regression, I created a predictive model to forecast next month’s sales based on previous months' data, seasonal trends, and promotional events. This approach helped our team plan inventory better and increase sales by targeting specific promotions during peak months.
Example 3: First Internship - Evaluating Housing Prices
During my internship at a real estate firm, I was involved in a project analyzing housing prices in different neighborhoods. We used linear regression to predict house prices based on various factors like square footage, number of bedrooms, and location. By employing this model, we could provide clients with estimated prices, which helped them make informed decisions when buying or selling properties. This experience emphasized the importance of selecting the right regression model based on the data type.
Why Interviewers Ask This Question
** Interviewers are looking for candidates to demonstrate their knowledge of the fundamental differences between linear regression (used for predicting continuous outcomes) and logistic regression (used for binary outcomes). A common misconception is that both types of regression can be used interchangeably, but this is not the case. ** Real-world applications of this question might involve scenarios such as forecasting sales figures (linear regression) versus predicting whether a customer will buy a product (logistic regression).
The ability to choose the right model is crucial for accurate predictions and insights in data analysis.
Keywords
Related Interview Questions
Ready to practice more questions?
Explore our collection of technical interview questions from top companies.
View All Questions