In Bayesian approach, the prior probability is often computed by the ratio of sample in training set. Is it really suitable? Is there any method to calculate the prior probability without considering training data?
From Wikipedia: A class' prior may be calculated by assuming equiprobable classes (i.e., priors = 1 / (number of classes)), or by calculating an estimate for the class probability from the training set (i.e., (prior for a given class) = (number of samples in the class) / (total number of samples)).
Yes it's suitable as it gives you an accurate estimator of your prior information. If you don't want to use it, you can assume equiprobable classes.
If you are calculating the probability of each class, You need to count the number of transition of each class from it's own class to the other class and itself. Set the number of count in the matrix and normalize it means sum of the row of the matrix must be one . I hope this will help