library(tidyverse)
places <- read_csv(
"https://bcdanl.github.io/data/google_place_upstate_ny.csv"
)Classwork 18
How AI Learns
Complete the questions and submit your responses on the corresponding Brightspace page. Brief explanations are enough; you do not need to build or train an AI model.
You may use the DANL 101 Data Storytelling Agent throughout this classwork to explain concepts, suggest ideas, and help with R. Explain your final answers in your own words and check claims against the supplied information or your R output.
- Open the Data Storytelling Agent and sign in with your Geneseo Microsoft 365 account.
- If you use AI, include your full prompts and the responses you used, and briefly describe what you checked or changed. Do not include personal information such as names or grades in prompts.
- If you cannot access the agent, use the prepared responses in Question 3. They provide everything you need to complete Questions 3–4. State which option you used.
This classwork accompanies AI and Data Analytics and its reading.
1. Fixed rules or learning from data?
A fixed rule specifies the steps to follow. Machine learning finds patterns in examples and uses those patterns for a task.
Fixed-rule example. You choose a rating cutoff of 4.0 in advance. A program labels a business with a recorded rating of at least 4.0 as “4 stars or above” and any lower recorded rating as “Below 4 stars.” A rating of 4.3 receives the first label, while 3.7 receives the second. The program applies the same preset comparison each time.
For each process below, choose fixed rules or learning from data and give a one-sentence reason. Classify the process described, rather than whether AI could also attempt the task.
| Process | Your answer and reason |
|---|---|
| Calculate each region’s average Google rating by adding its ratings and dividing by the number of non-missing ratings. | |
| Learn patterns from reviews people have labeled genuine or fake, then flag new reviews that resemble the fake examples. | |
| Sort reviews from the earliest to the latest date using their recorded publication dates. | |
| Learn from past chess games with known winners to estimate who will win a new game. |
2. Learning with and without known answers
Supervised learning uses examples with known answers, such as ratings or category labels. Unsupervised learning looks for patterns or groups without those answers.
For each task, choose supervised or unsupervised. Identify the known answer, or explain that no answer label is supplied.
- Estimate a business’s Google rating from its category, region, and price level, using examples of businesses whose ratings are already known.
- Group businesses by location, using only their latitude and longitude, with no preassigned group labels.
- Classify a new review as positive or negative, using examples people have already labeled positive or negative.
A model performs very well on the examples used to train it. Why should we also test it on examples it has never seen? Answer in one or two sentences. You do not need to train a model.
3. Test the agent on three tasks
The jagged frontier means AI can perform well on one task and struggle on another. Test each response rather than assuming a useful answer makes every answer trustworthy.
Choose one option:
- Live agent: Send the three prompts below. Keep each response, then check it.
- Prepared responses: Audit the three instructor-written practice responses below. These are deliberately imperfect examples, not actual agent outputs. Copy each supplied prompt into your notes so your checks have context.
For either option, record your findings in this short table. Use supported, needs correction, or not yet checked for your judgment. A single result describes this test, not everything the agent can do.
| Task | Your judgment | Evidence: what you checked and what needs changing |
|---|---|---|
| Ideas | ||
| Data facts | ||
| R code |
A. Suggest questions the data can answer
Prompt:
For the DANL 101 Upstate New York Local Businesses topic, suggest three focused questions we could answer using
metro,primary_type,rating,user_rating_count, orprice_level. Name the variables needed for each question. Do not invent variables or results.
Check whether each question can be answered with the listed variables. If a question needs unavailable data, rewrite it using variables we have.
- How do restaurant ratings differ across regions? Use
primary_type,rating, andmetro. - Do businesses with more Google ratings tend to have higher ratings? Use
user_rating_countandrating. - Do businesses in higher-income neighborhoods earn more revenue? Use neighborhood income and business revenue.
B. Check facts about the tables
Prompt:
For this course topic, what does one row in
placesrepresent, and what does one row inreviewsrepresent? How many places are recorded? What is the maximum number of featured reviews per place in the reviews file? Is that the same asuser_rating_count? Use the course topic page; say if you cannot verify an answer.
Compare the response with Our shared practice data above. Identify any incorrect claim and write its correction.
The data contain 15,351 places. One row in places represents one place, and one row in reviews represents one featured review. Each place has at most five Google ratings, so user_rating_count cannot exceed five.
C. Run and check a short R calculation
In Posit Cloud or RStudio, run this setup. You need only the places file.
Prompt:
I have loaded the course’s places file into a data frame named
places. Give beginner R code usingcount()to count places in eachmetro. Do not use the reviews table. Explain how I can check that the counts include every row ofplaces. Do not claim to have run the code.
Run the suggested code. If it fails, use the supplied working version below. Record the five regional counts and their total. Does the total match 15,351?
Count the rows in each region, then add the counts:
metro_counts <- places |>
count(metro)
metro_counts
sum(metro_counts$n)The resulting total should be 46,141, because each row of places represents a review.
count(metro) makes one row per region. The new column n holds the number of places in that region. The $ in metro_counts$n selects that column; sum() adds its values.
metro_counts <- places |>
count(metro)
metro_counts
sum(metro_counts$n)
nrow(places)nrow(places) gives the number of rows in the original table. Compare it with the sum of the regional counts. Running code checks the explanation, too: correct code can come with an incorrect description.
If R access is unavailable, use these instructor-verified counts to check the prepared response’s explanation: Buffalo Metro 5,207; Finger Lakes / Canandaigua / Victor / Geneva 1,325; Geneseo / Livingston County 362; Rochester Metro 6,240; Syracuse Metro 2,217. State that you checked the supplied output rather than running R yourself.
4. Decide what to trust next
- Overconfidence: accepting an answer too readily after AI succeeds.
- Algorithm aversion: dismissing AI too broadly after it makes a mistake.
In three or four sentences, choose one trap that your live or prepared responses could encourage. Refer to a specific result from Question 3, explain what you would accept or correct, and propose one concrete next check before using similar help in your project.
Your next check might be running suggested code, looking up a variable on the topic page, or trying a different question whose answer you can verify. Asking the agent whether it is sure is not an independent check.
