Practice
Solution
Step 1: Identify the core requirement
The first step in framing a business problem as an ML problem is to clearly define the business objective. Without a clear objective, the ML model cannot be aligned with business goals.Step 2: Eliminate wrong options
Selecting the right algorithm is incorrect because algorithm selection comes after defining the problem. Collecting as much data as possible is incorrect because data collection should be guided by the problem definition. Ensuring high computational resources is incorrect because computational resources are a consideration after the problem is defined.Final Answer:
Option D -> Option DQuick Check:
Start with a clear business goal. [OK]
Solution
Step 1: Understand initialization impact
K-Means++ initialization helps in spreading initial centroids to avoid poor local minima.Step 2: Eliminate wrong options
Random initialization can lead to poor local minima. Using centroids from a previous run might not improve if the previous run was suboptimal. Initializing all centroids to the same point is clearly incorrect.Final Answer:
Option A -> Option AQuick Check:
K-Means++ spreads centroids well [OK]
import torch
rnn = torch.nn.RNN(input_size=10, hidden_size=20, num_layers=2)
input = torch.randn(5, 3, 10)
h0 = torch.randn(2, 3, 20)
output, hn = rnn(input, h0)
print(output.shape)Solution
Step 1: Understand RNN output shape.
The output shape of an RNN is (seq_len, batch, hidden_size).Step 2: Apply to the given code.
Here, seq_len=5, batch=3, hidden_size=20, so the output shape is (5, 3, 20).Final Answer:
Option D -> Option DQuick Check:
RNN output: (seq_len, batch, hidden_size). [check]
Solution
Step 1: Identify LightGBM's strengths
LightGBM is optimized for speed and performance on large datasets with high dimensionality.Step 2: Eliminate wrong options
When you need better accuracy on small datasets. is incorrect because XGBoost often performs better on small datasets. When interpretability of the model is the primary concern. is incorrect because neither LightGBM nor XGBoost is particularly interpretable. When you require a model that handles categorical features natively. is incorrect because both can handle categorical features, but LightGBM is faster on large datasets.Final Answer:
Option A -> Option AQuick Check:
LightGBM = Large, high-dimensional data [OK]
Solution
Step 1: Consider real-time constraints
Real-time systems need to adapt to new data while maintaining performance.Step 2: Evaluate options for adaptability and efficiency
Use a single train-test split to minimize latency. risks overfitting. Use a large test set to ensure model robustness. misallocates resources. Use a static validation set to simplify the system. lacks adaptability to new data.Final Answer:
Option D -> Option DQuick Check:
Rolling window adapts to new data efficiently. [OK]
