<jupyter_start><jupyter_text>Imports<jupyter_code>from matplotlib import pyplot as plt
import numpy as np
import time
from IPython.display import clear_output
from sklearn.model_selection import train_test_split

import tensorflow as tf
import seaborn as sns
sns.set()<jupyter_output><empty_output><jupyter_text>Generate Data<jupyter_code>N = 500 # number of points per class
D = 2 # dimensionality
K = 3 # number of classes
seed = 4 #keep seed
X = np.zeros((N*K,D)) # data matrix (each row = single example)
y = np.zeros(N*K, dtype='uint8') # class labels
np.random.seed(seed) #fixing random 
for j in range(K):
    ix = range(N*j,N*(j+1))
    r = np.linspace(0.0,1,N) # radius
    t = np.linspace(j*4,(j+1)*4,N) + np.random.randn(N)*0.2 # theta
    X[ix] = np.c_[r*np.sin(t), r*np.cos(t)]
    y[ix] = j
X[:, 0] += 1
X[:, 1] += 2
# lets visualize the data:
plt.figure(figsize=(10,8))
plt.scatter(X[:, 0], X[:, 1], c=y, s=40, cmap=plt.cm.Spectral, edgecolors="black")
ax = plt.gca()
ax.set_aspect("equal")
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16443594646271512, 'fraction_numerical': 0.02581261950286807, 'mean_word_length': 5.017241379310345, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '360450', 'license': 'MIT', 'n_tokens_mistral': 448, 'n_tokens_neox': 433, 'n_words': 105, 'path': 'Tensorflow/Homeworks/Homework_1.ipynb', 'repo_name': 'GarikAdamyan/ISTC_ML_course', 'size': '1046'}