Deck 7: Data Mining: Cluster Analysis: More on the While Loop; Parrallel Lists

Full screen (f)
exit full mode
Question
The equation d = X&It;sub>2&It;/sub> - X&It;sub>1&It;/sub> is used to find:

A) Euclidean distance.
B) clustering.
C) a data mine.
D) the Pythagorean theorem.
Use Space or
up arrow
down arrow
to flip the card.
Question
A(n) ____ is defined as the mean of a collection of data points.

A) point collection
B) cluster
C) Euclid
D) centroid
Question
In the K-means algorithm, the number of clusters is represented by:

A) c.
B) k.
C) the absolute value of X&It;sub>2&It;/sub> - X&It;sub>1&It;/sub>.
D) a star.
Question
Case Study 1:
1. def readFile(filename ):
2. with open(filename , "r") as dataFile
3. dataDict = {}
4.
5. key = 0
6. for aLine in dataFile:
7. key = key + 1
8. score = int(aLine)
9.
10. dataDict[key] = [score]
11.
12. return dataDict
-Refer to the session in the accompanying Case Study 1. What happens in Line 10?

A) The score is entered in the dictionary associated with the key.
B) The line is read from the file.
C) The key is computed.
D) The file is opened.
Question
Case Study 1:
1. def readFile(filename ):
2. with open(filename , "r") as dataFile
3. dataDict = {}
4.
5. key = 0
6. for aLine in dataFile:
7. key = key + 1
8. score = int(aLine)
9.
10. dataDict[key] = [score]
11.
12. return dataDict
-Refer to the session in the accompanying Case Study 1. What is the purpose of the program code [score]?

A) It restricts the dictionary score to only hold a list.
B) It allows for multidimensional data points.
C) It uses the absolute value of score.
D) It places the variable score in a cluster.
Question
What best describes the type of iteration that is shown in the code below?
For num in [1, 2, 3, 4, 5]:
Print("hello")

A) Definite
B) Indefinite
C) Nested
D) Numeric
Question
What Python statement is used to create indefinite iteration?

A) for
B) while
C) if
D) range
Question
Case Study 2:
1. total = 0
2. aNum = 1
3. while aNum &It;= 10:
4. total = total + aNum
5. aNum = aNum + 1
6. print(total)
-Refer to the session in the accompanying Case Study 2. Which line represents the initialization of the loop condition?

A) 1
B) 2
C) 3
D) 5
Question
Case Study 2:
1. total = 0
2. aNum = 1
3. while aNum &It;= 10:
4. total = total + aNum
5. aNum = aNum + 1
6. print(total)
-Refer to the session in the accompanying Case Study 2. Which line checks the condition of the loop?

A) 1
B) 2
C) 3
D) 5
Question
What is the problem with the loop shown below? 1. total = 0
2) aNum = 1
3) while aNum &It;= 10:
4) total = total + aNum
5) print(total)

A) There is no initialization statement.
B) The condition is not checked.
C) It is a definite loop.
D) It is an infinite loop.
Question
Latitude values run north-south with zero latitude located at the equator. The north pole of the globe is +90, and the south pole is:

A) −180.
B) −90.
C) 0.
D) +90.
Question
Case Study 3:
>>> aLine = next(csvReader)
>>> aLine
['3.7', '2006/10/18', '05:34:15', '62.326', '-151.224', '85.9', 'CENTRAL ALASKA']
>>> aLine[3]
>>> ???
>>> aLine[6:]
>>> ???
-Refer to the session in the accompanying Case Study 3. What is printed for aLine[3]?

A) '3.7'
B) '62.326'
C) '-151.224'
D) ['CENTRAL ALASKA']
Question
Case Study 3:
>>> aLine = next(csvReader)
>>> aLine
['3.7', '2006/10/18', '05:34:15', '62.326', '-151.224', '85.9', 'CENTRAL ALASKA']
>>> aLine[3]
>>> ???
>>> aLine[6:]
>>> ???
-Refer to the session in the accompanying Case Study 3. What is printed for aLine[6:]?

A) '3.7'
B) '62.326'
C) '-151.224'
D) ['CENTRAL ALASKA']
Question
What method is used to set a background image for a turtle screen?

A) bgpic
B) Screen
C) bg
D) screensize
Question
Once the turtle has been directed to the proper location, what method will plot a point using the current tail color?

A) point
B) draw
C) dot
D) color
Question
One of the most important steps in the cluster analysis algorithm is to classify data points with regard to their similarity to other data points.
Question
When using the K-means algorithm, points will always remain in the same cluster even after several iterations.
Question
A for loop is used to create indefinite iteration.
Question
Longitude values run west-east, with the zero being the prime meridian, an imaginary line that runs north-south through Greenwich, England.
Question
The process of "visualizing" data can be quite useful, especially if one is looking for hard-to-see relationships that may not be readily apparent from long lists of data.
Question
Match each definition with its phrase.
-Allows loop body statements to be executed until a condition becomes false.

A) while loop
B) for loop
C) infinite loop
Question
Match each definition with its phrase.
-Allows a group of statements to be repeated, once for each value in a sequence.

A) while loop
B) for loop
C) infinite loop
Question
Match each definition with its phrase.
-A loop that never stops.

A) while loop
B) for loop
C) infinite loop
Question
What is data mining? Provide an example of an application in which data mining would be useful.
Question
How is the distance between two points calculated?
Question
What is a centroid and what role does it play in cluster analysis?
Question
What are the basic steps in the K-means algorithm?
Question
How do you retrieve a random data value in Python?
Question
Explain how the while loop works in Python.
Question
One of the weaknesses of the K-means cluster analysis algorithm is that the clusters can become empty. Describe how this problem occurs and its effect.
Question
One of the weaknesses of the K-means cluster analysis algorithm is that the clusters can become too large. Describe how this problem occurs and a possible solution.
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/31
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 7: Data Mining: Cluster Analysis: More on the While Loop; Parrallel Lists
1
The equation d = X&It;sub>2&It;/sub> - X&It;sub>1&It;/sub> is used to find:

A) Euclidean distance.
B) clustering.
C) a data mine.
D) the Pythagorean theorem.
A
2
A(n) ____ is defined as the mean of a collection of data points.

A) point collection
B) cluster
C) Euclid
D) centroid
D
3
In the K-means algorithm, the number of clusters is represented by:

A) c.
B) k.
C) the absolute value of X&It;sub>2&It;/sub> - X&It;sub>1&It;/sub>.
D) a star.
B
4
Case Study 1:
1. def readFile(filename ):
2. with open(filename , "r") as dataFile
3. dataDict = {}
4.
5. key = 0
6. for aLine in dataFile:
7. key = key + 1
8. score = int(aLine)
9.
10. dataDict[key] = [score]
11.
12. return dataDict
-Refer to the session in the accompanying Case Study 1. What happens in Line 10?

A) The score is entered in the dictionary associated with the key.
B) The line is read from the file.
C) The key is computed.
D) The file is opened.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
5
Case Study 1:
1. def readFile(filename ):
2. with open(filename , "r") as dataFile
3. dataDict = {}
4.
5. key = 0
6. for aLine in dataFile:
7. key = key + 1
8. score = int(aLine)
9.
10. dataDict[key] = [score]
11.
12. return dataDict
-Refer to the session in the accompanying Case Study 1. What is the purpose of the program code [score]?

A) It restricts the dictionary score to only hold a list.
B) It allows for multidimensional data points.
C) It uses the absolute value of score.
D) It places the variable score in a cluster.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
6
What best describes the type of iteration that is shown in the code below?
For num in [1, 2, 3, 4, 5]:
Print("hello")

A) Definite
B) Indefinite
C) Nested
D) Numeric
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
7
What Python statement is used to create indefinite iteration?

A) for
B) while
C) if
D) range
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
8
Case Study 2:
1. total = 0
2. aNum = 1
3. while aNum &It;= 10:
4. total = total + aNum
5. aNum = aNum + 1
6. print(total)
-Refer to the session in the accompanying Case Study 2. Which line represents the initialization of the loop condition?

A) 1
B) 2
C) 3
D) 5
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
9
Case Study 2:
1. total = 0
2. aNum = 1
3. while aNum &It;= 10:
4. total = total + aNum
5. aNum = aNum + 1
6. print(total)
-Refer to the session in the accompanying Case Study 2. Which line checks the condition of the loop?

A) 1
B) 2
C) 3
D) 5
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
10
What is the problem with the loop shown below? 1. total = 0
2) aNum = 1
3) while aNum &It;= 10:
4) total = total + aNum
5) print(total)

A) There is no initialization statement.
B) The condition is not checked.
C) It is a definite loop.
D) It is an infinite loop.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
11
Latitude values run north-south with zero latitude located at the equator. The north pole of the globe is +90, and the south pole is:

A) −180.
B) −90.
C) 0.
D) +90.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
12
Case Study 3:
>>> aLine = next(csvReader)
>>> aLine
['3.7', '2006/10/18', '05:34:15', '62.326', '-151.224', '85.9', 'CENTRAL ALASKA']
>>> aLine[3]
>>> ???
>>> aLine[6:]
>>> ???
-Refer to the session in the accompanying Case Study 3. What is printed for aLine[3]?

A) '3.7'
B) '62.326'
C) '-151.224'
D) ['CENTRAL ALASKA']
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
13
Case Study 3:
>>> aLine = next(csvReader)
>>> aLine
['3.7', '2006/10/18', '05:34:15', '62.326', '-151.224', '85.9', 'CENTRAL ALASKA']
>>> aLine[3]
>>> ???
>>> aLine[6:]
>>> ???
-Refer to the session in the accompanying Case Study 3. What is printed for aLine[6:]?

A) '3.7'
B) '62.326'
C) '-151.224'
D) ['CENTRAL ALASKA']
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
14
What method is used to set a background image for a turtle screen?

A) bgpic
B) Screen
C) bg
D) screensize
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
15
Once the turtle has been directed to the proper location, what method will plot a point using the current tail color?

A) point
B) draw
C) dot
D) color
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
16
One of the most important steps in the cluster analysis algorithm is to classify data points with regard to their similarity to other data points.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
17
When using the K-means algorithm, points will always remain in the same cluster even after several iterations.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
18
A for loop is used to create indefinite iteration.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
19
Longitude values run west-east, with the zero being the prime meridian, an imaginary line that runs north-south through Greenwich, England.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
20
The process of "visualizing" data can be quite useful, especially if one is looking for hard-to-see relationships that may not be readily apparent from long lists of data.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
21
Match each definition with its phrase.
-Allows loop body statements to be executed until a condition becomes false.

A) while loop
B) for loop
C) infinite loop
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
22
Match each definition with its phrase.
-Allows a group of statements to be repeated, once for each value in a sequence.

A) while loop
B) for loop
C) infinite loop
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
23
Match each definition with its phrase.
-A loop that never stops.

A) while loop
B) for loop
C) infinite loop
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
24
What is data mining? Provide an example of an application in which data mining would be useful.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
25
How is the distance between two points calculated?
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
26
What is a centroid and what role does it play in cluster analysis?
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
27
What are the basic steps in the K-means algorithm?
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
28
How do you retrieve a random data value in Python?
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
29
Explain how the while loop works in Python.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
30
One of the weaknesses of the K-means cluster analysis algorithm is that the clusters can become empty. Describe how this problem occurs and its effect.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
31
One of the weaknesses of the K-means cluster analysis algorithm is that the clusters can become too large. Describe how this problem occurs and a possible solution.
Unlock Deck
Unlock for access to all 31 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 31 flashcards in this deck.