Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Barycenter problem #481

Unanswered
cbaldassari asked this question in Q&A
Discussion options

Hey, I am seeking clarification on an example presented on the page https://pythonot.github.io/auto_examples/barycenters/plot_barycenter_1D.html.
I managed to replicate the code in the notebook and obtain the displayed outputs.

However, I encounter an issue when I try to make a slight change.
I am referring to the following part of the notebook:

image

I have attempted to replace the highlighted lines in red with the following:

aa=gmm1.sample(n)[0][:,0]
bb=gmm2.sample(n)[0][:,0]
aa1=np.histogram(aa, bins=n)
aa2=np.histogram(bb, bins=n)
a1=aa1[1]
a2=aa2[1]

image

In this modification, I am using models derived from sklearn Gaussian mixtures (gmm1 and gmm2) instead of 1D Gauss.
However, I receive the following error:

ValueError: operands could not be broadcast together with shapes (2,101) (100,)

I wonder if you could kindly help me resolve this issue, thank you!

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /