In this work, a novel meta-heuristic-based feature ranking and classification approach is developed on the real-time ECG data. Initially, the data is captured using AD8232 biopotential sensor and transmitted to Amazon Web Service (AWS) Internet of Things (IoT) core through ESP8266 gateway via Message Queuing and Telemetry Transport (MQTT) protocol. An improved inter quartile range (IIQR) based filtering is applied on each feature measure to find outliers in the data. A probability estimator-based feature ranking method is used to find the key features. With unsupervised clustering the essential key segments are calculated and used as class labels to train the classifier. Finally, the prediction rate of the model on the segmented classes is improved with the use of ensemble learning. The real-time ECG data of three different individuals are used to test the unsupervised ensemble learning model (Support Vector Machine (SVM) + Linear Regression (LR) + ORF (Optimized Random Forest) + (K-Nearest Neighbor (KNN) + Gradient Boost (XGBoost)) and obtains an overall accuracy of 99.63% (Person 1), 99.75% (Person 2) and 99.78% (Person 3) which significantly outperforms the base ensemble classifiers such as, (LR + SVM + XGBoost) with 94.2% accuracy, (LR + KNN + XGBoost) with 95.8% accuracy and (Random Forest (RF) + KNN + XGBoost) with 95.67% accuracy.