Predicting a Startups Profit/Success Rate using Multiple Linear Regression in Python, ASSIGNMENT - 8, GO_STP_8113
Here 50 startups dataset containing 5 columns like “R&D Spend”, “Administration”, “Marketing Spend”, “State”, “Profit”. In this dataset first 3 columns provides you spending on Research , Administration and Marketing respectively. State indicates startup based on that state. Profit indicates how much profits earned by a startup. Clearly, we can understand that it is a multiple linear regression problem, as the independent variables are more than one. Prepare a prediction model for profit of 50_Startups data in Python import numpy as np import matplotlib.pyplot as plt import pandas as pd dataset = pd.read_csv( '50_Startups.csv' ) X = dataset.iloc[:, : -1 ] y = dataset.iloc[:, 4 ] states=pd.get_dummies(X[ 'State' ],drop_first= True ) X=X.drop( 'State' ,axis= 1 ) X=pd.concat([X,states],axis= 1 ) from sklearn.model_selection import train_test_split X_train,...