  The frequentist method of profile likelihoods has recently received renewed
attention in the field of cosmology. This is because the results of inferences
based on the latter may differ from those of Bayesian inferences, either
because of prior choices or because of non-Gaussianity in the likelihood
function. Consequently, both methods are required for a fully nuanced analysis.
However, in the last decades, cosmological parameter estimation has largely
been dominated by Bayesian statistics due to the numerical complexity of
constructing profile likelihoods, arising mainly from the need for a large
number of gradient-free optimisations of the likelihood function.
  In this paper, we show how to accommodate the computational requirements of
profile likelihoods using the publicly available neural network framework
CONNECT together with a novel modification of the gradient-based
$basin$-$hopping$ optimisation algorithm. Apart from the reduced evaluation
time of the likelihood due to the neural network, we also achieve an additional
speed-up of 1$-$2 orders of magnitude compared to profile likelihoods computed
with the gradient-free method of $simulated$ $annealing$, with excellent
agreement between the two. This allows for the production of typical triangle
plots normally associated with Bayesian marginalisation within cosmology (and
previously unachievable using likelihood maximisation because of the
prohibitive computational cost). We have tested the setup on three cosmological
models: the $\Lambda$CDM model, an extension with varying neutrino mass, and
finally a decaying cold dark matter model. Given the default precision settings
in CONNECT, we achieve a high precision in $\chi^2$ with a difference to the
results obtained by CLASS of $\Delta\chi^2\approx0.2$ (and, importantly,
without any bias in inferred parameter values) $-$ easily good enough for
profile likelihood analyses.
