In the wake of growing concerns regarding diet-related health issues, this study investigates the application of machine learning methods to estimate the energy content and classify the health risks of foods based on the USDA National Nutrient Database. The caloric content of foods was estimated using the nutritional composition (i.e., carbohydrates, protein, total lipid, and total sugar content) and classified based on their weighted health risks, considering their carbohydrate, lipid, and glycemic index levels. The algorithms used for modeling include multiple linear regression (MLR), K-nearest neighbors, support vector machine, random forest regression (RFR), gradient-boosted regression, decision trees (DT), and deep neural networks. The MLR model demonstrated high accuracy on the training dataset (R2=0.99, mean absolute error [MAE]=7.71kcal, and root mean squared error [RMSE]=17.89kcal) and testing dataset (R2=0.99, MAE=7.75kcal, and RMSE=18kcal) in energy estimation, indicating its effectiveness in dietary assessment. The RFR and DT models were useful in categorizing foods into low-health-risk foods, but their performance was reduced in medium and high-health-risk groups. This research contributes to developing tools that could aid in personalized dietary planning and public health interventions to mitigate diet-related health risks. PRACTICAL APPLICATION: This study applies machine learning to estimate how many calories are in food and to understand the health risks different foods might have. By investigating the fats, cholesterol, and sugars in food items listed in a public database, we can better plan diets or develop apps that help people make healthier eating choices. This work aims to improve public access to nutritional information, supporting efforts to combat diet-related diseases through educational materials and applications that guide dietary choices in various settings.