Files
2025-08-01 04:33:03 -04:00

106 lines
4.4 KiB
HTML
Executable File

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Time Series Analysis</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
body {
background-color: #f8f9fa;
}
.container {
max-width: 800px;
margin-top: 20px;
}
.form-check-label {
margin-left: 10px;
}
</style>
</head>
<body>
<div class="container">
<!-- Warning Message -->
<div class="alert alert-warning alert-dismissible fade show" role="alert">
<strong>Warning:</strong> This app does not save files or outputs. All work will be lost when the page is closed.
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
<h1 class="text-center mb-4">Time Series Analysis</h1>
{% if error %}
<div class="alert alert-danger">{{ error }}</div>
{% endif %}
<form method="post" enctype="multipart/form-data" action="/upload">
<div class="mb-3">
<label for="file" class="form-label">Upload CSV or Excel File</label>
<input type="file" class="form-control" id="file" name="file" accept=".csv,.xls,.xlsx" required>
</div>
<div class="mb-3">
<h5>Analysis Options</h5>
<div class="form-check">
<input type="checkbox" class="form-check-input" id="decomposition" name="decomposition">
<label class="form-check-label" for="decomposition">Perform Decomposition</label>
</div>
<div class="form-check">
<input type="checkbox" class="form-check-input" id="forecasting" name="forecasting" checked>
<label class="form-check-label" for="forecasting">Perform Forecasting</label>
</div>
<div class="form-check">
<input type="checkbox" class="form-check-input" id="acf_pacf" name="acf_pacf">
<label class="form-check-label" for="acf_pacf">Generate ACF/PACF Plots</label>
</div>
</div>
<div class="mb-3">
<label for="train_percent" class="form-label">Train Percentage</label>
<input type="number" class="form-control" id="train_percent" name="train_percent" value="80" min="1" max="99" required>
</div>
<div class="mb-3">
<label for="test_percent" class="form-label">Test Percentage</label>
<input type="number" class="form-control" id="test_percent" name="test_percent" value="20" min="1" max="99" required>
</div>
<div class="mb-3">
<label for="forecast_periods" class="form-label">Forecast Periods</label>
<input type="number" class="form-control" id="forecast_periods" name="forecast_periods" value="12" min="1" required>
</div>
<div class="mb-3">
<label for="model_type" class="form-label">Forecast Model</label>
<select class="form-control" id="model_type" name="model_type">
<option value="ARIMA">ARIMA</option>
<option value="Exponential Smoothing">Exponential Smoothing</option>
<option value="Prophet">Prophet</option>
</select>
</div>
<button type="submit" class="btn btn-primary">Analyze</button>
</form>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<script>
// Sync Train and Test Percentage inputs
const trainInput = document.getElementById('train_percent');
const testInput = document.getElementById('test_percent');
function syncPercentages(source, target) {
source.addEventListener('input', () => {
const value = parseFloat(source.value);
if (!isNaN(value) && value >= 1 && value <= 99) {
target.value = (100 - value).toFixed(0);
} else {
target.value = '';
}
});
}
syncPercentages(trainInput, testInput);
syncPercentages(testInput, trainInput);
</script>
</body>
</html>