# Adaptive Classification Algorithm Design for Online Teaching Resources of Opera Singing

Authors: Chuan Xu
Journal: Mobile Information Systems
 (2022)

---

## Abstract

In the context of the integration of each professional course’s online education platform and teaching knowledge system, teaching resources are experiencing explosive growth, and classroom-based instruction is gradually being replaced by resource-based instruction. In the modern era, the optimization, integration, and efficient use of online teaching resources have become central concerns in education. In particular, the categorization and integration of resources have become the central focus of teaching work. The cognitive stratification theory classifies and orders the educational objectives in the cognitive domain in a scientific manner, which provides teachers with important ideas and foundations for implementing online and offline integrated teaching designs centered on the students’ skill acquisition. Adaptive classification algorithm is introduced to subdivide the objectives of online singing teaching resources, and on this basis, the online resources are classified and integrated according to the characteristics of different teaching sessions, thereby achieving the efficient use of resources, which is an innovative path of singing resources classification and integration in the new stage of online resources teaching.


---

## Body

## 1. Introduction

Considering the current state of opera singing instruction in China, the number of students choosing this major is on the rise [1]. As each student’s vocal foundation and learning aptitude varies, this has a significant impact on opera singing educators’ normal methods of instruction. It is clear that traditional methods of teaching opera singing can no longer meet the requirements of the new era.Since 2013, the development of online resource platforms such as massive open online courses (MOOC) has accelerated, and the launch of online education platforms such as National Quality Courses, Online Open Courses, and University Open Online Courses (UOOC) Consortium has integrated information technology with education teaching in order to enhance the quality of online courses and promote educational equity [2]. Watching course videos is one of the most important learning links for students. Different lecture formats, subject matter, and media applications determine various video presentation formats.Since the online resource platform community encourages community members to freely create, publish, and share knowledge resources, and platform activities are unrestricted by time and space, it has gradually evolved into a massive dynamic knowledge resource repository that absorbs massive amounts of information and has become an essential location for global knowledge management, knowledge learning, knowledge sharing, and knowledge innovation [3]. However, the constantly updated and ever-expanding information resources will undoubtedly reduce the efficiency of users in locating the relevant resources they require, preventing students from discovering and utilizing the resources effectively and aggravating the problem of information overload.Therefore, a reasonable description, annotation, organization, and management of community knowledge resources can increase the efficiency of user community information retrieval and browsing and promote the use and sharing of knowledge [4]. To this end, this paper uses the adaptive weighted KNN algorithm to reasonably classify the resource data for the opera singing resources of the online platform, in order to conduct a comparative analysis for different types of classification systems, with the goal of providing relevant scientific researchers and online community practitioners with a comprehensive understanding of the current field of online community classification systems, thereby assisting researchers in recognizing the most effective classification systems. This paper is intended to provide researchers and online community practitioners with a comprehensive understanding of the current online community classification system. In addition, this paper can serve as a foundation for online community developers to construct a classification system that is conducive to the improvement and refinement of existing classification systems as well as the design and construction of new classification systems to facilitate the description and labeling of resources, information organization, and knowledge discovery in communities.The main contributions of this paper are as follows.(1)
Ak value adaptive weighted KNN algorithm is proposed in this paper, and the algorithm is applied to the classification of opera singing online resources with good results [5].(2)
Considering the distribution of sample data, this paper achieves the adaptive value ofk according to the local density of the nearest neighbor points of the sample to be tested, which avoids the shortcoming of the traditional KNN method of fixed k value and makes the selection of the number of nearest neighbor points more reasonable.(3)
The case study shows that this method can make up for the shortcomings of the traditional KNN algorithm by adaptively taking the value ofk and considering the sample distribution when weighting and has a higher accuracy rate compared with the modified three-ratio method [5], back-propagation neural network (BPNN) [6], support vector machine (SVM) [7], and the traditional KNN classifier.The first chapter, which is the introduction, contains a description of the purpose, importance, and contribution of this work. The second chapter of the paper’s related work provides an introduction and summary of the earlier work. The third chapter, Methods, provides a detailed explanation of the methodology used in this paper. The experimental findings and an analysis of this method’s superiority are covered in the fourth chapter. The conclusion, which summarizes this paper’s work and discusses its flaws and future directions, is the last chapter.


## 2. Related Work

### 2.1. Resources for Teaching Opera Singing

Online resources must be evaluated based on whether or not they contribute to the growth of students. Due to the individuality and diversity of each student, distance online resources must be utilized for effective teaching and learning with the ultimate goal of fostering individualized learning. Taking into account their individual differences, students should seek out learning resources that match their characteristics [8]. Teaching and learning resources should be categorized according to the following principles, based on the needs of students:(1)
Classification according to needs.Different learning purposes generate different learning needs. Students have both short-term learning needs for examination purposes and needs for knowledge exploration out of personal interest, and also hope that teaching resources can help to improve their professional abilities in the long run.(2)
Designing an index of questionsThe most effective state of opera singing learning is stage-based, libretto-based, or emotionally inclined learning. Are the questions set scientifically in the teaching resources? The set scenarios should be open and diffuse to facilitate students’ imitation and learning.(3)
Higher level of education literacy in stage singing refers to the internal psychological quality and external form, voice, and some other professional qualities that can adapt to the requirements of film and television art creation, such as observation, imagination, focus, perception, judgment, and expression. The teaching staff’s behavior, mannerisms, and speech will leave a visual impression on students through video images that can be viewed multiple times. It is essential to master specific camera skills, pay constant attention to improving their stage, shape a positive image of the photograph, discover their own potential, and present their best side to the learners.


### 2.2. Online Resource Platform Categorization

#### 2.2.1. Classification Method of Resources

The classification method is generally based on disciplinary clustering, and the hierarchical division of knowledge categories is based on the nature and logical level of disciplines, so as to achieve the orderly organization of information. Its compilation, revision, and maintenance are all carried out by professional and technical personnel in the fields of library and intelligence. The taxonomy emphasizes systematicity and has a stable hierarchical classification scheme. The strict affiliation or parallelism between categories can guide users to independently expand or narrow the scope of search resources, thereby improving the search rate and accuracy [9].The subject method, in contrast to the discipline-based classification method, is object-oriented and centered on the subject of the object. It is a method that uses the subject words that express the characteristics of the document’s content as the search mark and organizes the document according to the word order of the mark [10]. In contrast to natural language, which lacks lexical control, the subject word list is a collection of strictly defined and organized normative subject words that facilitate the development of a rigorous and standard classification system.


#### 2.2.2. User Taxonomy

The classification method is generally based on disciplinary clustering, and the hierarchical division of knowledge categories is based on the nature and logical level of disciplines, so as to achieve the orderly organization of information. Its compilation, revision, and maintenance are all carried out by professional and technical personnel in the fields of library and intelligence. The taxonomy emphasizes systematicity and has a stable hierarchical classification scheme. The strict affiliation or parallelism between categories can guide users to independently expand or narrow the scope of search resources, thereby improving the search rate and accuracy [9].The subject method, in contrast to the discipline-based classification method, is object-oriented and centered on the subject of the object. It is a method that uses the subject words that express the characteristics of the document’s content as the search mark and organizes the document according to the word order of the mark [10]. In contrast to natural language, which lacks lexical control, the subject word list is a collection of strictly defined and organized normative subject words that facilitate the development of a rigorous and standard classification system.


### 2.3. KNN Clustering

#### 2.3.1. Traditional KNN Algorithm

TheK nearest neighbor (KNN) algorithm [11] is a simple and classical machine learning classification method. The samples are classified by measuring the distance (usually using Euclidean distance) or similarity between the samples to be classified and the known class samples. The algorithm steps are described as follows:(1)
The distance between sample points to all sample points is calculated using the Euclidean distance [12], which is defined by the following formula:(1)dx,y=∑i=1nyi−xi2,where d(x, y) is the distance between sample x and sample y; n is the feature dimension.(2)
The samples are sorted incrementally according to the calculated Euclidean distance size. If the distance is smaller, the higher the similarity is.(3)
Select the firstk nearest neighbor sample points.(4)
Count the number ofk nearest neighbor sample points belonging to each category.(5)
Using the voting method and the principle of minority rule, the category with the highest frequency among thek neighboring sample points is used as the prediction category of the sample point.It can be seen that there is only one hyperparameterk in the KNN algorithm, and the determination of the k value plays a crucial role in the prediction results of the KNN algorithm. K value is too small, which will easily lead to overfitting of the KNN algorithm; k value is too large, the nearest neighbor error of the algorithm will be large, and underfitting will easily occur. In addition, when the data samples are unbalanced, the prediction results of the KNN method will be biased towards the sample number dominant class, and the prediction accuracy of the rare class is low.


## 2.1. Resources for Teaching Opera Singing

Online resources must be evaluated based on whether or not they contribute to the growth of students. Due to the individuality and diversity of each student, distance online resources must be utilized for effective teaching and learning with the ultimate goal of fostering individualized learning. Taking into account their individual differences, students should seek out learning resources that match their characteristics [8]. Teaching and learning resources should be categorized according to the following principles, based on the needs of students:(1)
Classification according to needs.Different learning purposes generate different learning needs. Students have both short-term learning needs for examination purposes and needs for knowledge exploration out of personal interest, and also hope that teaching resources can help to improve their professional abilities in the long run.(2)
Designing an index of questionsThe most effective state of opera singing learning is stage-based, libretto-based, or emotionally inclined learning. Are the questions set scientifically in the teaching resources? The set scenarios should be open and diffuse to facilitate students’ imitation and learning.(3)
Higher level of education literacy in stage singing refers to the internal psychological quality and external form, voice, and some other professional qualities that can adapt to the requirements of film and television art creation, such as observation, imagination, focus, perception, judgment, and expression. The teaching staff’s behavior, mannerisms, and speech will leave a visual impression on students through video images that can be viewed multiple times. It is essential to master specific camera skills, pay constant attention to improving their stage, shape a positive image of the photograph, discover their own potential, and present their best side to the learners.


## 2.2. Online Resource Platform Categorization

### 2.2.1. Classification Method of Resources

The classification method is generally based on disciplinary clustering, and the hierarchical division of knowledge categories is based on the nature and logical level of disciplines, so as to achieve the orderly organization of information. Its compilation, revision, and maintenance are all carried out by professional and technical personnel in the fields of library and intelligence. The taxonomy emphasizes systematicity and has a stable hierarchical classification scheme. The strict affiliation or parallelism between categories can guide users to independently expand or narrow the scope of search resources, thereby improving the search rate and accuracy [9].The subject method, in contrast to the discipline-based classification method, is object-oriented and centered on the subject of the object. It is a method that uses the subject words that express the characteristics of the document’s content as the search mark and organizes the document according to the word order of the mark [10]. In contrast to natural language, which lacks lexical control, the subject word list is a collection of strictly defined and organized normative subject words that facilitate the development of a rigorous and standard classification system.


### 2.2.2. User Taxonomy

The classification method is generally based on disciplinary clustering, and the hierarchical division of knowledge categories is based on the nature and logical level of disciplines, so as to achieve the orderly organization of information. Its compilation, revision, and maintenance are all carried out by professional and technical personnel in the fields of library and intelligence. The taxonomy emphasizes systematicity and has a stable hierarchical classification scheme. The strict affiliation or parallelism between categories can guide users to independently expand or narrow the scope of search resources, thereby improving the search rate and accuracy [9].The subject method, in contrast to the discipline-based classification method, is object-oriented and centered on the subject of the object. It is a method that uses the subject words that express the characteristics of the document’s content as the search mark and organizes the document according to the word order of the mark [10]. In contrast to natural language, which lacks lexical control, the subject word list is a collection of strictly defined and organized normative subject words that facilitate the development of a rigorous and standard classification system.


## 2.2.1. Classification Method of Resources

The classification method is generally based on disciplinary clustering, and the hierarchical division of knowledge categories is based on the nature and logical level of disciplines, so as to achieve the orderly organization of information. Its compilation, revision, and maintenance are all carried out by professional and technical personnel in the fields of library and intelligence. The taxonomy emphasizes systematicity and has a stable hierarchical classification scheme. The strict affiliation or parallelism between categories can guide users to independently expand or narrow the scope of search resources, thereby improving the search rate and accuracy [9].The subject method, in contrast to the discipline-based classification method, is object-oriented and centered on the subject of the object. It is a method that uses the subject words that express the characteristics of the document’s content as the search mark and organizes the document according to the word order of the mark [10]. In contrast to natural language, which lacks lexical control, the subject word list is a collection of strictly defined and organized normative subject words that facilitate the development of a rigorous and standard classification system.


## 2.2.2. User Taxonomy

The classification method is generally based on disciplinary clustering, and the hierarchical division of knowledge categories is based on the nature and logical level of disciplines, so as to achieve the orderly organization of information. Its compilation, revision, and maintenance are all carried out by professional and technical personnel in the fields of library and intelligence. The taxonomy emphasizes systematicity and has a stable hierarchical classification scheme. The strict affiliation or parallelism between categories can guide users to independently expand or narrow the scope of search resources, thereby improving the search rate and accuracy [9].The subject method, in contrast to the discipline-based classification method, is object-oriented and centered on the subject of the object. It is a method that uses the subject words that express the characteristics of the document’s content as the search mark and organizes the document according to the word order of the mark [10]. In contrast to natural language, which lacks lexical control, the subject word list is a collection of strictly defined and organized normative subject words that facilitate the development of a rigorous and standard classification system.


## 2.3. KNN Clustering

### 2.3.1. Traditional KNN Algorithm

TheK nearest neighbor (KNN) algorithm [11] is a simple and classical machine learning classification method. The samples are classified by measuring the distance (usually using Euclidean distance) or similarity between the samples to be classified and the known class samples. The algorithm steps are described as follows:(1)
The distance between sample points to all sample points is calculated using the Euclidean distance [12], which is defined by the following formula:(1)dx,y=∑i=1nyi−xi2,where d(x, y) is the distance between sample x and sample y; n is the feature dimension.(2)
The samples are sorted incrementally according to the calculated Euclidean distance size. If the distance is smaller, the higher the similarity is.(3)
Select the firstk nearest neighbor sample points.(4)
Count the number ofk nearest neighbor sample points belonging to each category.(5)
Using the voting method and the principle of minority rule, the category with the highest frequency among thek neighboring sample points is used as the prediction category of the sample point.It can be seen that there is only one hyperparameterk in the KNN algorithm, and the determination of the k value plays a crucial role in the prediction results of the KNN algorithm. K value is too small, which will easily lead to overfitting of the KNN algorithm; k value is too large, the nearest neighbor error of the algorithm will be large, and underfitting will easily occur. In addition, when the data samples are unbalanced, the prediction results of the KNN method will be biased towards the sample number dominant class, and the prediction accuracy of the rare class is low.


## 2.3.1. Traditional KNN Algorithm

TheK nearest neighbor (KNN) algorithm [11] is a simple and classical machine learning classification method. The samples are classified by measuring the distance (usually using Euclidean distance) or similarity between the samples to be classified and the known class samples. The algorithm steps are described as follows:(1)
The distance between sample points to all sample points is calculated using the Euclidean distance [12], which is defined by the following formula:(1)dx,y=∑i=1nyi−xi2,where d(x, y) is the distance between sample x and sample y; n is the feature dimension.(2)
The samples are sorted incrementally according to the calculated Euclidean distance size. If the distance is smaller, the higher the similarity is.(3)
Select the firstk nearest neighbor sample points.(4)
Count the number ofk nearest neighbor sample points belonging to each category.(5)
Using the voting method and the principle of minority rule, the category with the highest frequency among thek neighboring sample points is used as the prediction category of the sample point.It can be seen that there is only one hyperparameterk in the KNN algorithm, and the determination of the k value plays a crucial role in the prediction results of the KNN algorithm. K value is too small, which will easily lead to overfitting of the KNN algorithm; k value is too large, the nearest neighbor error of the algorithm will be large, and underfitting will easily occur. In addition, when the data samples are unbalanced, the prediction results of the KNN method will be biased towards the sample number dominant class, and the prediction accuracy of the rare class is low.


## 3. Method

In order to adapt thek values in the KNN algorithm to the data distribution and to consider the importance of each nearest neighbor in the classification, this paper adaptively takes the k values according to the local data density and combines the Euclidean distance and distribution similarity to weight each nearest neighbor in order to make the final classification results more reasonable.


### 3.1. Outlier Detection

Since the classification of the KNN algorithm is based on the class of the nearest neighbors of the sample to be measured, if the nearest neighbors contain outlier data, it will adversely affect the results. Therefore, it is necessary to perform outlier detection on the sample data to eliminate obvious outlier samples and reduce the interference to the classification results. In this paper, we detect outlier samples by calculating the local anomaly factor of each sample point [13], and the basic principle is as follows.Let the distance between pointp and the kth nearest neighbor in data set D be dkp, and establish the nearest neighbor ensemble Nkp of point p based on this distance; that is, the distance between all data points in Nkp and point p ≤ dkp, and Nkp is called the distance neighborhood of point p, denoted as(2)Nkp=q|dp,q≤dkp.In equation (2), dp,q is the distance between data points p and q. If dp,q > dkp, the reachable distance between point p and point q is defined as d (p, q); if d (p, q) ≤ dkp, the reachable distance is defined as dkp, i.e.,(3)dreachp,q=maxdkp,dp,q.The local reachable density is calculated based on the reachable distance of the data point and used as the relative density of the data point, and the local reachable density is calculated according to the following equation:(4)lrdkp=Nkp∑q∈Nkpdreachp,q.In Equation (4), lrdkp denotes the local reachable density of point p. The larger its value, the greater the possibility that point p is the same kind of point as its immediate neighbors; conversely, the greater the possibility that point p is an outlier.(5)LOFkp=1Nkp∑q∈Nkplrdkqlrdkp.To further express the possibility of pointp being out of cluster, define the local anomaly factor LOFkp, which is the average of the ratio of the local reachable density of the kth distance neighborhood Nkp of point p to the local reachable density of point p.If the value is closer to 1, it means that the density of pointp is similar to its neighboring points; if the value is less than 1, it means that the density at point p is greater than the density of neighboring points; if the value is greater than 1, it means that the density at point p is less than the density of neighboring points; that is, the larger the value is, the greater the possibility that point p is an outlier.


### 3.2. AdaptiveK Value Based on Local Density

To address the drawback that thek value in the traditional KNN method is fixed and cannot be adapted to the data distribution, this paper selects the k value based on the local density of the data to achieve the adaptive value. To facilitate classification, the k value is typically assumed to be an odd number, and its range is restricted to the interval [14] to prevent interference from the nearest neighbor and reduce computational complexity.Letk represents the number of the sample’s nearest neighbors, d represents the distance between the sample and the k th nearest neighbor sample, and define the sample local density as the number of nearest neighbor samples per unit area.(6)ρ=kπd2.The value ofk is taken in a limited interval, and the magnitude of the local density is recorded for different k values. If the density is larger, it means that the k value is more credible, and finally, the k value when the density is the largest is taken as the number of nearest neighbors k of the sample point to be tested.


### 3.3. Weighted KNN

The weighted KNN algorithm is a classification method based on mathematical statistics [9]. Let X=xi,li,xi∈Rd,i=1,2,...,n be a training set consisting of n samples [15], each sample xi has a known class identity li, li∈l1,l2,...,lr. xt is the sample to be tested, and its class lt is to be tested. The basic idea of weighted KNN classification is that for a given test sample xt, find its k nearest neighbors in the training set and determine the classification attribute lt of the test sample xt by voting on the classification attributes of the k nearest neighbors:(7)Mlj=∑li∈LPli|xtRli,lj,where Pli|xt is the probability of classifying the test sample xt as li, Rli,lj is the error arising from classifying attribute li as lj, and the weighted KNN sets all(8)Rli,lj=0,i=j1,i≠j.The specific steps of the weighted KNN implementation for classification are as follows:(1)
For the test samplext, calculate the distance dxt,xi between xt and each training sample xi [16] using the Euclidean distance formula:(9)dxt,xi=∑j=1dxtj−xij21/2.Findk + 1 nearest neighbor samples xt,1,xt,2,...,xt,k+1, k + 1 of xt from the training set X according to the distance magnitude.(2)
From thek + 1 nearest neighbor samples, select the sample with the largest distance from xt as xt,k+1, and the corresponding distance as dxt,xt,k+1, and use dxt,xt,k+1 to normalize the distances of the other k nearest neighbor samples from xt [17]:(10)Dxt,xi=dxt,xidxt,xt,k+1,i=1,2,k.(3)
For the normalized distanceDxt,xi, use the Gaussian kernel function to transform it into the same kind of probability pxi|xt of xt and xi, i.e.,(11)pxi|xt=12πexp−Dxt,xi2.(4)
Based on the like-kind probabilitypxi|xt of xt with k nearest neighbor samples, find the posterior probability pli|xt of xi being a category lii=1,2,...,r, i.e.,(12)pli|xt=∑xt∈Xpxi|xt,li=lt0,others∑xi∈Xpxi|xt.The weighted KNN method does not yet calculate the exact categorical attribute value ofxt but gives the most probable categorical attribute value, i.e,(13)KNNxt=argmaxli∈Lpli|xtJ,where KNNxt denotes the classification result of the weighted KNN method corresponding to the tested sample xt.The weighted KNN assigns different weights to the nearest neighbor samples according to the similarity between each nearest neighbor sample and the test sample, so that the classification result of the test sample is closer to the training sample with higher similarity [18]. This further weakens the sensitivity of k value selection and strengthens the robustness of the classification results.


### 3.4. Resource Classification Steps

Thek value adaptive weighted KNN method proposed in this paper is used in the classification of opera singing resources to establish a classification model, and the specific steps are as follows.(1)
Collect the resource sample data, and normalize the original data by the logarithmic transformation method according to the equation, and then, randomly divide it into training sample set and test sample set according to the ratio of 3 : 1(2)
Perform outlier detection on the normalized training sample data, and eliminate obvious outlier samples(3)
Adaptively taking thek value according to the local density of the samples(4)
To consider the distance between each nearest neighbor point and the sample to be tested, as well as the relationship between the sample to be tested and the distribution of nearest neighbor points, and to calculate the weights of the nearest neighbor points(5)
Counting the categories of each nearest neighbor point of the sample points to be tested, calculating the total weights of each category of nearest neighbor points, and classifying the sample to be tested with the principle of maximum weight [19]


## 3.1. Outlier Detection

Since the classification of the KNN algorithm is based on the class of the nearest neighbors of the sample to be measured, if the nearest neighbors contain outlier data, it will adversely affect the results. Therefore, it is necessary to perform outlier detection on the sample data to eliminate obvious outlier samples and reduce the interference to the classification results. In this paper, we detect outlier samples by calculating the local anomaly factor of each sample point [13], and the basic principle is as follows.Let the distance between pointp and the kth nearest neighbor in data set D be dkp, and establish the nearest neighbor ensemble Nkp of point p based on this distance; that is, the distance between all data points in Nkp and point p ≤ dkp, and Nkp is called the distance neighborhood of point p, denoted as(2)Nkp=q|dp,q≤dkp.In equation (2), dp,q is the distance between data points p and q. If dp,q > dkp, the reachable distance between point p and point q is defined as d (p, q); if d (p, q) ≤ dkp, the reachable distance is defined as dkp, i.e.,(3)dreachp,q=maxdkp,dp,q.The local reachable density is calculated based on the reachable distance of the data point and used as the relative density of the data point, and the local reachable density is calculated according to the following equation:(4)lrdkp=Nkp∑q∈Nkpdreachp,q.In Equation (4), lrdkp denotes the local reachable density of point p. The larger its value, the greater the possibility that point p is the same kind of point as its immediate neighbors; conversely, the greater the possibility that point p is an outlier.(5)LOFkp=1Nkp∑q∈Nkplrdkqlrdkp.To further express the possibility of pointp being out of cluster, define the local anomaly factor LOFkp, which is the average of the ratio of the local reachable density of the kth distance neighborhood Nkp of point p to the local reachable density of point p.If the value is closer to 1, it means that the density of pointp is similar to its neighboring points; if the value is less than 1, it means that the density at point p is greater than the density of neighboring points; if the value is greater than 1, it means that the density at point p is less than the density of neighboring points; that is, the larger the value is, the greater the possibility that point p is an outlier.


## 3.2. AdaptiveK Value Based on Local Density

To address the drawback that thek value in the traditional KNN method is fixed and cannot be adapted to the data distribution, this paper selects the k value based on the local density of the data to achieve the adaptive value. To facilitate classification, the k value is typically assumed to be an odd number, and its range is restricted to the interval [14] to prevent interference from the nearest neighbor and reduce computational complexity.Letk represents the number of the sample’s nearest neighbors, d represents the distance between the sample and the k th nearest neighbor sample, and define the sample local density as the number of nearest neighbor samples per unit area.(6)ρ=kπd2.The value ofk is taken in a limited interval, and the magnitude of the local density is recorded for different k values. If the density is larger, it means that the k value is more credible, and finally, the k value when the density is the largest is taken as the number of nearest neighbors k of the sample point to be tested.


## 3.3. Weighted KNN

The weighted KNN algorithm is a classification method based on mathematical statistics [9]. Let X=xi,li,xi∈Rd,i=1,2,...,n be a training set consisting of n samples [15], each sample xi has a known class identity li, li∈l1,l2,...,lr. xt is the sample to be tested, and its class lt is to be tested. The basic idea of weighted KNN classification is that for a given test sample xt, find its k nearest neighbors in the training set and determine the classification attribute lt of the test sample xt by voting on the classification attributes of the k nearest neighbors:(7)Mlj=∑li∈LPli|xtRli,lj,where Pli|xt is the probability of classifying the test sample xt as li, Rli,lj is the error arising from classifying attribute li as lj, and the weighted KNN sets all(8)Rli,lj=0,i=j1,i≠j.The specific steps of the weighted KNN implementation for classification are as follows:(1)
For the test samplext, calculate the distance dxt,xi between xt and each training sample xi [16] using the Euclidean distance formula:(9)dxt,xi=∑j=1dxtj−xij21/2.Findk + 1 nearest neighbor samples xt,1,xt,2,...,xt,k+1, k + 1 of xt from the training set X according to the distance magnitude.(2)
From thek + 1 nearest neighbor samples, select the sample with the largest distance from xt as xt,k+1, and the corresponding distance as dxt,xt,k+1, and use dxt,xt,k+1 to normalize the distances of the other k nearest neighbor samples from xt [17]:(10)Dxt,xi=dxt,xidxt,xt,k+1,i=1,2,k.(3)
For the normalized distanceDxt,xi, use the Gaussian kernel function to transform it into the same kind of probability pxi|xt of xt and xi, i.e.,(11)pxi|xt=12πexp−Dxt,xi2.(4)
Based on the like-kind probabilitypxi|xt of xt with k nearest neighbor samples, find the posterior probability pli|xt of xi being a category lii=1,2,...,r, i.e.,(12)pli|xt=∑xt∈Xpxi|xt,li=lt0,others∑xi∈Xpxi|xt.The weighted KNN method does not yet calculate the exact categorical attribute value ofxt but gives the most probable categorical attribute value, i.e,(13)KNNxt=argmaxli∈Lpli|xtJ,where KNNxt denotes the classification result of the weighted KNN method corresponding to the tested sample xt.The weighted KNN assigns different weights to the nearest neighbor samples according to the similarity between each nearest neighbor sample and the test sample, so that the classification result of the test sample is closer to the training sample with higher similarity [18]. This further weakens the sensitivity of k value selection and strengthens the robustness of the classification results.


## 3.4. Resource Classification Steps

Thek value adaptive weighted KNN method proposed in this paper is used in the classification of opera singing resources to establish a classification model, and the specific steps are as follows.(1)
Collect the resource sample data, and normalize the original data by the logarithmic transformation method according to the equation, and then, randomly divide it into training sample set and test sample set according to the ratio of 3 : 1(2)
Perform outlier detection on the normalized training sample data, and eliminate obvious outlier samples(3)
Adaptively taking thek value according to the local density of the samples(4)
To consider the distance between each nearest neighbor point and the sample to be tested, as well as the relationship between the sample to be tested and the distribution of nearest neighbor points, and to calculate the weights of the nearest neighbor points(5)
Counting the categories of each nearest neighbor point of the sample points to be tested, calculating the total weights of each category of nearest neighbor points, and classifying the sample to be tested with the principle of maximum weight [19]


## 4. Experimental Results and Analysis

### 4.1. Data Set

In this paper, we selected 452 opera singing course resources on the web online platform as sample data and analyzed them for the course evaluations as well as the number of resource video frames, and we divided the data into training set, test set, and validation set in the ratio of 300 : 100 : 52. Table1 shows the number of resource frames and resource evaluations of our course resources.Table 1
Dataset.
Training setTest setValidation setNumber of resources30010052Number of frames1773157643051Evaluation entries1866724276


### 4.2. Data Preprocessing

Since transformer data values are widely dispersed and even significantly different in magnitude, the raw data are typically preprocessed to eliminate excessive differences in data values, which impact the model’s stability and convergence. Commonly used data preprocessing methods are outlier normalization (MMN) [20], standard deviation normalization (ZSN), and inverse tangent function transformation (ATAN), etc.MMN and ZSN are linear preprocessing techniques that scale the original data to fit within a specified space. However, linear methods cannot reduce the order of magnitude differences between data and typically map each feature separately without considering the horizontal connection between features, resulting in the loss of valuable information from the original data. The data are distributed unevenly. The aforementioned analysis demonstrates that the aforementioned methods are unsuitable for transformer fault data with an uneven data distribution and a wide value distribution.The log-transform method can reduce the order-of-magnitude differences of the original data and make the data distribution more compact, while its overall mapping of the data can preserve the data characteristics reasonably well [21]. In this paper, we use log-transform to preprocess the data using the following equation, and Table 2 compares preprocessed and unpreprocessed data after 100 repetitions of the same training.(14)x′=log10xlog10xmax.Table 2
Comparison of the training process with and without data preprocessing.
Training sessionsConvergence accuracyStandard deviationRelative error1000.6726000(−0.5, 0.3)1001.843370(−1.1, 1.4)


### 4.3. Outlier Rejection

The outlier detection is performed on the training samples by category, and the distribution of local outliers is shown in Figure1.Figure 1
Factor distribution.As shown in Figure1, we can see that the local outlier value of the sample points usually fluctuates around 10 but fluctuates more at some “outliers,” so we take the threshold value of 15 to eliminate 10 “outliers” in the original data, i.e., outliers.As shown in Figure2, it can be seen that most of the excluded outliers are obviously outliers, and their elimination is beneficial to the final classification work.Figure 2
Outlier data distribution.


### 4.4. Comparison of Different Classification Algorithms

In this paper, we compare the traditional KNN, SVM, and our weighted KNN adaptive classification algorithm using the same data for experiments and statistically analyze the experimental results. The accuracy and F1 values of the classifiers on the test set are calculated, and the calculated results are organized in Table3. The ROC curves and AUC values for each model are shown in Figure3.Table 3
Algorithm accuracy and F1 comparison.
IndicatorsSVMKNNWeighted KNNAccuracy0.8730.8950.913F10.8510.8890.909Figure 3
Performance of different classifiers.As demonstrated in Figure4, the integrated model outperformed the three primary classifiers. The values of our accuracy and F1 indicators are greater than those of other classifiers, and the accuracy rate exceeds 90%, indicating that the model has improved classification performance and strong classification ability. The classification model implemented in this paper based on the weighted KNN algorithm is feasible and effective for the classification of opera singing resources, and it can be concluded.Figure 4
Performance of different classifiers.As shown in Figure3, the weighted KNN meta-classifier has an AUC of 0.94, which is also higher than the other meta-classifiers. In order of classification performance from highest to lowest, the other three algorithms are weighted KNN > KNN > SVM.


### 4.5. Ablation Study

We compared the effect of all the methods we used on the overall experimental results.


#### 4.5.1. Treatment of Experimental Datasets

We compare and analyze the effect of the distribution ratio of training and test data sets on the final results, and we do a comparative ablation experiment with or without setting the validation set, as shown in Table4.Table 4
Proportion of dataset.
Proportion (train : test)AccuracyF1Availability of validation set3 : 10.9130.90914 : 10.9070.89615 : 10.9120.90913 : 10.8820.87004 : 10.8950.81305 : 10.9100.8450


#### 4.5.2. Treatment of Experimental Datasets

We did ablation experiments on principal component analysis and outlier removal in the data preprocessing session, noting that the training and test datasets in this session used a 3 : 1 ratio, and we used the validation dataset, and the final results are shown in Table5, which shows that the use of these two methods in the data preprocessing session is also helpful for the results.Table 5
Proportion of dataset.
SessionAccuracyF1Both methods are used0.9130.909Only use PCA0.8770.786Use only outlier removal method0.8760.882


## 4.1. Data Set

In this paper, we selected 452 opera singing course resources on the web online platform as sample data and analyzed them for the course evaluations as well as the number of resource video frames, and we divided the data into training set, test set, and validation set in the ratio of 300 : 100 : 52. Table1 shows the number of resource frames and resource evaluations of our course resources.Table 1
Dataset.
Training setTest setValidation setNumber of resources30010052Number of frames1773157643051Evaluation entries1866724276


## 4.2. Data Preprocessing

Since transformer data values are widely dispersed and even significantly different in magnitude, the raw data are typically preprocessed to eliminate excessive differences in data values, which impact the model’s stability and convergence. Commonly used data preprocessing methods are outlier normalization (MMN) [20], standard deviation normalization (ZSN), and inverse tangent function transformation (ATAN), etc.MMN and ZSN are linear preprocessing techniques that scale the original data to fit within a specified space. However, linear methods cannot reduce the order of magnitude differences between data and typically map each feature separately without considering the horizontal connection between features, resulting in the loss of valuable information from the original data. The data are distributed unevenly. The aforementioned analysis demonstrates that the aforementioned methods are unsuitable for transformer fault data with an uneven data distribution and a wide value distribution.The log-transform method can reduce the order-of-magnitude differences of the original data and make the data distribution more compact, while its overall mapping of the data can preserve the data characteristics reasonably well [21]. In this paper, we use log-transform to preprocess the data using the following equation, and Table 2 compares preprocessed and unpreprocessed data after 100 repetitions of the same training.(14)x′=log10xlog10xmax.Table 2
Comparison of the training process with and without data preprocessing.
Training sessionsConvergence accuracyStandard deviationRelative error1000.6726000(−0.5, 0.3)1001.843370(−1.1, 1.4)


## 4.3. Outlier Rejection

The outlier detection is performed on the training samples by category, and the distribution of local outliers is shown in Figure1.Figure 1
Factor distribution.As shown in Figure1, we can see that the local outlier value of the sample points usually fluctuates around 10 but fluctuates more at some “outliers,” so we take the threshold value of 15 to eliminate 10 “outliers” in the original data, i.e., outliers.As shown in Figure2, it can be seen that most of the excluded outliers are obviously outliers, and their elimination is beneficial to the final classification work.Figure 2
Outlier data distribution.


## 4.4. Comparison of Different Classification Algorithms

In this paper, we compare the traditional KNN, SVM, and our weighted KNN adaptive classification algorithm using the same data for experiments and statistically analyze the experimental results. The accuracy and F1 values of the classifiers on the test set are calculated, and the calculated results are organized in Table3. The ROC curves and AUC values for each model are shown in Figure3.Table 3
Algorithm accuracy and F1 comparison.
IndicatorsSVMKNNWeighted KNNAccuracy0.8730.8950.913F10.8510.8890.909Figure 3
Performance of different classifiers.As demonstrated in Figure4, the integrated model outperformed the three primary classifiers. The values of our accuracy and F1 indicators are greater than those of other classifiers, and the accuracy rate exceeds 90%, indicating that the model has improved classification performance and strong classification ability. The classification model implemented in this paper based on the weighted KNN algorithm is feasible and effective for the classification of opera singing resources, and it can be concluded.Figure 4
Performance of different classifiers.As shown in Figure3, the weighted KNN meta-classifier has an AUC of 0.94, which is also higher than the other meta-classifiers. In order of classification performance from highest to lowest, the other three algorithms are weighted KNN > KNN > SVM.


## 4.5. Ablation Study

We compared the effect of all the methods we used on the overall experimental results.


### 4.5.1. Treatment of Experimental Datasets

We compare and analyze the effect of the distribution ratio of training and test data sets on the final results, and we do a comparative ablation experiment with or without setting the validation set, as shown in Table4.Table 4
Proportion of dataset.
Proportion (train : test)AccuracyF1Availability of validation set3 : 10.9130.90914 : 10.9070.89615 : 10.9120.90913 : 10.8820.87004 : 10.8950.81305 : 10.9100.8450


### 4.5.2. Treatment of Experimental Datasets

We did ablation experiments on principal component analysis and outlier removal in the data preprocessing session, noting that the training and test datasets in this session used a 3 : 1 ratio, and we used the validation dataset, and the final results are shown in Table5, which shows that the use of these two methods in the data preprocessing session is also helpful for the results.Table 5
Proportion of dataset.
SessionAccuracyF1Both methods are used0.9130.909Only use PCA0.8770.786Use only outlier removal method0.8760.882


## 4.5.1. Treatment of Experimental Datasets

We compare and analyze the effect of the distribution ratio of training and test data sets on the final results, and we do a comparative ablation experiment with or without setting the validation set, as shown in Table4.Table 4
Proportion of dataset.
Proportion (train : test)AccuracyF1Availability of validation set3 : 10.9130.90914 : 10.9070.89615 : 10.9120.90913 : 10.8820.87004 : 10.8950.81305 : 10.9100.8450


## 4.5.2. Treatment of Experimental Datasets

We did ablation experiments on principal component analysis and outlier removal in the data preprocessing session, noting that the training and test datasets in this session used a 3 : 1 ratio, and we used the validation dataset, and the final results are shown in Table5, which shows that the use of these two methods in the data preprocessing session is also helpful for the results.Table 5
Proportion of dataset.
SessionAccuracyF1Both methods are used0.9130.909Only use PCA0.8770.786Use only outlier removal method0.8760.882


## 5. Conclusion

In this paper, we collect online opera singing teaching resources on the current online teaching platform, apply an adaptive weighted KNN classification algorithm, and introduce an adaptive classification algorithm to subdivide the online singing teaching resources objectives in order to realize the personalized utilization of teaching resources for material-based and individualized instruction.Due to limited data collection and research time, this thesis contains some issues that will require additional work in the future.(1)
Due to the constraints, this paper only analyzes the algorithm’s performance based on the online resources discovered, and the training results may not be as accurate due to the limited number of resources. The next step will be to increase the amount of data used to train the model in order to improve its classification accuracy.(2)
In this paper, an adaptive classification algorithm is introduced to subdivide the online singing teaching resources target, and the criteria of classification are only based on online assessment and evaluation, and if the evaluation criteria change, the model must be modified for training, so a fair and general evaluation criterion must be determined [22–27].



---

*Source: 8609097-2022-09-30.xml*