Skip to content

Commit f96b816

Browse files
author
xhlu
committed
ML Docs, Regression: fix import, update titles, colors
1 parent 4397700 commit f96b816

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

doc/python/ml-regression.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ import plotly.express as px
4747
df = px.data.tips()
4848
fig = px.scatter(
4949
df, x='total_bill', y='tip', opacity=0.65,
50-
trendline='ols', trendline_color_override='red'
50+
trendline='ols', trendline_color_override='darkblue'
5151
)
5252
fig.show()
5353
```
@@ -223,6 +223,7 @@ fig.show()
223223
When you are fitting a linear regression, you want to often know what feature matters the most in your regression's output.
224224

225225
```python
226+
import pandas as pd
226227
import plotly.express as px
227228
import plotly.graph_objects as go
228229
from sklearn.linear_model import LinearRegression
@@ -356,14 +357,14 @@ fig = px.scatter(
356357
fig.show()
357358
```
358359

359-
## Visualize regularization across different cross-validation folds
360+
## Visualize regularization across cross-validation folds
360361

361362

362363
In this example, we show how to plot the results of various $\alpha$ penalization values from the results of cross-validation using scikit-learn's `LassoCV`. This is useful to see how much the error of the optimal alpha actually varies across CV folds.
363364

364365
```python
365-
import pandas as pd
366366
import numpy as np
367+
import pandas as pd
367368
import plotly.express as px
368369
import plotly.graph_objects as go
369370
from sklearn.linear_model import LassoCV

0 commit comments

Comments
 (0)