Normal Equation with a Bias Column

~12 mincode completion

Implement normal_equation(X, y) returning the array , bias first.

Where this shows up

~12 min

8 employers weight this skill

2 health and bio companies, 2 quant funds, 2 enterprise vendors, 1 AI product company, 1 frontier lab. Top match scores 87.

Python
import numpy as np


def normal_equation(X, y):
    """
    Closed-form least squares with a bias column.

    Args:
        X: array of shape (n, d), one row per example
        y: array of shape (n,), targets

    Returns:
        array of shape (d + 1,): [b, w_1, ..., w_d]
    """
    # YOUR CODE HERE
    pass
Loading docs…

The AI Mentor needs an account

It reads your code and the failing tests and nudges you toward the fix without handing you the answer. Free accounts get it on every problem you're working on today.