We present a machine learning-based mesh refinement technique for steady and unsteady incompressible flows. The clustering technique proposed by Otmani et al. (Phys Fluids 35(2):027112, 2023) is used to mark the viscous and turbulent regions for the flow past a cylinder at Re=40\\documentclass[12pt]{minimal} \\usepackage{amsmath} \\usepackage{wasysym} \\usepackage{amsfonts} \\usepackage{amssymb} \\usepackage{amsbsy} \\usepackage{mathrsfs} \\usepackage{upgreek} \\setlength{\\oddsidemargin}{-69pt} \\begin{document}$$Re=40$$\\end{document} (steady laminar flow), at Re=100\\documentclass[12pt]{minimal} \\usepackage{amsmath} \\usepackage{wasysym} \\usepackage{amsfonts} \\usepackage{amssymb} \\usepackage{amsbsy} \\usepackage{mathrsfs} \\usepackage{upgreek} \\setlength{\\oddsidemargin}{-69pt} \\begin{document}$$Re=100$$\\end{document} (unsteady laminar flow), and at Re=3900\\documentclass[12pt]{minimal} \\usepackage{amsmath} \\usepackage{wasysym} \\usepackage{amsfonts} \\usepackage{amssymb} \\usepackage{amsbsy} \\usepackage{mathrsfs} \\usepackage{upgreek} \\setlength{\\oddsidemargin}{-69pt} \\begin{document}$$Re=3900$$\\end{document} (unsteady turbulent flow). Within this clustered region, we use high mesh resolution, while downgrading the resolution outside, to show that it is possible to obtain levels of accuracy similar to those obtained when using a uniformly refined mesh. The mesh adaptation is effective, as the clustering successfully identifies the two flow regions, a viscous/turbulent dominated region (including the boundary layer and wake) that requires high resolution and an inviscid/irrotational region, which only requires low resolution. The new clustering sensor is compared with traditional feature-based sensors (Q-criterion and vorticity based) commonly used for mesh adaptation. Unlike traditional sensors that rely on problem-dependent thresholds, our novel approach eliminates the need for such thresholds and locates the regions that require adaptation. After the initial validation using flows past cylinders, the clustering technique is applied in an engineering context to study the flow around a horizontal axis wind turbine configuration which has been tested experimentally at the Norwegian University of Science and Technology. The data used within this framework are generated using a high-order discontinuous Galerkin solver, allowing to locally refine the polynomial order (p-refinement) in each element of the clustered region. For the laminar test cases, we can reduce the computational cost by 32% (steady Re=40\\documentclass[12pt]{minimal} \\usepackage{amsmath} \\usepackage{wasysym} \\usepackage{amsfonts} \\usepackage{amssymb} \\usepackage{amsbsy} \\usepackage{mathrsfs} \\usepackage{upgreek} \\setlength{\\oddsidemargin}{-69pt} \\begin{document}$$Re=40$$\\end{document} case) and 20% (unsteady Re=100\\documentclass[12pt]{minimal} \\usepackage{amsmath} \\usepackage{wasysym} \\usepackage{amsfonts} \\usepackage{amssymb} \\usepackage{amsbsy} \\usepackage{mathrsfs} \\usepackage{upgreek} \\setlength{\\oddsidemargin}{-69pt} \\begin{document}$$Re=100$$\\end{document} case), while we get a reduction of 33% for the Re=3900\\documentclass[12pt]{minimal} \\usepackage{amsmath} \\usepackage{wasysym} \\usepackage{amsfonts} \\usepackage{amssymb} \\usepackage{amsbsy} \\usepackage{mathrsfs} \\usepackage{upgreek} \\setlength{\\oddsidemargin}{-69pt} \\begin{document}$$Re=3900$$\\end{document} turbulent case. In the context of the wind turbine, a reduction of 43% in computational cost is observed, while maintaining the accuracy.