The article mainly studies the KNN algorithm based on SVM and local weighting. In the research process, the basic concepts and implementation principles of the KNN algorithm were first analyzed. On this basis, SVM model and local weighting method are introduced to improve KNN algorithm, and the improved algorithm is applied to the case study of breast cancer recognition. Finally, simulation experiments were conducted on the constructed theoretical framework. The experimental results show that compared with the traditional KNN algorithm, the KNN algorithm based on SVM and local weighting exhibits higher accuracy in classification performance by introducing a weight mechanism and SVM model, effectively compensating for the shortcomings of the traditional KNN algorithm in classification performance and significantly improving the accuracy of target classification.