Machine Learning Analytic-Based Two-Staged Data Management Framework for Internet of Things