gravatar

L_S_Oluwatobi

Lamidi Samuel Oluwatobi

Recently Published

Polynomial Regression
This R Markdown document, titled Polynomial Regression by L.S. Oluwatobi, demonstrates the application of polynomial regression to a salary dataset. The script begins by importing the dataset, Position_Salaries.csv, and selecting relevant columns for analysis. It then splits the dataset into training and test sets using the caret package and applies feature scaling to numeric variables. A linear regression model is first fitted to examine the relationship between salary and job level, followed by a polynomial regression model where higher-degree terms (Level², Level³, Level⁴) are added to better capture nonlinear patterns. The results indicate that polynomial regression provides a significantly better fit compared to linear regression, as seen in the higher adjusted R-squared value and lower residual errors. The document further includes visualizations using ggplot2, plotting both the linear and polynomial regression predictions against actual salary data. The final visualization employs a higher-resolution curve to illustrate the improved predictive power of polynomial regression.