This is my first attempt at the problem.
In this exercise, we will define the regression and classification outcomes. Specifically, we will use the revenue column as the target for regression. For classification, we will construct an indicator of profitability for each movie.
Create a new column in df called profitable, defined as 1 if the movie revenue is greater than the movie budget, and 0 otherwise. I get good results by the say profitable is not defined right.
Also...
**I really don't understand what they want here:
Next, define and store the outcomes we will use for regression and classification.
Define regression_target as 'revenue'.
Define classification_target as 'profitable'.
profitable = []
for i in range(len(df)):
if df.iloc[i]['revenue'] > df.iloc[i]['budget']:
profitable.append(1)
else:
profitable.append(0)
df["'profitable'"] = profitable
regression_target = df['revenue']
classifcation_target = df['profitable']
df.head()
Error: