In this work, we investigate short-packet communications for multiple-input multiple-output underlay cognitive multihop relay internet-of-things (IoT) networks with multiple primary users, where IoT devices transmit and receive short packets to provide low-latency and ultra-reliable communications (uRLLCs). For performance evaluation, the closed-form expressions of the end-to-end (E2E) block error rate (BLER) for the considered systems are derived in a practical scenario under imperfect channel state information of the interference channels, from which the E2E throughput, energy efficiency (EE), latency, reliability, and asymptotic analysis are also studied. Based on the analytical results, we adapt some state-of-the-art machine learning (ML)-aided estimators to predict the system performance in terms of the E2E throughput, EE, latency, and reliability for real-time configurations in IoT systems. We also obtain the closed-form expressions for the optimal power-allocation and relay-location strategies to minimize the asymptotic E2E BLER under the proportional tolerable interference power and uRLLC constraints, which require negligible computational complexity and offer significant power savings. Furthermore, the ML-based evaluation achieves equivalent performance while significantly reducing the execution time compared to conventional analytical and simulation methods. Among the ML frameworks, the extreme gradient boosting model is demonstrated to be the most efficient estimator for future practical IoT applications.