This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import argparse | |
| import time | |
| import random | |
| import math | |
| parser = argparse.ArgumentParser(description="Approximate digits of Pi using Monte Carlo simulation.") | |
| parser.add_argument("--num-samples", type=int, default=1000000) | |
| parser.add_argument("--parallel", default=False, action="store_true") | |
| parser.add_argument("--distributed", default=False, action="store_true") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| from sklearn import datasets, mixture | |
| # Create some random clustered data in 2 dimensions | |
| n_clusters = 3 | |
| n_features = 2 | |
| n_samples = 500 | |
| data = datasets.make_blobs(n_samples=n_samples, |
OlderNewer