<jupyter_start><jupyter_text>Problem 1. The Creation of random numbers.<jupyter_code>import numpy as np
mean1 = (-3,0)
cova = [[1,0.8],[0.8,1]]
np.random.seed(0)

random_ndarray = np.random.multivariate_normal(mean1,cova,size=500)

print(random_ndarray.shape)
print(random_ndarray)<jupyter_output><empty_output><jupyter_text>Problem 2. Visualization by scatter plot<jupyter_code>import matplotlib.pyplot as plt
%matplotlib inline

plt.xlabel("x1")
plt.ylabel("x2")
plt.title("scatter")

x, y = np.random.multivariate_normal(mean1, cova, 500).T
plt.scatter(x, y, color='red', alpha=0.5)
plt.show()<jupyter_output><empty_output><jupyter_text>Problem 3. Visualization by histogram<jupyter_code>import matplotlib.pyplot as plt
%matplotlib inline

plt.xlabel("x1")
plt.ylabel("frequency")
plt.title("histogram of x1")

x, y = np.random.multivariate_normal(mean1, cova, 500).T
plt.hist(x, color="red")
plt.xlim(right=4)
plt.show()

import matplotlib.pyplot as plt
%matplotlib inline

plt.xlabel("x2")
plt.ylabel("frequency")
plt.title("histogram of x2")

x, y = np.random.multivariate_normal(mean1, cova, 500).T
plt.hist(y, color="red")
plt.xlim(left=-5)
plt.show()<jupyter_output><empty_output><jupyter_text>Problem 4. Addition of data<jupyter_code>mean4 = (0,-3)
cova = [[1,0.8],[0.8,1]]
np.random.seed(0)
second_random_ndarray = np.random.multivariate_normal(mean4,cova,size=500)

plt.xlabel("x1")
plt.ylabel("x2")
plt.title("scatter")

x, y = np.random.multivariate_normal(mean1, cova, 500).T
x2, y2 = np.random.multivariate_normal(mean4, cova, 500).T
classes = [0,1]

plt.scatter(x, y, color="red", alpha=0.5)
plt.scatter(x2, y2, color="green")
plt.legend(labels=classes)
plt.show()<jupyter_output><empty_output><jupyter_text>Problem 5.Data combination<jupyter_code>random_ndarray = np.random.multivariate_normal(mean1,cova,size=500)
second_random_ndarray = np.random.multivariate_normal(mean4,cova,size=500)

np.random.seed(0)
combined_ndarray=np.concatenate((random_ndarray, second_random_ndarray))

print(combined_ndarray.shape)
print(combined_ndarray)<jupyter_output><empty_output><jupyter_text>Problem 6. Labeling<jupyter_code>zeros_ndarray = np.zeros(500)
ones_ndarray = np.ones(500)

first_ndarray=np.insert(random_ndarray,2,zeros_ndarray,axis=1)
second_ndarray=np.insert(second_random_ndarray,2,ones_ndarray,axis=1)
np.random.seed(0)
labeled_ndarray=np.concatenate((first_ndarray, second_ndarray))

print(labeled_ndarray.shape)
print(labeled_ndarray)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14704732107938992, 'fraction_numerical': 0.03676183026984748, 'mean_word_length': 6.846625766871166, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, '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': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '662057', 'license': 'Apache-2.0', 'n_tokens_mistral': 1129, 'n_tokens_neox': 1048, 'n_words': 141, 'path': 'My_Week2_assignment_2_submission_Creating_dummy_data.ipynb', 'repo_name': 'ibrahimsesay/griddb', 'size': '2557'}