Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- X_data, y_data = get_dataset(nsp.get_training_examples)
- # Transform a two-dimensional vector x into a three-dimensional vector.
- def transform(x):
- return [x[0]**2, np.sqrt(2)*x[0]*x[1], x[1]**2]
- fig = plt.figure(figsize=(10,6))
- r=np.zeros((16,3))
- for i,j in enumerate( X_data):
- r[i]=transform(j)
- ax = plt.subplot(projection='3d')
- ax.scatter3D(r[:, 0], r[:, 1], r[:,2], c=y_data, s=50, cmap='autumn')
- ax.set_xlabel('x')
- ax.set_ylabel('y')
- ax.set_zlabel('z')
- ax.view_init(12.5, 120)
Add Comment
Please, Sign In to add comment