Nonorthogonal multiple access (NOMA) with multi-antenna base station (BS) is a promising technology for next-generation wireless communication, which has high potential in performance and user fairness. Since the performance of NOMA depends on the channel conditions, we can combine NOMA and reconfigurable intelligent surface (RIS), which is a large and passive antenna array and can optimize the wireless channel. However, the high dimensionality makes the RIS optimization a complicated problem. In this work, we propose a machine learning approach to solve the problem of joint optimization of precoding and RIS configuration. We apply the RIS to realize the quasi-degradation of the channel, which allows for optimal precoding in closed form. The neural network architecture RISnet is used, which is designed dedicatedly for RIS optimization. The proposed solution is superior than the works in the literature in terms of performance and computation time.