Madhav commited on
Commit
26954e0
1 Parent(s): a17df79

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -73,10 +73,10 @@ def plot_distributions(alpha, beta, left_count, right_count, num_people):
73
  if(left_count+right_count != 0):
74
  if(total_count<=num_people):
75
  ax[1,0].bar(np.arange(left_count,num_people-total_count+left_count+1), samples_posterior_mle)
76
- ax[1, 0].set_xlim(-0.5, num_people + 1.5)
77
  else:
78
  ax[1,0].bar(np.arange(0,num_people+1), samples_posterior_mle)
79
- ax[1,0].set_xlim(-0.5,num_people+1.5)
80
 
81
  ax[1,0].set_xlabel('Number of Left Handed Student')
82
  ax[1,0].set_title('Predictive Distribution given MLE')
@@ -84,10 +84,10 @@ def plot_distributions(alpha, beta, left_count, right_count, num_people):
84
  ## Change here
85
  if(total_count<=num_people):
86
  ax[1,1].bar(np.arange(left_count,num_people-total_count+left_count+1), samples_prior_pred)
87
- ax[1,1].set_xlim(-0.5,num_people+1.5)
88
  else:
89
  ax[1,1].bar(np.arange(0,num_people+1), samples_prior_pred)
90
- ax[1,1].set_xlim(-0.5,num_people+1.5)
91
 
92
  ax[1,1].set_xlabel('Number of Left Handed Student')
93
  ax[1,1].set_title('Prior Predictive Distribution')
@@ -95,10 +95,10 @@ def plot_distributions(alpha, beta, left_count, right_count, num_people):
95
  ## Change here
96
  if(total_count<=num_people):
97
  ax[1,2].bar(np.arange(left_count,num_people-total_count+left_count+1), samples_posterior_pred)
98
- ax[1,2].set_xlim(-0.5,num_people+1.5)
99
  else:
100
  ax[1,2].bar(np.arange(0,num_people+1), samples_posterior_pred)
101
- ax[1,2].set_xlim(-0.5,num_people+1.5)
102
 
103
  ax[1,2].set_xlabel('Number of Left Handed Student')
104
  ax[1,2].set_title('Posterior Predictive Distribution')
 
73
  if(left_count+right_count != 0):
74
  if(total_count<=num_people):
75
  ax[1,0].bar(np.arange(left_count,num_people-total_count+left_count+1), samples_posterior_mle)
76
+ ax[1, 0].set_xlim(-0.5, num_people+0.5)
77
  else:
78
  ax[1,0].bar(np.arange(0,num_people+1), samples_posterior_mle)
79
+ ax[1,0].set_xlim(-0.5,num_people+0.5)
80
 
81
  ax[1,0].set_xlabel('Number of Left Handed Student')
82
  ax[1,0].set_title('Predictive Distribution given MLE')
 
84
  ## Change here
85
  if(total_count<=num_people):
86
  ax[1,1].bar(np.arange(left_count,num_people-total_count+left_count+1), samples_prior_pred)
87
+ ax[1,1].set_xlim(-0.5,num_people+0.5)
88
  else:
89
  ax[1,1].bar(np.arange(0,num_people+1), samples_prior_pred)
90
+ ax[1,1].set_xlim(-0.5,num_people+0.5)
91
 
92
  ax[1,1].set_xlabel('Number of Left Handed Student')
93
  ax[1,1].set_title('Prior Predictive Distribution')
 
95
  ## Change here
96
  if(total_count<=num_people):
97
  ax[1,2].bar(np.arange(left_count,num_people-total_count+left_count+1), samples_posterior_pred)
98
+ ax[1,2].set_xlim(-0.5,num_people+0.5)
99
  else:
100
  ax[1,2].bar(np.arange(0,num_people+1), samples_posterior_pred)
101
+ ax[1,2].set_xlim(-0.5,num_people+0.5)
102
 
103
  ax[1,2].set_xlabel('Number of Left Handed Student')
104
  ax[1,2].set_title('Posterior Predictive Distribution')