Skip to content

Instantly share code, notes, and snippets.

@codeperfectplus
Last active June 28, 2020 03:10
Show Gist options
  • Save codeperfectplus/f4a0e148460f95cf7a0040eafe883aea to your computer and use it in GitHub Desktop.
Save codeperfectplus/f4a0e148460f95cf7a0040eafe883aea to your computer and use it in GitHub Desktop.
## Comparing the Test Set with Predicted Values
df = pd.DataFrame({'Real Values':test_y,"Predict Value":predicted_y})
df.head()
## Step 6: Visualising the Test set results
plt.scatter(test_X, test_y, color = 'red')
plt.scatter(test_X, predicted_y, color = 'green')
plt.plot(train_X, lr.predict(train_X), color = 'black')
plt.title('Salary vs Experience (Result)')
plt.xlabel('YearsExperience')
plt.ylabel('Salary')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment