Highlights
1. Load the dataset into and visualize the relationships between each variable and the compressive strength value.
The dataset can be downloaded from the UCI Machine Learning Repository here into and gain a first understanding of data by calculating the average and the standard deviation of data included in each one of the columns in the dataset. Then, create a plot representing the individual correlation between each variable and the compressive strength of the concrete specimens. To enhance the readability of the output, use a plot with multiple subplots, and add the average and the standard deviation values calculated earlier to the corresponding subplot as a title. Label the axes appropriately and add gridlines and box borders to your plots. Remember to make your code as compact as possible.
Finally, export the plot produced in this first activity as a JPG file and use it in your report to discuss your initial thoughts about the variables that seem to present a stronger correlation with the compressive strength of the concrete, if any.
2. Expand your code to calculate the R? score associated with each variable using a linear regression model. You’|l find that some of the variables included in the dataset present a very weak correlation (i.e., a very low R? score) and, thus, can potentially be considered non-significant and excluded from the analysis. With that in mind, create an input to prompt the user to enter the R? score to be used to split the dataset into potentially significant and non-significant variables. Store the variables found to be potentially significant into a new array and output the number of variables included in that array to the command window and the name of those variables. Note that this output must be able to accommodate all possible results, from no variables included in the sub-dataset to all variables included in the sub- dataset. You can use the example below as a guide.
3. Build a nonlinear regression model to predict the compressive strength of concrete based on its composition and age. Calculate the R? score of the nonlinear model and output it to the command window, together with the number of variables used. Visualize the predicted compressive strengths against the actual compressive strengths for both the linear and nonlinear models using a scatter plot. Label the axes appropriately and add gridlines and box borders to your plot.
4. Discuss in the report the performance of the linear and nonlinear regression models. Which one performs better? And why? Rerun your code for different R? scores (i.e., sub-datasets with different sizes) and discuss the impact of the number of variables on the performance of the model. To support your conclusions, you can plot the R2 score obtained for different numbers of variables (from 1 to 8).
This Data Science has been solved by our PhD Experts at My Uni Paper.
© Copyright 2026 My Uni Papers – Student Hustle Made Hassle Free. All rights reserved.