76 lines
4.1 KiB
HTML
76 lines
4.1 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Time Series Analysis</title>
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
</head>
|
|
<body>
|
|
<div class="container mt-5">
|
|
<h1 class="mb-4">Time Series Analysis App</h1>
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<h5 class="card-title">Upload Time Series Data</h5>
|
|
<p class="card-text">Upload a CSV or Excel file with time series data. First column should be dates, second column should be values.</p>
|
|
<form method="post" enctype="multipart/form-data" action="/upload">
|
|
<div class="mb-3">
|
|
<input type="file" class="form-control" name="file" accept=".csv,.xls,.xlsx">
|
|
</div>
|
|
<h6 class="mt-3">Select Analyses:</h6>
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="checkbox" name="decomposition" id="decomposition" checked>
|
|
<label class="form-check-label" for="decomposition">
|
|
Time Series Decomposition (Trend, Seasonality, Residuals)
|
|
</label>
|
|
</div>
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="checkbox" name="forecasting" id="forecasting" checked>
|
|
<label class="form-check-label" for="forecasting">
|
|
Forecasting
|
|
</label>
|
|
</div>
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="checkbox" name="acf_pacf" id="acf_pacf" checked>
|
|
<label class="form-check-label" for="acf_pacf">
|
|
ACF and PACF Plots
|
|
</label>
|
|
</div>
|
|
<div class="mt-3" id="forecast_options" style="display: none;">
|
|
<h6>Forecasting Options:</h6>
|
|
<div class="mb-3">
|
|
<label for="train_percent" class="form-label">Training Data Percentage (50-95%):</label>
|
|
<input type="number" class="form-control" name="train_percent" id="train_percent" value="80" min="50" max="95" step="1">
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="test_percent" class="form-label">Test Data Percentage (5-50%):</label>
|
|
<input type="number" class="form-control" name="test_percent" id="test_percent" value="20" min="5" max="50" step="1">
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="forecast_periods" class="form-label">Number of Periods to Forecast (1-24):</label>
|
|
<input type="number" class="form-control" name="forecast_periods" id="forecast_periods" value="12" min="1" max="24" step="1">
|
|
</div>
|
|
</div>
|
|
<button type="submit" class="btn btn-primary mt-3">Analyze</button>
|
|
</form>
|
|
{% if error %}
|
|
<div class="alert alert-danger mt-3">{{ error }}</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
// Show/hide forecasting options based on checkbox
|
|
document.getElementById('forecasting').addEventListener('change', function() {
|
|
document.getElementById('forecast_options').style.display = this.checked ? 'block' : 'none';
|
|
});
|
|
// Ensure train and test percentages sum to 100
|
|
const trainInput = document.getElementById('train_percent');
|
|
const testInput = document.getElementById('test_percent');
|
|
trainInput.addEventListener('input', function() {
|
|
testInput.value = (100 - parseFloat(this.value)).toFixed(0);
|
|
});
|
|
testInput.addEventListener('input', function() {
|
|
trainInput.value = (100 - parseFloat(this.value)).toFixed(0);
|
|
});
|
|
</script>
|
|
</body>
|
|
</html> |