For most of the mobile/web developers, AI is not an option while some have studied it in the university or have tried to read about it. They keep staking with the problem of applicability “How and what to apply”

In this article, we will use make a News App and we will make use of the K-means algorithm to group our news. If you like the article and wanna more of AI topics for xamarin or mobile development please clap it, share it everywhere so I can see that more people want this topic.

Our app in a news app that shows some articles from newsapi.org and we need to group these articles by date in a way that makes sense to the user.

A way that makes sense means that depending on the data itself we will generate the groups and the groups.

We will use the K-means algorithm to do this, let me explain first how it works but anyways it is already implemented in Accord.net framework so we will not implement it but ourselves.

1- Pick random centroids which will be the centers of your groups

2- measure the distance of each element and the centroid.

3- recalculate the centroids so the distance is minimized

4- keep doing this for a number of iteration or until the distance within each group reaches a threshold that you already defined.