This study deals with an application of machine learning (ML) techniques for electronic bandgap predictions of a host of entries in the open-source Materials Project (MP) database and inorganic perovskite compounds. Initially, a dataset of 4616 inorganic compounds having available experimental bandgap data was used to generate predictive ML models—support vector machine, k-nearest neighbors, random forest, kernel ridge regression (KRR), and artificial neural networks—requiring only compositional features based on simple elemental attributes. This was followed by identification of the most crucial features for the bandgap and an evaluation of various performance metrics against the dimensionality of the feature space. The trained KRR model having the highest accuracy was then regressed on more than 22,000 entries in the MP database, and the trends are elucidated. Subsequently, out-of-sample validation was performed on a couple of datasets containing several discovered halide perovskites, in conjunction with ab-initio investigations of the undiscovered ones. Finally, the optimal classification and regression models were employed to classify a dataset of 46,970 unknown inorganic halide perovskites into metals and nonmetals followed by bandgap predictions of the nonmetallic entries.