Week 3 - BALT 4364 - CH 3
Because I am still unfamiliar with coding, I had to put the code into ChatGPT to understand how it produced a linear regression model. ChatGPT broke it down into six steps that walked me through each part of the code and what its purpose was. The first section of code involved importing libraries, in this case, NumPy and Matplotlib. The next part generates synthetic data that involves creating the values and the randomness of the outputs. Step three is the splitting of data into training and testing sets. This is the part of the code that has X_train, X_test, etc. The section that includes model - LinearRegression() and model.fit creates the model using the training data. Y_pred = model.predict(X_test) uses the model to predict the y values for the testing set. The plt. section brings the model to life with labels, titles, and different colors for the dots.
It was helpful to get the explanation from ChatGPT. Typing out the steps took my understanding of this code a step further, and this might be a learning strategy I implement when it comes to coding. Turning data into models that are easy to read and understand is a sought-after skill in the job market. Being able to put that on a resume would surely draw interest from recruiters.
Comments
Post a Comment