Hydrogen and its derived fuels offer significant potential in the transportation sector due to their superior performance and lower emissions. However, knock remains a major challenge in hydrogen-enriched fuels, limiting engine efficiency and durability. This study aims to identify the key factors influencing knock in a hydrogen-enriched compressed natural gas (HCNG) fueled spark-ignition (SI) engine under varying operating conditions. Experiments were conducted by altering engine load (25 %-100 %), hydrogen enrichment (0 %-40 %), exhaust gas recirculation (EGR) (0 %-29 %), spark timing (14 degrees CA bTDC to 35 degrees CA bTDC), and engine speed (700 rpm-1700 rpm). The effects on combustion characteristics, including burn duration, knock ratio (KR), coefficient of variation of indicated mean effective pressure COV % (imep), in-cylinder heat transfer rate, indicated mean effective pressure (imep), in-cylinder pressure, and exhaust temperature, were analyzed. Results indicate that increasing engine load from 25 % to 100 % led to a 75.5 % rise in KR and a 77.7 % increase in heat transfer rate. Advancing spark timing from 47 degrees CA bTDC to 55 degrees CA bTDC resulted in a 49.4 % rise in KR and a 3.5 % increase in exhaust temperature. Conversely, EGR application reduced KR by 33.2 % at 1700 rpm. To predict KR, three machine learning algorithms-neural network fitting tool, support vector regression and linear interactions-were applied, with bayesian regularization achieving the lowest mean squared error. These findings provide valuable insights for optimizing electronic control unit (ECU) calibration and advancing HCNG engine development.