Skip to content

Commit

Permalink
Update regression.md
Browse files Browse the repository at this point in the history
  • Loading branch information
doctor-phil committed Nov 5, 2024
1 parent c115643 commit 85592d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lectures/tools/regression.md
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ This improves predictions and reduces the variance of the predictions.
from sklearn.ensemble import RandomForestRegressor
forest = RandomForestRegressor(n_estimators = 10).fit(Xsim,ysim)
fig=surface_scatter_plot(Xsim,ysim,lambda x: forest.predict([x]),
fig=surface_scatter_plot(Xsim,ysim,lambda x: forest.predict([x])[0],
show_f0=True)
fig
```
Expand Down Expand Up @@ -892,7 +892,7 @@ from sklearn import neural_network
nn = neural_network.MLPRegressor((6,), activation="logistic",
verbose=True, solver="lbfgs",
alpha=0.0).fit(Xsim,ysim)
fig=surface_scatter_plot(Xsim,ysim,lambda x: nn.predict([x]), show_f0=True)
fig=surface_scatter_plot(Xsim,ysim,lambda x: nn.predict([x])[0], show_f0=True)
fig
```

Expand Down

1 comment on commit 85592d2

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.