Skip to content

Commit 35e1ba6

Browse files
committed
Update model_plots.py
1 parent cd54452 commit 35e1ba6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

shiny/api-examples/layout_columns/model_plots.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
def plot_loss_over_time():
1010
epochs = np.arange(1, 101)
11-
loss = 1000 / np.sqrt(epochs) + rng.rand(100) * 25
11+
loss = 1000 / np.sqrt(epochs) + rng.uniform(size=100) * 25
1212

1313
fig = plt.figure(figsize=(10, 6))
1414
plt.plot(epochs, loss)
@@ -19,7 +19,7 @@ def plot_loss_over_time():
1919

2020
def plot_accuracy_over_time():
2121
epochs = np.arange(1, 101)
22-
accuracy = np.sqrt(epochs) / 12 + rng.rand(100) * 0.15
22+
accuracy = np.sqrt(epochs) / 12 + rng.uniform(size=100) * 0.15
2323
accuracy = [np.min([np.max(accuracy[:i]), 1]) for i in range(1, 101)]
2424

2525
fig = plt.figure(figsize=(10, 6))
@@ -31,7 +31,7 @@ def plot_accuracy_over_time():
3131

3232
def plot_feature_importance():
3333
features = ["Product Category", "Price", "Brand", "Rating", "Number of Reviews"]
34-
importance = rng.rand(5)
34+
importance = rng.uniform(size=100)
3535

3636
fig = plt.figure(figsize=(10, 6))
3737
plt.barh(features, importance)

0 commit comments

Comments
 (0)