Predict data from a collection to determine a single object with the most used data

I need to start from a set of objects, define a single object, with the most used data among the javascript object collection informed.

Example of set of objects:

[{
    name: "Pedro",
    product: "Caneta"
}, {
    name: "Ana",
    product: "Caderno"
}, {
    name: "Maria",
    product: "Boracha"
}, {
    name: "Pedro",
    product: "Caneta"
}, {
    name: "Pedro",
    product: "Caneta"
}]

Single object with the most used values in the above collections:

{
    name: "Pedro",
    product: "Caneta"
}

That’s what I need, based on the javascript collections array you can see that the most used information for the fields (name and product), were name: "Pedro" and product: "Caneta".
That kind of analysis I need.

What function or how could I do this using tensorflow javascript, if you have any examples I’m very grateful, because I’m new to this.

Hi @TargSale_Oficial ,

I apologize for the late response. There is no direct function in tfjs to find the most frequently used data from a collection of objects.

You can follow this guide to create a tfjs model and train it to predict the output.

Based on my understanding of the problem, for a task like finding the most frequently occurring object in a collection, traditional data processing techniques will be simpler and more direct.

Let me know if it helps.

Thank You!!