Due to the problems of high complexity of transformer fault data,large number of learning parameters of algorithm and lack of the methods of efficient and accurate parameter optimization,taking oil-immersed trans-former as the research object,a new method of transformer fault diagnosis which uses Artificial Bee Colony algo-rithm(ABC)to optimize Random Forest(RF)is proposed.Firstly,the non-code ratios are constructed according to dissolved gas in oil,and then these non-code ratios are input to the fault diagnosis model.Secondly,and then ABC algorithm is used to optimize the two parameters of random forest(the number of decision trees and the depth of the decision trees)of the RF model.After establishing the ABC-RF fault diagnosis model,simulation a-nalysis is carried out using different feature quantities as well as models.The results show that using non-code ra-tios as the feature can improve the accuracy compared with the original gas data and the IEC ratio,and the ABC-RF model has significant advantages over ELM,CNN-LSTM,RF and WOA-RF models.