I am a beginner with machine learning, and I'm trying to build a model to classify products by category according to the words present in the product name.
My goal is to predict the category of some new product, just by observing the categories for existing products.
For example, having the following products:
PRODUCT CATEGORY soap bar johnsons green leaves bath cookie bauducco lemon 120gr cookie nesfit cookie choc and st cookie strawberry soap soft bath spoon hercules medium kitchen soap dish plastic medium bath [...]
My first thought is to group the words (tokens) present in each product, indicating the designated category and the occurrences count (to be used as a weight). So, for this sample, I have:
WORD CATEGORY COUNT soap bath 3 cookie cookie 2 medium bath 1 medium kitchen 1 bar bath 1 johnsons bath 1
Having this, I could be able to train a model, and use it to classify a new product.
For example, having a new product
hands liquid soap 120oz, it could be classified as
bath, because it contains the word
soap, which have a strong weight for the
In other case, the new product
medium hammer could be classified as
kitchen , according the occurrence of the word
medium in the training set.
So, my doubts are:
- Am I going to the correct approach?
- What is the best algorithm to be used in this case?
- How can I apply this using Weka?