Deck 7: Data Mining: Cluster Analysis: More on the While Loop; Parrallel Lists
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/31
العب
ملء الشاشة (f)
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) 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
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.
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.
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 31 في هذه المجموعة.
فتح الحزمة
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.
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 31 في هذه المجموعة.
فتح الحزمة
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
For num in [1, 2, 3, 4, 5]:
Print("hello")
A) Definite
B) Indefinite
C) Nested
D) Numeric
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 31 في هذه المجموعة.
فتح الحزمة
k this deck
7
What Python statement is used to create indefinite iteration?
A) for
B) while
C) if
D) range
A) for
B) while
C) if
D) range
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 31 في هذه المجموعة.
فتح الحزمة
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
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 31 في هذه المجموعة.
فتح الحزمة
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
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 31 في هذه المجموعة.
فتح الحزمة
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.
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 31 في هذه المجموعة.
فتح الحزمة
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.
A) −180.
B) −90.
C) 0.
D) +90.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 31 في هذه المجموعة.
فتح الحزمة
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']
>>> 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']
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 31 في هذه المجموعة.
فتح الحزمة
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']
>>> 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']
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 31 في هذه المجموعة.
فتح الحزمة
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
A) bgpic
B) Screen
C) bg
D) screensize
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 31 في هذه المجموعة.
فتح الحزمة
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
A) point
B) draw
C) dot
D) color
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 31 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 31 في هذه المجموعة.
فتح الحزمة
k this deck
17
When using the K-means algorithm, points will always remain in the same cluster even after several iterations.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 31 في هذه المجموعة.
فتح الحزمة
k this deck
18
A for loop is used to create indefinite iteration.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 31 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 31 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 31 في هذه المجموعة.
فتح الحزمة
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
-Allows loop body statements to be executed until a condition becomes false.
A) while loop
B) for loop
C) infinite loop
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 31 في هذه المجموعة.
فتح الحزمة
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
-Allows a group of statements to be repeated, once for each value in a sequence.
A) while loop
B) for loop
C) infinite loop
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 31 في هذه المجموعة.
فتح الحزمة
k this deck
23
Match each definition with its phrase.
-A loop that never stops.
A) while loop
B) for loop
C) infinite loop
-A loop that never stops.
A) while loop
B) for loop
C) infinite loop
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 31 في هذه المجموعة.
فتح الحزمة
k this deck
24
What is data mining? Provide an example of an application in which data mining would be useful.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 31 في هذه المجموعة.
فتح الحزمة
k this deck
25
How is the distance between two points calculated?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 31 في هذه المجموعة.
فتح الحزمة
k this deck
26
What is a centroid and what role does it play in cluster analysis?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 31 في هذه المجموعة.
فتح الحزمة
k this deck
27
What are the basic steps in the K-means algorithm?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 31 في هذه المجموعة.
فتح الحزمة
k this deck
28
How do you retrieve a random data value in Python?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 31 في هذه المجموعة.
فتح الحزمة
k this deck
29
Explain how the while loop works in Python.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 31 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 31 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 31 في هذه المجموعة.
فتح الحزمة
k this deck