codescraftman / machinelearning / templates / partials / make_prediction.html
make_prediction.html
Raw
{% if model %}
<div id="make-prediction">
    <h3>Make a Prediction with {{ model.name }}</h3>

    <form method="post" action="{% url 'machinelearning:make_prediction' 'regression' model.pk %}">
        {% csrf_token %}
        <div>
            <label for="input_data">Input Data (comma-separated):</label>
            <input type="text" id="input_data" name="input_data" required>
        </div>

        <button type="submit">Predict</button>
    </form>

    {% if prediction %}
    <h4>Prediction Result:</h4>
    <p>{{ prediction }}</p>
    {% endif %}
</div>
{% endif %}