In this Plotly tutorial, you will learn how to plot nonlinear regression in Python. You have to use the parameter trendline="lowess"
for nonlinear regression.
Python
x
# Import Plotly Module
import plotly.express as px
# Import Dataset
dataset = px.data.gapminder().query("continent=='Oceania'")
# Nonlinear Regression
plot = px.scatter(dataset, x="gdpPercap", y="lifeExp", trendline="lowess")
# Show the Plot
plot.show()
Output:
