Optimization algorithms are extensively used in training machine learning models. Data engineers employ algorithms like gradient descent, stochastic gradient descent, and variants (e.g., Adam, RMSprop) to optimize the model parameters and minimize the loss function. Follow along to learn the 21 top Data Science and ML Optimisation Algorithms interview questions and answers to ramp up your skills before the next ML interview.
Random Search: here, we create a grid of possible values for hyperparameters. Each iteration tries a random combination of hyperparameters from this grid, records the performance, and lastly returns the combination of hyperparameters that provided the best performance.
Grid search: we also create a grid of possible values for hyperparameters, but in each iteration, we try a combination of hyperparameters in a specific order and the model it fits on each and every combination of hyperparameters possible and records the model performance. Finally, it returns the best model with the best hyperparameters.
The applicability of batch or stochastic gradient descent depends on the error manifold expected.
One benefit of SGD is that it's computationally a whole lot faster. Large datasets often can't be held in RAM, which makes vectorization much less efficient. Rather, each sample or batch of samples must be loaded, worked with, the results stored, and so on. Minibatch SGD, on the other hand, is usually intentionally made small enough to be computationally tractable. Usually, this computational advantage is leveraged by performing many more iterations of SGD, making many more steps than conventional batch gradient descent. This usually results in a model that is very close to that which would be found via batch gradient descent, or better.
Regret is the defacto standard in measuring the performance of learning algorithms.
K is non-empty, bounded, and closed. We also assume the set K to be convex.T. At iteration t, the online player chooses . After committing to this choice, a convex cost function is revealed. The cost incurred to the online player is the value of the cost function at the point she committed to . Henceforth we consider mostly linear cost functions, and abuse notation to write .A at time T is defined as the total cost minus the cost of the best fixed single decision, where the best is chosen with the benefit of hindsight. We are usually interested in an upper bound on the worst-case guaranteed regret, denotedT, that is, , since this implies that "on the average" the algorithm performs as well as the best-fixed strategy in hindsight.T iteration repeated game. Typically, the running time will depend on and the parameters of the cost functions and underlying convex set.p that you want your results to lie in some quantile q; the rest proceeds automatically using results from basic probability.n = 60. It is worth noting that n = 60 is comparable to the number of experiments required to get good results with Gaussian Process-based methods when there are a moderate number of parameters. Unlike Gaussian Processes, the number of queries tuples does not change with the number of hyperparameters to search over; indeed, for a large number of hyperparameters, a Gaussian process-based method can take many iterations to make headway.A few types of stopping conditions are as follows:
Other possible options for finding lower minima in a reasonable amount of time could include:
3 dimensional problem, I have 3 first derivatives, 6 second derivatives, and 10 third derivatives, so going to a third-order version more than doubles the number of evaluations I have to do (from 9 to 19), not to mention increased complexity of calculating the step direction/size once I've done those evaluations, but will almost certainly not cut the number of steps I have to take in half.k variables, the collection of partial derivatives will number , so for a problem with five variables, the total number of third, fourth, and fifth partial derivatives will equal 231, a more than 10-fold increase over the number of first and second partial derivatives (20). You would have to have a problem that is very, very close to a fifth-order polynomial in the variables to see a large enough reduction in iteration counts to make up for that extra computational burden.N values are required to compute the first derivative, are required for the second derivative.T in the Forest?Prepare for AI developer and engineer interviews with 19 answered OpenClaw questions covering Gateway architecture, channels, agent workspaces, memory, MCP, model failover, multi-agent routing, security, sandboxing, approvals, and remote operations....
Prepare for AI agent developer interviews with 15 Model Context Protocol (MCP) questions covering tools, resources, prompts, JSON-RPC, transports, roots, sampling, security, and practical MCP server design....
Amazone runs the internet as we know it. Amazon Web Services (AWS) offers a comprehensive suite of machine learning (ML) services that cater to various needs and expertise levels. Follow along and learn the 23 most common AWS machine-learning intervi...