This paper presents a comprehensive study on the application of modern machine learning methods for predictive maintenance based on the open AI4I Predictive Maintenance dataset. The primary goal of the research is to develop and compare both binary and multiclass classification models that enable not only the prediction of machine failures but also the identification of specific failure types. Considering the strong class imbalance (failures account for approximately 3 % of the dataset), a cost-sensitive optimization approach was implemented, where false negatives (missed failures) were penalized much more heavily than false positives (false alarms). The models investigated in this study include Logistic Regression, Random Forest, XGBoost, and LightGBM, with a particular focus on ensemble gradient boosting methods. Data preprocessing steps encompassed feature scaling, categorical encoding, and feature engineering, including the creation of new features such as Power, DeltaTemp, and a binary indicator of excessive tool wear. For binary classification, model performance was evaluated using the PR-AUC metric and Recall@Precision≥0.90, both of which are critical in safety-related domains. For multiclass classification, performance was assessed using confusion matrices and macro-averaged precision, recall, and F1-score. The experimental results demonstrated that among the baseline models, XGBoost achieved the best performance with PR-AUC=0.64, and after hyperparameter optimization, the score improved significantly to over 0.90, confirming its strong ability to detect failures. In the multiclass setup, XGBoost again outperformed other models, providing better balance across classes, while LightGBM faced challenges due to "no further splits with positive gain" warnings under restrictive parameter settings. Feature importance analysis using SHAP values highlighted the dominant role of Tool wear, Power, and Rotational speed in predicting failures. The practical contribution of this work lies in the demonstrated potential of machine learning models for early failure detection and proactive maintenance planning, enabling significant cost savings and operational reliability improvements. The study also emphasizes the effectiveness of combining cost-sensitive optimization with ensemble methods and establishes a foundation for future research directions, including time-to-failure regression and the use of deep neural networks.