Many species have adapted to living in groups. In a social environment, the behaviour of individuals is further influenced by and affects the behaviour of others, resulting in a highly dynamic environment, where each interaction can change the social subsequent interactions, leading to a variety of behavioural outcomes from what seems to be identical starting condition. Trying to analyze group dynamics in Drosophila Melanogaster can be difficult since multi-participant dynamics are hard to quantify due to human limitations. We compared the behavioural patterns and social networks of male and female groups under different conditions. We examined males and females that were socially raised, isolated, and groups that contain males and females (mated). Next, we trained behavior classifiers using JAABA- machine learning that calculates kinetic features and classify complex behaviors, to recognize male and female behaviors. Furthermore, we developed scripts in our lab that give visual data on each group with graph theorem and behavioral parameters. After obtaining the graphs and behavioral parameters we performed analysis to determine which are the most significant parameters influencing the difference between males and females using random forest - machine-learning algorithm to find what feature makes the most impact in the classification. Our results show that mated females exhibit strong and stable social clustering and complex structures of social networks, while solitary males exhibit simple and homogenous social networks. Moreover, we observed that social clustering behavior at mated females develops the fastest compering to male and virgin female conditions and remains stable until the end.