Machine learning was applied to optimize etching profile for line-and-space pattern sample in plasma etching. To investigate effect of difference of initial-learning dataset on optimization of etching profile, high-, medium-, and low-quality datasets were prepared. The high-quality dataset was composed of etching results relatively close to a target etching profile. The low-quality dataset was composed of etching results relatively far from the target etching profile. The medium-quality dataset was intermediate between the high- and low-quality dataset. For the machine learning, Kernel ridge regression method was used. After six learning cycles, better etching results were obtained by the medium- and low-quality datasets than to that in the whole initial-learning dataset. However, the etching results by the high-quality dataset did not exceed that in the whole initial-learning dataset. These results indicate that initial-learning dataset having etching results far from the target profile can be useful to optimize etching profile.