<jupyter_start><jupyter_text>BONUSIn this question, we'll look at *clustering*, an unsupervised machine learning technique for unlabeled data.  Part AIn this part, you'll compare two different clustering algorithms on two different datasets.First, you'll use **K-Means** to cluster the data. [The documentation is here.](http://scikit-learn.org/stable/modules/generated/sklearn.cluster.KMeans.htmlsklearn.cluster.KMeans) Some relevant points include: - You'll set the number of clusters as `n_clusters`. - You fit the data using the `fit()` method.Second, you'll use **Spectral Clustering** to cluster the data. [The documentation is here.](http://scikit-learn.org/stable/modules/generated/sklearn.cluster.SpectralClustering.htmlsklearn.cluster.SpectralClustering) The arguments and methods are the same as K-Means.Third, you'll test both methods on **two datasets: `X1` and `X2`**. - Both datasets have 100 data points, and are 2-dimensional. - `X1` has 3 clusters. `X2` has only 2. Fourth, you'll call `predict()` with the same dataset on which you called `fit()` in order to predict what cluster each point belongs to. This will return a vector `y` with the predictions. **Plot the 2D data and color the points using the predicted vector to see how the points are clustered.**<jupyter_code>%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import sklearn.cluster as cluster
import sklearn.datasets as datasets

np.random.seed(342585)
X1, _ = datasets.make_blobs(shuffle = False)   # DATASET 1: there are 3 clusters
X2, _ = datasets.make_circles(shuffle = False) # DATASET 2: there are 2 clusters

### BEGIN SOLUTION

### END SOLUTION<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.0937129300118624, 'fraction_numerical': 0.013641755634638196, 'mean_word_length': 5.134545454545455, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '269695', 'license': 'MIT', 'n_tokens_mistral': 520, 'n_tokens_neox': 478, 'n_words': 199, 'path': 'assignments/A10/A10_BONUS.ipynb', 'repo_name': 'eds-uga/csci1360e-su17', 'size': '1686'}