Machine Learning foundations a case study Approach Sframe (Week 1) Quiz Answers

Question – 1. Download the Wiki People SFrame. Then open a new Jupyter notebook, import TuriCreate, and read the SFrame data. (Your answer cannot be more than 10000 characters.)

Answer-

A tabular, column-mutable dataframe object that can scale to big data. The data in SFrame is stored column-wise on the GraphLab Server side, and is stored on persistent storage (e.g. disk) to avoid being constrained by memory size. Each column in an SFrame is a size-immutable SArray, but SFrames are mutable in that columns can be added and subtracted with ease. An SFrame essentially acts as an ordered dict of SArrays.

Currently, we support constructing an SFrame from the following data formats:

csv file (comma separated value)

sframe directory archive (A directory where an sframe was saved previously)

general text file (with csv parsing options, See read_csv())

a Python dictionary

pandas.DataFrame

JSON

Apache Avro

PySpark RDD

and from the following sources:

your local file system

the GraphLab Server’s file system

HDFS

Amazon S3

HTTP(S).

Only basic examples of construction are covered here. For more information and examples, please see the User Guide, API Translator, How-Tos, and data science Gallery.

Parameters:

data : array | pandas.DataFrame | string | dict, optional

The actual interpretation of this field is dependent on the format parameter. If data is an array or Pandas DataFrame, the contents are stored in the SFrame. If data is a string, it is interpreted as a file. Files can be read from local file system or urls (local://, hdfs://, s3://, http://).

format : string, optional

Format of the data. The default, “auto” will automatically infer the input data format. The inference rules are simple: If the data is an array or a dataframe, it is associated with ‘array’ and ‘dataframe’ respectively. If the data is a string, it is interpreted as a file, and the file extension is used to infer the file format. The explicit options are:

“auto”

“array”

“dict”

“sarray”

“dataframe”

“csv”

“tsv”

“sframe

Question 2.- H​ow many rows are in the SFrame? (Do NOT use commas or periods.)

Answer:- 2000000

Question 3:- Which name is in the last row?

Answer:- F​awaz Damrah

C​onradign Netzer

C​thy Caruth

Question 4.- Read the text column for Harpdog Brown. He was honored with:

A​ Grammy award for his latest blues album.

Answer:- A lifetime membership in the Hamilton Blues Society.

A gold harmonica to recognize his innovative playing style.

Question 5.- Sort the SFrame according to the text column, in ascending order. What is the name entry in the first row?

Answer:- 108 (artist) 

D​igby Morrell

0​07 James Bond

Z​ygfryd Szo

8​ Ball Aitken

Leave a Reply

Your email address will not be published. Required fields are marked *