Quiz 2

High-Dimensional Computing

76 words
1 min read
Python Week 1: the first filter for runtime behavior
Visual companion
Python
Type and operator map

Python Week 1: the first filter for runtime behavior

View
Revision summary

What this note is really saying

Short form

# High-Dimensional Computing ## 9.1 Coordinate Descent for Lasso [Join Discord](https://discord.gg/gE2m4Qrdqv) [Previous**Numerical Optimization**](/notes/04-degree-electives-bsma3014-statistical-computing-week08-08b-numerical-optimization)[Next**Randomization Tests**](/notes/04-degree-electives-bsma3014-statistical...

High-Dimensional Computing

9.1 Coordinate Descent for Lasso

python
import numpy as np
def soft_threshold(x, lam):
    return np.sign(x) * np.maximum(np.abs(x) - lam, 0)
def coordinate_descent_lasso(X, y, lam, max_iter=1000):
    n, p = X.shape
    beta = np.zeros(p)
    for _ in range(max_iter):
        for j in range(p):
            r = y - X @ beta + X[:, j] * beta[j]
            z = X[:, j] @ r / n
            beta[j] = soft_threshold(z, lam)
    return beta
Document outline

Keep your place and jump directly to a heading.

Table of Contents
System Normal // Awaiting Context

Intelligence Hub

Navigate the knowledge graph to generate context. The Hub adapts dynamically to surface backlinks, related notes, and metadata insights.