# Forecasting/predicting techniques for qualitative data?

I have a food alert dataset composed of nominal qualitative variables, such as type of alert, country of origin, action taken, etc. as well as the date on which the alert was recorded.

What techniques are there to predict what type of alert is most likely in a time window when there are only qualitative variables in our dataset? Or given a variable (for example, country of origin = France) predict the rest of the variables?

I have used machine learning algorithms before but not with datasets composed of nominal qualitative variables.

On the other hand, what are the most appropriate techniques for clustering and classification this kind of datasets?

I know it's a broad question, so I expect broad answers to guide me in a general way

I have about 50000 registered alerts. In the example of the image not all the variables are shown

• any sample data? – sai saran Nov 14 '18 at 14:44
• I added an image with some sample data. I know that the data needs treatments but I do not need concrete answers of what to do, I just need some techniques that allow to work with qualitative data – Rodrigo Díaz Nov 15 '18 at 10:14
• Have you tried to dummify the data? See mode.matrix and the dummies package – Zeus May 11 '19 at 7:31

You can encode the various columns of qualitative data using LabelEncoder(). For example:

label_encoder = LabelEncoder()
risk = label_encoder.fit_transform(df['RISK_DECISION'])
action = label_encoder.fit_transform(df['ACTION_TAKEN])
etc...


Have you tried to dummify the data? See mode.matrix and the dummies1 package

Maybe you could start by actually and precisely defining what you want to do with your data.

Apparently you'd like to predict some probability for each type of alert (which I assume is given by the TYPE column), and find which one gets the highest probability (that boiling down to finding what type of alert is the most likely to happen in a given time interval). Well if it's what you want to do, maybe have a look a time series forecasting ? May be an starting point...

Considering the fact that you only have nominal qualitative variables, some kind of one-hot-encoding maybe could help with clustering, for example you could encode each variable for each observation, then compute cosine similarities. That would be a way of getting a glance at a kind of distance between your observations... even it's a very basic idea.