Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fixes for my files #25

Merged
merged 10 commits into from
May 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Taweret/mix/gaussian.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,9 @@ def predict(self, ci=68):
var = 1/denom

# variances for each model
self.var_weights = v/np.sum(v, axis=0)
v = np.asarray(v)
weights = 1.0/v
self.var_weights = weights/np.sum(weights, axis=0)

# std_dev calculation
std_dev = np.sqrt(var)
Expand Down
4 changes: 2 additions & 2 deletions test/test_gaussian.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ def test_evaluate_weights():
samba_arrays = np.loadtxt('samba_results.txt', delimiter=',')

# separate out weights
weights_low = samba_arrays[9]
weights_high = samba_arrays[8]
weights_low = samba_arrays[8]
weights_high = samba_arrays[9]

# test weights
assert np.allclose(weights_low, mixed.var_weights[0,:]), \
Expand Down