Skip to content

ousmanabakar/python-data-science-machine-learning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

python-data-science-machine-learning

2.Predict Movie Box Office Revenue with Linear Regression

how to use the LinearRegression model from scikit-learn to predict movie box office revenue based on various features such as budget, Worldwide Gross , and Domestic Gross.

In this notebook, I first imports the necessary libraries, including scikit-learn's LinearRegression model, and loads the movie data into a Pandas DataFrame. Next, I perform some data preprocessing, including handling missing values and encoding categorical variables.

After preprocessing the data, I split it into training and test sets using scikit-learn's train_test_split function. then trains a LinearRegression model on the training data and uses it to make predictions on the test data. Then evaluate the model's performance using metrics such as mean absolute error and root mean squared error.

Finally, perform some feature selection and model selection to try to improve the model's performance. The notebook provides a detailed step-by-step guide to using LinearRegression for predictive modeling tasks and is a good resource for learning how to use this model in practice.