ML applications to optical systems and devices: from the design of Raman amplifiers to the management of NxN switches