Turn One Dial Downhill

~10 mincode completion

Implement turn_one_dial(x, y, slope, step) returning the array [new_slope, new_mse].

Where this shows up

~10 min

3 employers weight this skill

2 frontier labs, 1 AI product company. Top match scores 80.

Python
import numpy as np


def turn_one_dial(x, y, slope, step):
    """
    One try-both-directions update of a single slope.

    Args:
        x:     list of inputs
        y:     list of true answers, same length
        slope: current slope s of the line y_hat = s * x
        step:  how far to nudge the slope up or down

    Returns:
        array [new_slope, new_mse]
    """
    # YOUR CODE HERE
    pass

Run your code to see results

⌘↵ runs against the visible tests

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.