Skip to content

Commit 738336c

Browse files
Programmer-RD-AIProgrammer-RD-AI
andcommitted
02
Co-Authored-By: Ranuga <[email protected]>
1 parent f6f25e6 commit 738336c

File tree

3 files changed

+561
-2
lines changed

3 files changed

+561
-2
lines changed

.ipynb_checkpoints/02-checkpoint.ipynb

Lines changed: 253 additions & 1 deletion
Large diffs are not rendered by default.

.virtual_documents/02.ipynb.py

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,56 @@
1+
import sklearn
2+
from sklearn.datasets import make_circles
3+
# Make 100 Samples
4+
n_samples = 10000
5+
X,y = make_circles(n_samples,noise=0.069,random_state=42)
6+
7+
8+
import matplotlib.pyplot as plt
9+
import numpy as np
10+
import torch
11+
12+
13+
X[:5],y[:5]
14+
15+
16+
# Make a DataFrame of circle data
17+
import pandas as pd
18+
19+
20+
circles = pd.DataFrame({"X1":X[:,0],"X2":X[:,1],"y":y})
21+
22+
23+
# Visualizing
24+
plt.scatter(x=X[:,0],y=X[:,1],c=y,cmap=plt.cm.RdYlBu)
25+
26+
27+
X_sample = X[0]
28+
y_sample = y[0]
29+
X_sample,y_sample,X_sample.shape,y_sample.shape
30+
31+
32+
# Turn data into tensors
33+
import torch
34+
torch.__version__
35+
36+
37+
X.dtype
38+
39+
40+
X = torch.from_numpy(X).type(torch.float32)
41+
y = torch.from_numpy(y).type(torch.float32)
42+
43+
44+
X[:2],y[:2]
45+
46+
47+
from sklearn.model_selection import train_test_split
48+
49+
50+
X_train,X_test,y_train,y_test = train_test_split(X,y,test_size=0.25)
51+
52+
53+
54+
55+
156

02.ipynb

Lines changed: 253 additions & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)