Skip to content

Instantly share code, notes, and snippets.

@b0noI
Last active August 21, 2017 00:18
Show Gist options
  • Save b0noI/ae56e8a4f4fdb863886fbb40f5273eac to your computer and use it in GitHub Desktop.
Save b0noI/ae56e8a4f4fdb863886fbb40f5273eac to your computer and use it in GitHub Desktop.
import matplotlib.pyplot as plt
import mxnet as mx
import logging
import numpy as np
from sklearn.model_selection import train_test_split
logging.getLogger().setLevel(logging.DEBUG)
# lineral equation
def f(x):
# a = 5
# b = 2
return 5 * x + 2
# Data
X = np.arange(100, step=0.001)
Y = f(X)
# Split data for taining and evaluation
X_train, X_test, Y_train, Y_test = train_test_split(X, Y)
# Show data
%pylab inline
figure = plt.figure()
plt.plot(X_train, Y_train, 'r')
plt.xlabel('x')
plt.ylabel('y')
plt.title('simple line')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment