Last active
August 21, 2017 00:18
-
-
Save b0noI/ae56e8a4f4fdb863886fbb40f5273eac to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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