# Using Machine Learning for Web Page Classification in Search Engine Optimization
## 5 Research Methods
### Extraction of On-Page Factors  
The analysis of a data set can reveal which particular factors (independent variables) can be more important or less important in class prediction. The simplest way to achieve that is to rank variables according to their correlation with a class variable. Another approach is to utilize decision trees and prediction properties of a particular variable. Measures of variable importance that are used in decision trees can also be used to rank variables--not only those selected for branching in the tree nodes, but all the variables that are included. Information gain is the measure used in decision trees to decide which attribute should be split. It is calculated as a measure of entropy reduction caused by splitting on a particular attribute. By averaging the results of multiple trees that are built on \(n\) samples and \(m\) predictors (instead of on a full data set) we can reduce variance in tree-based methods and gain better results. This method is called \"random forest\" and can be used to detect important variables. Another method to detect important variables is \"Relief\", which is based on nearest-neighbor algorithm to assign a relevance weight to each feature. Chi square is also a common measure of variable importance in machine learning problems [62]. It tests the relationship between predictors (independent) and target variable (dependent). Variable ranks obtained by these measures are shown in Table 6. The top five values in each test are given in bold.  
The variables for which highest values were obtained in most tests (correlation, information gain, chi square, relief, random forest) were: Tkw (keyword frequency in the \"title\" tag), Mlen (length of the \"meta description\" tag), Mkw (keyword frequency in the \"meta description\" tag), h1 Kw (keyword frequency in the \"H1\" tag), and txtKw (keyword frequency in the page body). These variables can be treated as important factors for on-page optimization. They have also been identified in most previous research by other authors [24; 25; 26; 3; 4; 5; 22].  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Group** & **Variable Code** & **Description** \\ \hline Page header & Tlen & Length of content in the HTML “title” tag (word count) \\ \hline Expert 2 & Tkw & Keyword frequency in the HTML “title” tag \\  & Mlen & Length of content in the HTML “meta description” tag \\  & Mkw & Keyword frequency in the HTML “meta description” tag \\ \hline Headings & h1 & Number of occurrences of HTML H1 tag \\  & h1 len & Average length of content in HTML H1 tag \\  & h1 kw & Keyword frequency in HTML H1 tag \\  & h2 & Number of occurrences of HTML H2 tag \\  & h2 len & Average length of content in HTML H2 tag \\  & h2 kw & Keyword frequency in HTML H2 tag \\  & h3 & Number of occurrences of HTML H3 tag \\  & h3 len & Average length of content in HTML H3 tag \\  & h3 kw & Keyword frequency in HTML H3 tag \\ \hline Images & alt & Number of occurrences of the HTML ALT attribute in the \\  & altkw & IMG tag (only if ALT contains content) \\ \hline Links & linkkw & Keyword frequency in the ALT attribute \\  & linkout & Number of outbound links \\ \hline URL & urllen & URL length (chars) \\  & urllw & Keyword frequency in URL \\ \hline Text & txtlen & Text length in the page body \\  & txtkw & Keyword frequency in the page body text \\ \hline \hline \end{tabular}
\end{table}
Table 5: List of independent variables used in this research.