-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirst.py
More file actions
64 lines (59 loc) · 2.11 KB
/
first.py
File metadata and controls
64 lines (59 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import pandas as pd
import matplotlib.pyplot as plt
# PEAS data
data = {
"S.No": [1, 2, 3, 4, 5, 6],
"AI Application": [
"Self-driving Car",
"Email Spam Filter",
"Chess Playing Program",
"Google Search Engine",
"Voice Assistant (e.g., Alexa)",
"Robot Vacuum Cleaner"
],
"Performance Measure": [
"Safety, speed, obeying traffic rules, passenger comfort",
"Accuracy of spam detection, low false positives/negatives",
"Win/loss ratio, minimization of blunders",
"Relevance of results, click-through rate, response time",
"Accuracy of response, user satisfaction",
"Cleanliness, area covered, battery efficiency"
],
"Environment": [
"Roads, traffic, pedestrians, weather",
"Email inbox, incoming messages",
"Chessboard, opponent moves",
"Web content, user queries",
"Indoor environment, user conversations",
"Household rooms, furniture, floor types"
],
"Actuators": [
"Steering, accelerator, brakes, indicators",
"Classifier (marks spam or not)",
"Move generator (digital moves)",
"Display of search results",
"Speaker (voice), smart device control",
"Wheels, suction motor, cleaning brushes"
],
"Sensors": [
"Cameras, GPS, lidar, radar, speedometer",
"Email content, metadata, sender info",
"Game state, opponent move input",
"User query, browsing behavior",
"Microphone, voice recognition",
"Proximity sensors, bump sensors, dirt sensors"
]
}
# Convert to DataFrame
df = pd.DataFrame(data)
# Plotting as a table using matplotlib
fig, ax = plt.subplots(figsize=(18, 6)) # width x height in inches
ax.axis('off')
table = ax.table(cellText=df.values, colLabels=df.columns, cellLoc='left', loc='center')
# Style the table
table.auto_set_font_size(False)
table.set_fontsize(10)
table.scale(1.2, 1.8) # x, y scaling
# Save the image
plt.savefig("peas_table_image.png", bbox_inches='tight', dpi=300)
plt.show()