Importing the libraries necessary for the implementation of the code operation is the first stage. To import and analyse data, conduct multi-dimensional operations, and make graphical plots into the context, we import the Pandas, NumPy, and matplotlib packages.The data must then be loaded into the programme for the desired operation to be carried out. We import the Excel data using pandas, and once it has loaded correctly, we output a statement to verify.We will use the head() function to display the data after that. The top five are the default views for the head function, but again, you may add any number of views you'd like. In this case, I've entered ten views.
The following step is to enter distribution scores and plot them in accordance with the specification; in this case, we'll enter the title, x_label, and y_label and display it in accordance with the intended outcome.Our next step is to separate the data into attributes and labels.Since we will be using the built-in train_test_split() method of Scikit Learn, it is crucial that the data be split into training and test sets.The algorithm must be trained after that.Implementing the test data graphing using the already trained test data is the next step.The next crucial step to understanding our model is forecasting its scores.Understanding our model fitting requires comparing the real and anticipated models.
It's time to put our model to the test with some example testing hours, so in this case, we'll use seven. If a student studies for seven hours, how many marks can he expect to earn based on the information we obtained and the model we used?Now that we have successfully implemented the model and obtained the output, it is crucial to remember that this model only works with the dataset we gave. If the data is updated, the results may change, necessitating another round of model optimisation.
We utilised a linear regression model to estimate a student's score assuming daily study time of 9.25 hours, and the result was 92.91.
![Screenshot 2023-09-14 210445](https://private-user-images.githubusercontent.com/124078581/268031570-88e67ee3-f0ea-4a85-8a71-d22adb86f817.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQxMjAwNzcsIm5iZiI6MTcyNDExOTc3NywicGF0aCI6Ii8xMjQwNzg1ODEvMjY4MDMxNTcwLTg4ZTY3ZWUzLWYwZWEtNGE4NS04YTcxLWQyMmFkYjg2ZjgxNy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODIwJTJGdXMtZWFzdC0xJTJG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9MCJ9.2MMgnCRkx31omqdG7-zY1FVCgcfEG0C3-_LUZIEHHcY)
![Screenshot 2023-09-14 210525](https://private-user-images.githubusercontent.com/124078581/268031795-933080cb-e363-429f-85ac-d2288c82e05e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQxMjAwNzcsIm5iZiI6MTcyNDExOTc3NywicGF0aCI6Ii8xMjQwNzg1ODEvMjY4MDMxNzk1LTkzMzA4MGNiLWUzNjMtNDI5Zi04NWFjLWQyMjg4YzgyZTA1ZS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODIwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgyMFQwMjA5MzdaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0zYjYzOTFmY2Q5NzAzM2Q1NThlOWM5MmZiOWEyOTQwMTFlZmE4YTc4ODU4ZjUwNjhkMTE3NTM1Y2UwODE5NjdiJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.ukJjFar1-N9l-3al-rymdLq8QzhRAOd4wn0XNPUL-mE)
![Screenshot 2023-09-14 210545](https://private-user-images.githubusercontent.com/124078581/268031903-6b6b7df5-261e-4943-b4e2-923c99d2b35d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQxMjAwNz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