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

Generating synthetic data #70

Open
tlienart opened this issue May 31, 2020 · 0 comments
Open

Generating synthetic data #70

tlienart opened this issue May 31, 2020 · 0 comments

Comments

@tlienart
Copy link
Collaborator


# --------------------------------------------------------------------------
# The script below will eventually go in the tutorials, it generates points
# using standard keywords and plots them. It was also used to eyball the
# results and make sure they made sense
# --------------------------------------------------------------------------

# using PyPlot
#
# # BLOBS
#
# figure(figsize=(8, 6))
# X, y = make_blobs(100, 2, centers=3, as_table=false)
#
# plot(X[y.==1, 1], X[y.==1, 2], ls="none", marker="o")
# plot(X[y.==2, 1], X[y.==2, 2], ls="none", marker="o")
# plot(X[y.==3, 1], X[y.==3, 2], ls="none", marker="o")
#
# gcf()
#
# # CIRCLES
#
# figure(figsize=(8, 6))
# X, y = make_circles(200, as_table=false, factor=0.3)
#
# plot(X[y.==0, 1], X[y.==0, 2], ls="none", marker="o")
# plot(X[y.==1, 1], X[y.==1, 2], ls="none", marker="o")
#
# gcf()
#
# # MOONS
#
# figure(figsize=(8, 6))
# X, y = make_moons(200, as_table=false)
#
# plot(X[y.==0, 1], X[y.==0, 2], ls="none", marker="o")
# plot(X[y.==1, 1], X[y.==1, 2], ls="none", marker="o")
#
# gcf()
#
# # REGRESSION 1
#
# figure(figsize=(8, 6))
# X, y = make_regression(200, 1, as_table=false, noise=0.5, rng=550)
#
# plot(X[:, 1], y, ls="none", marker="o")
#
# gcf()
#
# # REGRESSION WITH OUTLIERS
#
# figure(figsize=(8, 6))
# X, y = make_regression(200, 1, as_table=false, noise=0.5, rng=550, outliers=0.1)
#
# plot(X[:, 1], y, ls="none", marker="o")
#
# gcf()

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

No branches or pull requests

2 participants