demo_ml_traintest3.py:
import numpy import matplotlib.pyplot as plt numpy.random.seed(2) x = numpy.random.normal(3, 1, 100) y = numpy.random.normal(150, 40, 100) / x train_x = x[:80] train_y = y[:80] test_x = x[80:] test_y = y[80:] plt.scatter(test_x, test_y) plt.show()
C:\Users\My Name>python demo_ml_traintest3.py