Machine learning is rapidly making its path into the natural sciences, including high-energy physics. We present the first study that infers, directly from experimental data, a functional form of fragmentation functions. The latter represent a key ingredient to describe physical observables measured in high-energy physics processes that involve hadron production, and predict their values at different energies. Fragmentation functions cannot be calculated in theory and have to be determined instead from data. Traditional approaches rely on global fits of experimental data to learn the parameters of a pre-assumed functional form inspired from phenomenological models of hadron production. This novel approach uses an ML technique, namely symbolic regression (SR), to learn an analytical model from measured charged hadron multiplicities. The function studied by SR resembles the Lund string function and describes the data well, thus representing a potential candidate for use in global FFs fits.