Ludwig: Predict more that one result

Created on 14 Mar 2019  路  6Comments  路  Source: ludwig-ai/ludwig

Is your feature request related to a problem? Please describe.
Prediction only returns one result, with more options I can suggest them to the user so he can select the one he needs more

Describe the use case
When a prediction is made I would like to select the quantity of results, that way I can suggest the user multiple options and not just the first one.

Describe the solution you'd like
I will add a parameter that allows to return multiple results

Describe alternatives you've considered
I consider predicting some values and then search in the original data those records that had more matches

Additional context
I am trying to create a suggester using a trained model with ludwig from previous values.

feature request

All 6 comments

@wschroederga this actually works for some outputs (categories, sequences) but not for other parameters (numerical), but in general it makes sense, adding it to the backlog.

In the mean time, for categorical features, you can use the predicted probabilities, for instance if you hav a batch of 4 items and 10 classes (including the <UNK> one) you'll get the probabilities of each in a 4x10 matrix. Then if you can map the column number to the class label using the idx2str dictionary in tran_set_metadata.json file that is saved in the model directory. For instance, a mapping, where the first element corresponds to the first column, the second element corresponds to the second column and so on.

I have been working in a easy prediction model using for the ticket and the description(then I will add add other fields), I want to predict similar tickets so the the user find a existing solution. I am using TEXT type, do you think that will be possible using other outputs?

input_features: - name: title type: text output_features: - name: id type: text training: epochs: 2

So you have a matching problem. I would do it differently, because ideally you would add new tickets constantly right? So you would have to retrain the model. A better option imho is to use something like a siamese network, there's one in the examples for images but if you change the type to text, you can provide 2 texts and supervise with 1 or 0 (match / non-match).

The at test time if you have k candidates (fir instance tickets that have at least one word in common with the current one) you can get a probability of each of them and use that to rank them.

You can also cache the intermediate representations for efficiency, but that's a more complciated thing to do.

Yes, I was going to retrain the model periodically.

I will try your approach, thanks for the help. +1 for you and Ludwig

So I try to use the siamese network, this is an basic example of my problem:
T1: Problem AA, T2: Problem AB, T3: Problem BC
I want to predict for Problem BC tickets T3, T2, T1`

I can compare the problems each other and complete with 0 & 1 if similar.
But for the prediction I will have to use all the problems for my second input, like this: BC AA, BC AB, BC BC
Also I am not sure how to get the ticket ID ones I found the Problem, is there a way to add it in the output?

I will continue investigating by myself, but any feedback will be appreciated

If I understand correctly, when you have a new ticket, you want to compare it with all possible problems and use the provided score to rank the problems. If it is expensive, you can have a first pass ranker that selects the K most likely problems and then you rank only among them. Hope this answers your question.

Was this page helpful?
0 / 5 - 0 ratings