<jupyter_start><jupyter_text>here we are creating 500 points and then we are scattering in the plane such that the above area contain 500 points distrubuted with a center deviation of 2. similarly in the bottom region 500 points randomly distributed at a sd of 2.We have transposed the points because by this only we can print all the points in x and y Then we are stacking the two variables and then plotting it.<jupyter_code>n_pts = 500
np.random.seed(0)
Xa = np.array([np.random.normal(13,2, n_pts),
              np.random.normal(12,2, n_pts)]).T
Xb = np.array([np.random.normal(8,2, n_pts),
              np.random.normal(6,2, n_pts)]).T

X = np.vstack((Xa,Xb))
Y = np.matrix(np.append(np.zeros(n_pts), np.ones(n_pts))).T

plt.scatter(X[:n_pts,0],  X[:n_pts,1])
plt.scatter(X[n_pts:, 0], X[n_pts:,1])
model = Sequential()
model.add(Dense(units =1, input_shape=(2,), activation ='sigmoid' ))#by this we are adding the layers in neural network
adam = Adam(lr = 0.1)
model.compile(adam, loss='binary_crossentropy', metrics=['accuracy'])
h = model.fit(x=X,y=Y, verbose=1, batch_size=50, epochs =500, shuffle='true')<jupyter_output>WARNING: Logging before flag parsing goes to stderr.
W0930 22:45:04.824862 13548 deprecation_wrapper.py:119] From c:\users\karti\appdata\local\programs\python\python37\lib\site-packages\keras\backend\tensorflow_backend.py:74: The name tf.get_default_graph is deprecated. Please use tf.compat.v1.get_default_graph instead.

W0930 22:45:05.323556 13548 deprecation_wrapper.py:119] From c:\users\karti\appdata\local\programs\python\python37\lib\site-packages\keras\backend\tensorflow_backend.py:517: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.

W0930 22:45:05.360564 13548 deprecation_wrapper.py:119] From c:\users\karti\appdata\local\programs\python\python37\lib\site-packages\keras\backend\tensorflow_backend.py:4138: The name tf.random_uniform is deprecated. Please use tf.random.uniform instead.

W0930 22:45:05.473496 13548 deprecation_wrapper.py:119] From c:\users\karti\appdata\local\programs\python\python37\lib\site-packages\keras\optimizers.py:790: The [...]<jupyter_text>the sequential class is a linear stack of layers in Dense every network is connected to the preciddingg layer which is the case for the fully connected neural network.<jupyter_code>plt.plot(h.history['acc'])
plt.title('accuracy')
plt.xlabel('epoch')
plt.legend(['accuracy'])
def plot_decision_boundary(X, y, model):
    x_span = np.linspace(min(X[:,0])-1, max(X[:,0]) + 1)
    y_span = np.linespace(min(X[:,1])-1, max(X[:,1] + 1))
    xx, yy = np.meshgrid(x_span, y_span)
    xx_,yy_= xx.ravel(), yy.ravel()
    grid = np.c_[xx_, yy_]
    pred_func = model.predict(grid)
    z = pred_func.reshape(xx.shape)
    plt.contourf(xx, yy, z)
plot_decision_boundary(X,y, model)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13543859649122808, 'fraction_numerical': 0.05789473684210526, 'mean_word_length': 5.197826086956522, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '133689', 'license': 'Info-ZIP', 'n_tokens_mistral': 1146, 'n_tokens_neox': 1024, 'n_words': 246, 'path': 'venv/3Keras/.ipynb_checkpoints/keras-checkpoint.ipynb', 'repo_name': 'kartikeyshaurya/SDV', 'size': '2850'}