Wireless Sensor Networks (WSNs) play a pivotal role in remote monitoring, surveillance, and Internet of Things (IoT) applications. The efficient utilization of battery-powered sensor nodes in WSNs, given their limited power capacity, is crucial for successful data transmission. Conventional clustering algorithms while efficient in clustering, often lacks the efficient management of data generated by sensor nodes, leading to redundant data in applications like IoT leading to reduced network lifetime. To overcome this issue, this paper introduces a novel approach, named CCOA-DC (Improved Coati Optimization with Cognitive Factor (CCOA) through Data Compression (DC)), in clustering heterogeneous aggregated WSN data. The research unfolds in two novel phases. Initially, a non-negative matrix factorization (NMF) model is introduced data compression for clustering, addressing the challenge of data transmission and energy efficiency. Subsequently, the performance is enhanced through load balancing, featuring dynamic cluster head selection via Improved Coati Optimization (COA) with cognitive factor (C), denoted as CCOA. A distinctive aspect is the incorporation of the NMF data compression technique in both clustering and cluster head selection processes, introducing an energy-efficient, load-balanced, and compressed data aggregation mechanism. The proposed CCOA-DC undergoes rigorous testing, comparing its performance against existing models to validate its superiority. Comparative analyses with renowned models such as TCBDGA, HEED, and FEEC-IIR underscore the distinct advantages of CCOA-DC. Notably, it achieves a reduction of 78.57% of packet loss ratio compared to FEEC-IIR model. The model achieves high packet delivery ratio which is 98.67%, and shows optimized energy consumption of 68.01% Joules. This novel compression-based metaheuristic data aggregation algorithm showcases its effectiveness in addressing the energy conservation challenge, affirming its prominence in the area of WSNs based IoT applications.