Spaces:
Runtime error
Runtime error
Upload predict.html
Browse files- templates/predict.html +86 -0
templates/predict.html
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Coffee Yield Forecast - Sidama Region</title>
|
| 7 |
+
<style>
|
| 8 |
+
body {
|
| 9 |
+
font-family: Arial, sans-serif;
|
| 10 |
+
margin: 0;
|
| 11 |
+
padding: 20px;
|
| 12 |
+
background-color: #f4f4f4;
|
| 13 |
+
}
|
| 14 |
+
.container {
|
| 15 |
+
max-width: 600px;
|
| 16 |
+
margin: 0 auto;
|
| 17 |
+
background-color: #fff;
|
| 18 |
+
padding: 20px;
|
| 19 |
+
border-radius: 8px;
|
| 20 |
+
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
| 21 |
+
}
|
| 22 |
+
h1 {
|
| 23 |
+
text-align: center;
|
| 24 |
+
color: #333;
|
| 25 |
+
}
|
| 26 |
+
form {
|
| 27 |
+
display: flex;
|
| 28 |
+
flex-direction: column;
|
| 29 |
+
}
|
| 30 |
+
label {
|
| 31 |
+
margin-top: 10px;
|
| 32 |
+
color: #555;
|
| 33 |
+
}
|
| 34 |
+
input {
|
| 35 |
+
padding: 8px;
|
| 36 |
+
margin-top: 5px;
|
| 37 |
+
border: 1px solid #ddd;
|
| 38 |
+
border-radius: 4px;
|
| 39 |
+
}
|
| 40 |
+
button {
|
| 41 |
+
margin-top: 20px;
|
| 42 |
+
padding: 10px;
|
| 43 |
+
background-color: #28a745;
|
| 44 |
+
color: #fff;
|
| 45 |
+
border: none;
|
| 46 |
+
border-radius: 4px;
|
| 47 |
+
cursor: pointer;
|
| 48 |
+
}
|
| 49 |
+
button:hover {
|
| 50 |
+
background-color: #218838;
|
| 51 |
+
}
|
| 52 |
+
.result {
|
| 53 |
+
margin-top: 20px;
|
| 54 |
+
padding: 10px;
|
| 55 |
+
background-color: #e9ecef;
|
| 56 |
+
border-radius: 4px;
|
| 57 |
+
}
|
| 58 |
+
</style>
|
| 59 |
+
</head>
|
| 60 |
+
<body>
|
| 61 |
+
<div class="container">
|
| 62 |
+
<h1>Coffee Yield Forecast - Sidama Region</h1>
|
| 63 |
+
<form method="POST">
|
| 64 |
+
<label for="year">Year:</label>
|
| 65 |
+
<input type="number" id="year" name="year" required value="2025">
|
| 66 |
+
|
| 67 |
+
<label for="hectares">Hectares of Land Farmed:</label>
|
| 68 |
+
<input type="number" step="0.01" id="hectares" name="hectares" required value="2.5">
|
| 69 |
+
|
| 70 |
+
<button type="submit">Predict Yield</button>
|
| 71 |
+
</form>
|
| 72 |
+
|
| 73 |
+
{% if result %}
|
| 74 |
+
<div class="result">
|
| 75 |
+
<h2>Prediction Result</h2>
|
| 76 |
+
<p><strong>Year:</strong> {{ result.year }}</p>
|
| 77 |
+
<p><strong>Hectares:</strong> {{ result.hectares }}</p>
|
| 78 |
+
<p><strong>Predicted Yield (per hectare):</strong> {{ result.predicted_yield_per_ha_kg }} kg/ha</p>
|
| 79 |
+
<p><strong>Total Predicted Yield:</strong> {{ result.total_predicted_yield_kg }} kg</p>
|
| 80 |
+
<p><strong>95% Confidence Interval (per hectare):</strong> {{ result.confidence_interval_per_ha_lower }} – {{ result.confidence_interval_per_ha_upper }} kg/ha</p>
|
| 81 |
+
<p><strong>95% Confidence Interval (total):</strong> {{ result.total_confidence_interval_lower }} – {{ result.total_confidence_interval_upper }} kg</p>
|
| 82 |
+
</div>
|
| 83 |
+
{% endif %}
|
| 84 |
+
</div>
|
| 85 |
+
</body>
|
| 86 |
+
</html>
|