File size: 4,495 Bytes
facf506
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
{% extends "base.html" %}
{% block title %}Predict — Locked | Data2Model{% endblock %}

{% block content %}
<div class="container my-5">
<div class="col-lg-7 mx-auto text-center">

  <!-- Lock Icon -->
  <div class="mb-4">
    <div class="lock-circle mx-auto mb-3">
      <i class="fas fa-lock fa-4x text-secondary"></i>
    </div>
    <h1 class="display-5 fw-bold">Prediction Locked</h1>
    <p class="lead text-muted">
      The Predict page is only available after training a model with a 
      <strong>Train / Test / Validation</strong> split.
    </p>
  </div>

  <!-- Why locked? -->
  <div class="card shadow mb-4 text-start">
    <div class="card-header bg-warning text-dark">
      <h5 class="mb-0"><i class="fas fa-question-circle"></i> Why is this locked?</h5>
    </div>
    <div class="card-body">
      {% if not model_trained %}
      <div class="d-flex align-items-start gap-3 mb-3">
        <span class="badge bg-danger fs-6 mt-1">1</span>
        <div>
          <strong>No model trained yet</strong><br>
          <span class="text-muted">You haven't uploaded and trained any model. Go to the Home page to begin.</span>
        </div>
      </div>
      {% else %}
      <div class="d-flex align-items-start gap-3 mb-3">
        <span class="badge bg-warning text-dark fs-6 mt-1">!</span>
        <div>
          <strong>Model trained with 2-way split only</strong><br>
          <span class="text-muted">
            Your last training used a <em>Train / Test</em> split only (no validation set).
            A validation set is required to ensure the model is properly evaluated before predictions.
          </span>
        </div>
      </div>
      {% endif %}
    </div>
  </div>

  <!-- 3-step workflow -->
  <div class="card shadow mb-4 text-start">
    <div class="card-header bg-primary text-white">
      <h5 class="mb-0"><i class="fas fa-unlock-alt"></i> How to Unlock Predictions</h5>
    </div>
    <div class="card-body">
      <div class="d-flex align-items-start gap-3 mb-3">
        <div class="step-badge bg-primary text-white">1</div>
        <div>
          <strong>Upload your dataset</strong> on the Home page
        </div>
      </div>
      <div class="d-flex align-items-start gap-3 mb-3">
        <div class="step-badge bg-primary text-white">2</div>
        <div>
          <strong>On the Configure page</strong>, select 
          <span class="badge bg-success">Train / Test / Validation Split</span>
          under "Data Split Strategy"
          <div class="text-muted small mt-1">
            This splits your data into 3 parts — e.g. 60% training, 20% testing, 20% validation
          </div>
        </div>
      </div>
      <div class="d-flex align-items-start gap-3">
        <div class="step-badge bg-success text-white">3</div>
        <div>
          <strong>Train the model.</strong> 
          The Predict page will automatically unlock after successful training with validation.
        </div>
      </div>
    </div>
  </div>

  <!-- Why validation matters -->
  <div class="card shadow mb-4 text-start border-info">
    <div class="card-body">
      <h6 class="text-info"><i class="fas fa-info-circle"></i> Why is a validation set required?</h6>
      <p class="mb-0 text-muted small">
        A model evaluated only on training + test data might be over-fitted or misleadingly accurate. 
        The <strong>validation set</strong> is a completely separate portion of data the model never sees 
        during training, giving a true measure of how well it will perform on real-world new data. 
        Only after passing this check is the model trustworthy enough for making predictions.
      </p>
    </div>
  </div>

  <!-- Action buttons -->
  <div class="d-grid gap-2">
    <a href="{{ url_for('index') }}" class="btn btn-primary btn-lg">
      <i class="fas fa-upload"></i> Go to Home — Upload & Train
    </a>
    {% if model_trained %}
    <p class="text-muted small mt-1">
      Your previous model is still saved. Simply re-train with the 3-way split to unlock predictions.
    </p>
    {% endif %}
  </div>

</div>
</div>

<style>
.lock-circle {
  width: 100px; height: 100px;
  border-radius: 50%;
  background: #f8f9fa;
  border: 3px solid #dee2e6;
  display: flex; align-items: center; justify-content: center;
}
.step-badge {
  min-width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; flex-shrink: 0;
}
</style>
{% endblock %}