# Survivability Prediction of Open Source Software with Polynomial Regression
## 3 Proposed Methodology: Predicting OSS Survivability with Maintenance Activity
### Generating Regression Model  
In this paper, we employ polynomial regression to forecast bug-fixing activities for several key reasons. Firstly, our objective is to predict numerical values, necessitating a regression model over classification approaches. Polynomial regression, capable of capturing the curved relationships among data points due to its polynomial basis, is particularly suited for our second reason: the potential nonlinear relationships between various metrics and \(\mathit{Trend}_{\mathit{bug}}\). Lastly, given the manageable number of features in our dataset, the model complexity remains low, making polynomial regression an intuitive choice. We opt for polynomial regression over linear models to mitigate increased prediction errors and inaccuracies in capturing complex data patterns [26]. Linear models, typically designed to fit data in a straight line, often fail to accurately predict values at the extremes, either significantly higher or lower than most data points. This limitation is visually represented in Figure 6, which contrasts the fitting capabilities of linear and nonlinear regression models for the 'Star' feature and its impact on the target variable. The figure underscores the inadequacy of linear models for nonlinear data, thereby justifying our preference for polynomial regression to enhance model accuracy through its inherent nonlinearity. To determine the degree of the polynomial, we evaluate the model across a range of degrees from 2 to 5, selecting the degree with the minimum RSE. Our research focuses on predicting the current and future survivability of OSS selections. Given the vast number of them, each with unique characteristics, our model must provide accurate results across diverse datasets. Since the RSE represents the model's error on the data, minimizing the RSE serves as the criterion for selecting the degree. Additionally, our goal is to capture the overall trend of the target through the model. Therefore, we limit the degree to 5 or less to capture general data changes rather than aiming for exact fitting. Figure 6: Differences between linear and nonlinear regression. When training our model, we employ cross-validation. Cross-validation is a technique used in machine learning to reliably evaluate the performance of a model and estimate its generalization ability by repeatedly evaluating the model on the different subsets of the given data, dividing it into training and testing sets [27]. This technique aids in estimating generalization ability, preventing overfitting, and selecting the optimal model. Additionally, it is useful for assessing model quality when the dataset is small. With a limited amount of test data, the reliability of model quality measurement might decrease. Therefore, we employ cross-validation to evaluate the model across multiple training-test dataset splits and enhance the reliability of the model quality by averaging the results. Cross-validation includes K-fold cross-validation, leave-one-out cross-validation, stratified cross-validation, time series cross-validation, and group cross-validation [28]. Among these, we opt for the first method. K-fold cross-validation involves dividing the data into \(k\) folds (subsets) as illustrated in Figure 7, using each fold as the test data while the rest serve as the training data to evaluate the model. Subsequently, as shown in Equation (6), this process is repeated \(k\) times to calculate the average performance of the model. Other methods are typically used for time series data, class imbalance, or grouped data. Since our conditions do not align with these criteria, we choose K-fold cross-validation. \[\theta=\frac{1}{k}\ \sum_{i=1}^{k}\ \theta_{i}\ (\theta_{i}\ \ \textit{is}\ \textit{performance}\ \textit{of}\ \textit{Fold}\ i) \tag{6}\]  
The entire process of creating this model is summarized in Algorithm 2 and Figure 8, which is implemented in R. Initially, the feature and target data are loaded. Then, the data are divided into training and test sets.