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

Double scalars error #1

Open
levantail opened this issue Jan 7, 2019 · 0 comments
Open

Double scalars error #1

levantail opened this issue Jan 7, 2019 · 0 comments

Comments

@levantail
Copy link

levantail commented Jan 7, 2019

Hello,
i've tried to run your snippet but have a problem with double_scalars, it appears in next cell in jupyter notebook:

error_rates = {x:None for x in range(5,25)+[100]}
for k in range(5,25):
    trained_clusters, trained_centroids = cluster(training, k)
    labelled_centroids = assign_labels_to_centroids(trained_clusters, trained_centroids)
    error_rate = get_error_rate(validation, labelled_centroids)
    error_rates[k] = error_rate

# Show the error rates
x_axis = sorted(error_rates.keys())
y_axis = [error_rates[key] for key in x_axis]
plt.figure()
plt.title("Error Rate by Number of Clusters")
plt.scatter(x_axis, y_axis)
plt.xlabel("Number of Clusters")
plt.ylabel("Error Rate")
plt.show()

and error code is:

ipykernel_launcher.py:52: RuntimeWarning: invalid value encountered in double_scalars

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant