db-d2 commited on
Commit
35098fc
·
1 Parent(s): 8961a34

Fix: playing with font sizing

Browse files
Files changed (1) hide show
  1. app.py +2 -7
app.py CHANGED
@@ -22,9 +22,6 @@ B_true = np.array([
22
  FOODS = ['Asparagus', 'Milk', 'Apples', 'Steak']
23
  COLORS = ['#00CC00', '#0066FF', '#FF0000', '#FF9900']
24
 
25
- # ============================================================================
26
- # DATA & MODEL
27
- # ============================================================================
28
  def softmax(z):
29
  z = np.atleast_2d(z)
30
  z = z - np.max(z, axis=1, keepdims=True)
@@ -66,9 +63,7 @@ def train_model(X, y):
66
  X_train, y_train = generate_logs(100)
67
  B_learned = train_model(X_train, y_train)
68
 
69
- # ============================================================================
70
- # SIMPLEX VISUALIZATION
71
- # ============================================================================
72
  def make_simplex(luke, rey):
73
  """Show predicted probabilities on tetrahedron for given encounters."""
74
  # Predict using learned model
@@ -108,7 +103,7 @@ def make_simplex(luke, rey):
108
  label = f"{food}\n({probs[i]:.1%})"
109
  fig.add_trace(go.Scatter3d(
110
  x=[v[i,0]*1.3], y=[v[i,1]*1.3], z=[v[i,2]*1.3],
111
- mode='text', text=[label], textfont=dict(size=14, color=color),
112
  showlegend=False, hoverinfo='skip'
113
  ))
114
 
 
22
  FOODS = ['Asparagus', 'Milk', 'Apples', 'Steak']
23
  COLORS = ['#00CC00', '#0066FF', '#FF0000', '#FF9900']
24
 
 
 
 
25
  def softmax(z):
26
  z = np.atleast_2d(z)
27
  z = z - np.max(z, axis=1, keepdims=True)
 
63
  X_train, y_train = generate_logs(100)
64
  B_learned = train_model(X_train, y_train)
65
 
66
+
 
 
67
  def make_simplex(luke, rey):
68
  """Show predicted probabilities on tetrahedron for given encounters."""
69
  # Predict using learned model
 
103
  label = f"{food}\n({probs[i]:.1%})"
104
  fig.add_trace(go.Scatter3d(
105
  x=[v[i,0]*1.3], y=[v[i,1]*1.3], z=[v[i,2]*1.3],
106
+ mode='text', text=[label], textfont=dict(size=24, color=color),
107
  showlegend=False, hoverinfo='skip'
108
  ))
109