Magnetically programmed soft structures with complex, fast, and reversible deformation capabilities are transforming various fields including soft robotics, wearable devices, and active metamaterials. While the encoded magnetization profile determines the shape-transformation of the magnetic soft structures, the current design methods are mainly limited to intuition-based trial and error process. In this work, a data-driven inverse design optimization approach for magnetically programmed soft structures is introduced to achieve complex shape-transformations. The proposed method is optimizing the design of the magnetization profile by utilizing a genetic algorithm relying on fitness and novelty function running cost-effectively in a simulation environment. Inverse design optimization of magnetization profiles for the quasi-static shape-transformation of 2D linear beams into 'M', 'P', and 'I' letter shapes are presented. 3D magnetization profile optimization enabled 3D deformation a rotating beam demonstration. The presented approach is also expanded to design of 3D magnetization profile for 3D shape-transformation of a linear beam rotating along its longitudinal axis. The data-driven inverse design approach established here paves the way for the automated design of magnetic soft structures with complex 3D shape-transformations.