We introduce CoSHA: a Code for Stellar properties Heuristic Assignment. In order to estimate the stellar properties, CoSHA implements a Gradient Tree Boosting algorithm to label each star across the parameter space ($T_{text{eff}}$, $log{g}$, $left[text{Fe}/text{H}right]$, and $left[alpha/text{Fe}right]$). We use CoSHA to estimate these stellar atmospheric parameters of $22,$k unique stars in the MaNGA Stellar Library (MaStar). To quantify the reliability of our approach, we run both internal tests using the Gottingen Stellar Library (GSL, a theoretical library) and the first data release of MaStar, and external tests by comparing the resulting distributions in the parameter space with the APOGEE estimates of the same properties. In summary, our parameter estimates span in the ranges: $T_{text{eff}}=[2900,12000],$K, $log{g}=[-0.5,5.6]$, $left[text{Fe}/text{H}right]=[-3.74,0.81]$, $left[alpha/text{Fe}right]=[-0.22,1.17]$. We report internal (external) uncertainties of the properties of $sigma_{T_{text{eff}}}sim48,(325),$K, $sigma_{log{g}}sim0.2,(0.4)$, $sigma_{left[text{Fe}/text{H}right]}sim0.13,(0.27)$, $sigma_{left[alpha/text{Fe}right]}sim0.09,(0.14)$. These uncertainties are comparable to those of other methods with similar objectives. Despite the fact that CoSHA is not aware of the spatial distribution of these physical properties in the Milky Way, we are able to recover the main trends known in the literature with great statistical confidence. The catalogue of physical properties can be accessed in url{http://ifs.astroscu.unam.mx/MaStar}.