Open carmenf14 opened 6 years ago
I read them, but it is only information for creating the model, train with initial information and then query for answers. I want to add a new set of data (answers, result) to the model, to train (teach) it.
I tried to use the Learn function, but I get this error: An exception of type 'System.ArgumentException' occurred in Accord.MachineLearning.dll but was not handled in user code
Additional information: There are no samples for class label 0. Please make sure that class labels are contiguous and there is at least one training sample for each label.
hi, here's a sample application using NaiveBayes, https://github.com/accord-net/framework/tree/development/Samples/MachineLearning/Naive%20Bayes
Ok. Thank you.
Hi @carmenf14!
Thanks for opening the issue! Do you mean you would like to re-train a Naive Bayes classifier with a new set of data?
At this time the Naive Bayes classifier does not support online learning, so every time it learns from a dataset again, it would forget the previous knowledge it learned before, except for the number of inputs/outputs that it had seen in the first time it was trained.
In this case, I would advise to create a new one, and then train the model using all the data you have, at once.
There are, though, ways to online learn Naive Bayes models, but whether this is possible or not may depend on which distributions you are using in your model.
Regards, Cesar
Hello!
I wrote a singleton class for my NaiveBayes. I created the model this way: //dt is a DataTable with initial information from data base codebook = new Codification(dt, "Aroma", "Culoare", "Dimensiune", "Forma", "Greutate", "Grupa", "Gust", "Tip", "Fruct"); DataTable symbols = codebook.Apply(dt); int[][] inputs = symbols.ToJagged("Aroma", "Culoare", "Dimensiune", "Forma", "Greutate", "Grupa", "Gust", "Tip");
int[] outputs = symbols.ToArray("Fruct");
naiveBayes = lerner.Learn(inputs, outputs);
I want to know how to add new information to the model, to train the naiveBayes. Can you help me, please?
Thank you!