File size: 2,319 Bytes
c745dff
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Linear Regression Step Trainer</title>
    <link rel="stylesheet" href="styles.css" />
  </head>
  <body>
    <div class="bg-grid"></div>
    <main class="container">
      <nav class="top-nav">
        <a href="index.html">Back Home</a>
      </nav>

      <header class="hero compact">
        <p class="eyebrow">Page 3</p>
        <h1>Linear Regression Step Trainer</h1>
        <p>
          Practice one-step gradient and parameter updates with two data samples.
          Choose a model setup, optionally enable z-normalization, then inspect
          every calculation in detail.
        </p>
      </header>

      <section class="panel controls">
        <div class="row">
          <label for="setupSelect">Parameter Setup</label>
          <select id="setupSelect">
            <option value="two_weights_no_intercept">Two weights, no intercept: y_hat = w1x1 + w2x2</option>
            <option value="two_weights_one_intercept">Two weights + one intercept: y_hat = b + w1x1 + w2x2</option>
            <option value="one_weight_one_intercept">One weight + one intercept: y_hat = b + wx</option>
          </select>
        </div>

        <div class="row">
          <label for="alphaInput">Learning Rate (alpha)</label>
          <input id="alphaInput" type="number" min="0.01" max="1" step="0.01" value="0.1" />
        </div>

        <div class="row">
          <label for="zNormToggle">Use z-normalization</label>
          <input id="zNormToggle" type="checkbox" />
        </div>

        <div class="row">
          <button id="newQuestionBtn" type="button">Randomize New Samples</button>
          <button id="solveBtn" type="button">Show Step-by-Step Solution</button>
        </div>
      </section>

      <section class="panel output">
        <h2>Question Data (Ground-Truth y Included)</h2>
        <div id="questionPrompt" class="viz-grid"></div>
      </section>

      <section class="panel output">
        <h2>Detailed Process, Result, and Explanation</h2>
        <div id="solutionOutput" class="viz-grid"></div>
      </section>
    </main>

    <script src="linear-regression-steps.js?v=20260812"></script>
  </body>
</html>