The purpose of this study is the accurate prediction of undrained shear strength using Standard Penetration Test results and soil consistency indices, such as water content and Atterberg limits. With this study, along with the conventional methods of simple and multiple linear regression models, three machine learning algorithms, random forest, gradient boosting and stacked models, are developed for prediction of undrained shear strength. These models are employed on a relatively large data set from different projects around Turkey covering 230 observations. As an improvement over the available studies in literature, this study utilizes correct statistical analyses techniques on a relatively large database, such as using a train/test split on the data set to avoid overfitting of the developed models. Furthermore, the validity and consistency of the prediction results are ensured with the correct use of statistical measures like p-value and cross-validation which were missing in previous studies. To compare the performances of the models developed in this study with the prior ones existing in literature, all models were applied on the test data set and their performances are evaluated in terms of the resulting root mean squared error (RMSE) values and coefficient of determination (R-2). Accordingly, the models developed in this study demonstrate superior prediction capabilities compared to all of the prior studies. Moreover, to facilitate the use of machine learning algorithms for prediction purposes, entire source code prepared for this study and the collected data set are provided as supplements of this study.