This code performs Multiple Linear Regression on a dataset of startup information to predict profits. It first loads the dataset, which includes features like R&D spending, state, advertising spending, and administration spending. It preprocesses the data by dropping the categorical 'State' column and creating dummy variables to represent states numerically.The dataset is split into a training set and a test set. A Multiple Linear Regression model is created and trained on the training data. The model is then used to make profit predictions on the test data, storing the results in 'y_pred'. The crucial evaluation step calculates the R-squared (R2) score, which measures how well the model fits the test data. This score ranges from 0 to 1, with higher values indicating a better fit. The R2 score helps assess the model's performance in predicting profits based on the given features. Proper handling of categorical data through dummy variables ensures that state information is appropriately incorporated into the regression analysis, enabling more accurate profit predictions.
-
Notifications
You must be signed in to change notification settings - Fork 0
Rkarande1/Multilinear-regression
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published