Author(s): kozyr@google.com
Reviewer(s): nrh@google.com
It's a beautiful day and we can do all kinds of pretty things. Here are some little examples to get you started.
In [0]:
print('Hello world!')
In [0]:
import numpy as np
n = 20
intercept = -10
slope = 5
noise = 10
error = np.random.normal(0, noise, 20)
x = np.array(range(n))
y = intercept + slope * x + error
print(x)
print(np.round(y, 2))
In [0]:
import pandas as pd
df = pd.DataFrame({'feature': x, 'label': y})
print(df)
In [0]:
import seaborn as sns
%matplotlib inline
sns.regplot(x='feature', y='label', data=df)
In [0]:
%matplotlib inline
sns.distplot(error, axlabel='residuals')
In [0]:
%matplotlib inline
sns.jointplot(x='feature', y='label', data=df)
In [0]:
import tensorflow as tf
c = tf.constant('Hello, world!')
with tf.Session() as sess:
print sess.run(c)
Finally, let's greet our tensorflow supported devices! Say hello to our CPU, and our GPU if we invited it to the party!
In [0]:
from tensorflow.python.client import device_lib
def get_devices():
devices = device_lib.list_local_devices()
return [x.name for x in devices]
print(get_devices())