  The Fermilab Linac delivers 400 MeV H- beam to the rest of the accelerator
chain. Providing stable intensity, energy, and emittance is key since it
directly affects downstream machines. To counter fluctuations of Linac output
due to various effects to be described below we are working on implementing
dynamic longitudinal parameter optimization based on Machine Learning (ML). As
inputs for the ML model, signals from beam diagnostics have to be well
understood and reliable. In this paper we discuss the status and plans for
ML-based optimization as well as preliminary results of diagnostics studies.
