Selecting ML Algorithms for Resource-Constrained Environments

PDE By islever Editorial Last updated

Preparing data for AI and ML.

Short answer

A Linear regression should be used because it is a computationally efficient algorithm suitable for predicting continuous values like housing prices on resource-constrained hardware.

Question

You are creating a model to predict housing prices. Due to budget constraints, you must run it on a single resource-constrained virtual machine. Which learning
algorithm should you use?
  1. Linear regression Correct Answer
  2. Logistic classification
  3. Recurrent neural network
  4. Feedforward neural network

Key Takeaways

The question tests the ability to match algorithm complexity with infrastructure constraints, specifically identifying that regression problems require different algorithms than classification ones.

This page explains why Linear Regression is the correct choice for predicting housing prices on a resource-constrained virtual machine, balancing model simplicity with computational efficiency.

Common mistake: Candidates often choose neural networks (C or D) assuming they are always superior for prediction tasks, failing to recognize that their high computational overhead makes them unsuitable for resource-constrained environments compared to simpler models like linear regression.

Expert Analysis

The question presents a classic trade-off scenario in machine learning: model complexity versus computational resources. The task is to predict housing prices, which is a regression problem because the target variable (price) is continuous numeric data. This immediately eliminates logistic classification (Option B), as that algorithm is designed for binary or multi-class classification tasks (e.g., predicting 'yes/no' outcomes).

Between the remaining regression options—Linear Regression (A), Recurrent Neural Network (C), and Feedforward Neural Network (D)—the deciding factor is the constraint: a "single resource-constrained virtual machine." Neural networks, including both feedforward and recurrent architectures, are computationally intensive. They require significant memory for weights and activations, substantial processing power for matrix multiplications during training, and often benefit from specialized hardware like GPUs. Deploying them on a resource-constrained VM would likely lead to poor performance, long training times, or inability to run at all.

In contrast, Linear Regression is a linear model with a simple mathematical structure. It has few parameters, requires minimal memory, and can be trained efficiently using closed-form solutions (like normal equations) or simple gradient descent on a single CPU core. Comments highlight this efficiency, noting that it is "computationally lightweight" and "well-suited for single machines with limited resources." While neural networks might offer higher accuracy for complex non-linear relationships, the prompt explicitly prioritizes the resource constraint over maximum predictive power, making Linear Regression the only viable choice among the options provided.

Exam Strategy

When faced with ML algorithm questions, first identify the problem type (classification vs. regression). Next, evaluate any infrastructure constraints mentioned (e.g., limited RAM, CPU-only, edge devices). Prioritize simpler, linear models (like Logistic/Linear Regression) when resources are tight, reserving complex models (Neural Networks, Ensembles) for scenarios where accuracy outweighs compute costs or sufficient hardware is available.

Frequently Asked Questions

Why not use a neural network for housing prices?

Neural networks are computationally expensive and require significant resources for training and inference. On a constrained VM, they may fail to run or perform poorly compared to lighter models.

Is linear regression accurate enough for housing prices?

While not always the most accurate, it provides a reasonable baseline. In exam scenarios, if resource constraints are explicit, simplicity and efficiency take precedence over marginal gains in accuracy.

More PDE FAQ →

Community Votes

A
100%

100% of anonymous learners picked answer A. Votes are pick records left by other test-takers — they are not the verified answer.

Discussion 29 contributions

Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.

From public community threads 29

  1. Radhika7983 👍 60
    Correct answer is A. A tip here to decide when a liner regression should be used or logistics regression needs to be used. If you are forecasting that is the values in the column that you are predicting is numeric, it is always liner regression. If you are classifying, that is buy or no buy, yes or no, you will be using logistics regression.
  2. muzammilnxs 👍 27
    Neural Networks(Feed Forward or Recurrent) require resource intensive machines(i.e GPU's) whereas Linear regression can be done on ordinary CPU's
  3. Anirkent 👍 7
    Liner Regression is correct but this is one aspect of the question, how does it relates to resource constrained machines? or that could be just a distraction?
  4. samdhimal 👍 4
    correct answer -> Linear Regression Linear regression is a statistical method that allows to summarize and study relationships between two continuous (quantitative) variables: One variable, denoted X, is regarded as the independent variable. The other variable denoted y is regarded as the dependent variable. Linear regression uses one independent variable X to explain or predict the outcome of the dependent variable y. Whenever you are told to predict some future value of a process which is currently running, you can go with a regression algorithm.
  5. saurabh1805 👍 4
    Correct Answer is A, refer below link for more information.
Show 24 more comments
  1. rtcpost 👍 3 Answered A
    Linear regression is a simple and resource-efficient algorithm for predicting continuous values like housing prices. It's computationally lightweight and well-suited for single machines with limited resources. It doesn't require the extensive computational power or specialized hardware that more complex algorithms like neural networks (options C and D) might need. Option B (Logistic classification) is used for binary classification tasks, not for predicting continuous values like housing prices, so it's not the right choice in this context.
  2. MaxNRG 👍 3
    A as Supervised learning using Regression can help build a model to predict house prices. Option B is wrong as Classification would not help to solve the problem. Options C & D are wrong as they would need more resources.
  3. PRABHUKKARTHI 👍 3
    Option A: Because Linear Regression is applicable for the continuous value output as the Price for the House will be a continuous values.
  4. samdhimal 👍 2
    Linear regression is a simple and computationally efficient algorithm that can be used to predict a continuous target variable based on one or more input variables. It is particularly well-suited for resource-constrained environments, as it requires minimal computational resources and can be run on a single virtual machine. Linear regression is a good fit for this problem as it is a supervised learning algorithm that can be used for regression problems, and it's not computationally expensive. Option B is not recommended as Logistic classification is a supervised learning algorithm that is used for classification problems, not regression problems. Option C and D are not recommended as Recurrent Neural Network (RNN) and Feedforward Neural Network (FNN) are computationally expensive and may require significant computational resources and memory to run on a single virtual machine.
  5. StefanoG 👍 2
    Ok the right answer is A, but the question is why? Then: - B not because we are make forecasting and not classifying - C and D not because this solution need more nodes, then more VM. Right?
  6. SamuelTsch 👍 2 Answered A
    the keyword here is running it on a single resource-constrained virtual machine. linear regression is a simple and efficient algorithm that is well-suited for predicting continuous values.
  7. rowan_ 👍 2
    A for sure. B is for classification. Neural nets can accomplish the task but they take WAY too many resources
  8. Zosby 👍 2
    predict housing prices = linear regresssion
  9. sid091 👍 2
    Easy One. Linear Regression . Option A
  10. davidbilla 👍 2
    A. Linear Regression
  11. naga 👍 2
    Correct A
  12. Fazan456 👍 1 Answered A
    Here, due to budget constraints, we're utilizing a single resource-constrained virtual machine, operating in a minimal resource environment. Linear regression emerges as the appropriate algorithm. It's a lightweight predictive model that suits our resource limitations
  13. AmmarFasih 👍 1 Answered A
    Correct Answer is A. Since linear regression is used to predict a numeric value. While logistic regression is used to classify among the binary scenario. Further option C and D are advance ML options and not cost and resource effective for the current situation.
  14. RT_G 👍 1 Answered A
    Linear regression will be used since the prediction requires forecasting prices involving numeric values and is computationally less resource intensive
  15. willyunger 👍 1 Answered A
    linear regression to predict numeric with least cost. for classifying with options use logistics.
  16. daghayeghi 👍 1
    A: When a model is used to predict a continuous value, it is known as a regression model.
  17. JJJJim 👍 1 Answered A
    must be A. Though C can do it, linear regression is the better practice.
  18. AshishDhamu 👍 1 Answered A
    Linear regression is used for continous distribution.
  19. azuavi 👍 1 Answered A
    Correct answer is A, thanks
  20. rocky48 👍 1 Answered A
    Correct answer is A
  21. lbhhoya82 👍 1
    Correct : A
  22. sumanshu 👍 1
    Vote for A
  23. lukas_xls 👍 1 Answered A
    Must be A
  24. anji007 👍 1
    Ans: A

Reader comments & corrections

No reader corrections yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

← Back to PDE Study Guide