Siavash
Siavash

Reputation: 13

naive bayes for Forecast grade

I have data set of grade in four lessons (for example lesson a,lesson b,lesson c,lesson d) for 100 students and let's imagine this grades are In association with grade of lesson f.

I want to implement naive Bayes for Forecast grade lesson f by that four grade but I don't know how use input for this. I read naive Bayes for spam mail detection and in that, Possibility of each word Calculated. But for grade I do not know what Possibility I must calculate. I have tried like spam but for this example I have just four names (for each lesson)

Upvotes: 1

Views: 304

Answers (1)

MathiasDesch
MathiasDesch

Reputation: 352

In order to do a good classification, you need to have some information in plus about student than class they are taking. Following your exemple, spam detection is based on words, stop words which are generally spam (buy, promotion, money) or origin in http headers. For the case to predict student grade, you could imagine having information about student like : social class, is he doing sport, male or female and so on.

Getting back to your question, it is not the name of the lessons which are interesting but the grades each students got at this lessons. You need to take grades of each four lessons and lesson f to train the naive Bayes classifier.

Your entry might look like that:

StudentID   gradeA  gradeB   gradeC    gradeD   gradeF
1             10       9       8         5         8
2              3       5       3         8         8
3             5        3       1         1         2
4             10      10       10        5         4

After training your classifier you will pass new entry for a new student like that:

StudentID   gradeA  gradeB   gradeC    gradeD  
1058          1        5       8         4

The classifier will be able to predict the grade for lesson F taking into consideration the precedant grades.

You might have notice that I intentionnally did a training dataset where gradeF is highly correlated with gradeD. It is what the Bayes classifier will try to learn, just in a more complexe way.

Upvotes: 1

Related Questions