In the recent years, we observe a dramatic boost of research in photonics empowered by the concepts of machine learning and artificial intelligence. The corresponding photonic systems, to which this new methodology is applied, can range from traditional optical waveguides to nanoantennas and metasurfaces, and these novel approaches underpin the fundamental principles of light-matter interaction developed for a smart design of intelligent photonic devices. Concepts and approaches of artificial intelligence and machine learning penetrate rapidly into the fundamental physics of light, and they provide effective tools for the study of the field of metaphotonics driven by opticallyinduced electric and magnetic resonances. Here, we introduce this new field with its application to metaphotonics and also present a summary of the basic concepts of machine learning with some specific examples developed and demonstrated for metasystems and metasurfaces.