Clouds are essential in climate, especially to evaluate the radiative balance in the Earth atmosphere and, their contribution depends on the type of cloud. In addition, cloud classification plays an important role in the development of different research and technological fields such as solar photovoltaic energy. We use ground-based zenith observations of cloud optical depth (COD) and cloud base height (CBH), at 1-minute intervals, to develop a clustering algorithm. It is based on non-supervised machine learning using k-means function. Due to the intrinsic characteristics of the measuring instruments, high-altitude clouds with large COD are not accurately represented. For this reason, a classification into six categories is performed. Regarding to COD, our machine learning method detects three COD clusters separated at 3.2 and 24.5. On the other hand, the three CBH clusters well identify low-, mid-and high-clouds, with centroids around 1500 m, 5399-6240 m, and 9589 m, respectively. A slight increase in these CBH boundaries with COD is also observed. Our clustering method is consistent and robust since it does not present any sensitivity regarding to the temporal window used to perform the clustering. The resulting clusters are consistent and in line with the cloud classification established by the WMO.In addition, the cloud fraction (CF) measured with an all-sky camera has been analyzed in terms of the defined cloud types. Our results indicate that the CF increases with COD, up to 24.5, and stabilize for thicker clouds for which overcast conditions, with CF > 70 %, are mostly observed.