5. Classification Models
Activity 5.01: Building a Character Recognition Model with TensorFlow
Solution:
- Open a new Jupyter notebook.
- Import the pandas library and use
pd
as the alias:import pandas as pd
- Create a variable called
file_url
that contains the URL to the dataset:file_url = 'https://raw.githubusercontent.com/PacktWorkshops'\ Â Â Â Â Â Â Â Â Â Â '/The-TensorFlow-Workshop/master/Chapter05'\ Â Â Â Â Â Â Â Â Â Â '/dataset/letter-recognition.data'
- Load the dataset into a
DataFrame()
function calleddata
usingread_csv()
method, provide the URL to the CSV file, and setheader=None
as the dataset doesn't provide column names. Print the first five rows usinghead()
method.data = pd.read_csv(file_url, header=None) data.head()
The expected output will be as follows:
You can see that the dataset contains
17
columns...