Skip to content

Introduction to Deep Learning in Python

Run the hidden code cell below to import the data used in this course.

# Import pandas
import pandas as pd

# Import the course datasets 
wages = pd.read_csv('datasets/hourly_wages.csv')
mnist = pd.read_csv('datasets/mnist.csv')
titanic = pd.read_csv('datasets/titanic_all_numeric.csv')
wages
import plotly.express as px

# Create a scatter plot with age on the x-axis and experience_yrs on the y-axis
fig = px.scatter(wages, x='age', y='experience_yrs')

# Add axis labels and a title
fig.update_layout(
    xaxis_title="Age",
    yaxis_title="Experience (years)",
    title="Scatter Plot of Age vs. Experience (years)"
)

# Show the plot
fig.show()
import numpy as np
import tensorflow as tf 
from tensorflow import keras
from tensorflow.keras.preprocessing import image
from tensorflow.keras.applications.resnet50 import preprocess_input
img = image.load_img('C0AAB61D-16FC-4BA2-B664-C88F2666E94B.jpeg', target_size=(224, 224))
img_array = image.img_to_array(img=img)
img_exp = np.expand_dims(img_array, axis=0)
img_ready = preprocess_input(img_exp)
import matplotlib
import matplotlib.pyplot as plt
plt.matshow(img_array)
plt.show()
from tensorflow.keras.applications.resnet50 import ResNet50, decode_predictions
model = ResNet50(weights='imagenet')
preds = model.predict(img_ready)
print('Predictions:', decode_predictions(preds, top=3)[0])

Take Notes

Add notes about the concepts you've learned and code cells with code you want to keep.