File size: 2,118 Bytes
b1bae0d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/model.css')}}">
    <script>
        function validateForm() {
            var experienceField = document.getElementById("experience");
            var experienceValue = experienceField.value;
            if (experienceValue < 0) {
                alert("Experience cannot be negative.");
                return false;
            }

            var salaryField = document.getElementById("salary");
            var salaryValue = salaryField.value;
            if (salaryValue < 0) {
                alert("Salary cannot be negative.");
                return false;
            }

            return true;
        }
    </script>
</head>

<body>
    <div class="header">
        <img src="{{ url_for('static', filename='images/Model-Naive.png') }}" alt="Image" class="logo">
        <h1>Naive Bayes</h1>
    </div>
    <form action="{{ url_for('predictnaive') }}" method="POST" onsubmit="return validateForm()">
        <label for="experience">Experience:</label>
        <input type="number" id="experience" name="experience" placeholder="Experience" required>

        <label for="salary">Salary:</label>
        <input type="number" id="salary" name="salary" placeholder="Salary" required>

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

    <ul>
        <li>Salary: {{ salary }}</li>
        <li>Experience: {{ experience }}</li>
    </ul>
    <table>
        <tr>
            <th>Naive Bayes Type</th>
            <th>Prediction</th>
        </tr>
        <tr>
            <td>Multinomial Naive Bayes</td>
            <td>{{ multinomial_accuracy }}</td>
            <td>{{ multinomial_prediction }}</td>
        </tr>
        <tr>
            <td>Gaussian Naive Bayes</td>
            <td>{{ gaussian_accuracy }}</td>
            <td>{{ gaussian_prediction }}</td>
        </tr>
        <tr>
            <td>Bernoulli Naive Bayes</td>
            <td>{{ bernoulli_accuracy }}</td>
            <td>{{ bernoulli_prediction }}</td>
        </tr>
    </table>
</body>

</html>