Gregory Wawro
Professor, Department of Political Science
In Fall 2022, I taught a new course titled “Data Science for Political Analytics.” The course included both graduate and undergraduate students, with a total enrollment of about 20. While the digital revolution has created previously unimaginable opportunities to learn about political behavior and institutions, it has also created new challenges for analyzing the massive amounts of data that are now easily accessible. Harnessing the power of political data is more critical than ever, whether students’ goals are to analyze political behavior for academic or professional purposes.
The objective of the course is to teach students (1) the fundamental concepts and principles of data science, including data collection and transformation, analysis, and interpretation; (2) how to tackle a range of problems that typically arise when working with data of various forms, including both numerical and text data; (3) coding skills that are essential for working with political data to provide insights and make predictions; (4) how to use visualizations to create narratives for effectively communicating data-driven insights; (5) basic machine learning algorithms and techniques; (6) best practices for ethical data usage and analysis.
Teaching students to leverage AI and develop their AI literacy
A key element to achieving these objectives is to teach students how to use AI to tackle data and coding challenges. The course is designed to teach students to learn how to learn, as assignments push them to extend specific skills discussed into new territory. Key to this is learning how to use the wealth of online resources available–such as Stack Overflow and ChatGPT–to figure out how to articulate questions about coding and adapt solutions that others have found for similar problems. The software used in the course, given their open source nature, have vast communities of users who share information about how to solve coding problems. It is important for students to learn how to use these resources while respecting academic integrity and intellectual property rights. Students are asked to document usage of online resources with specific references in code and write-ups of analysis.
An important aspect of teaching students to learn to use AI resources is recognizing its limits. Standard AI web resources, such as ChatGPT, often provide code that simply does not work. It may be in the ballpark, but students must learn how to debug AI-generated code, just as they must learn to debug their own code. In the class, I walk students through examples where we use AI for specific coding problems to demonstrate how what AI produces can fall short and how they can rely on other resources to correct mistakes in AI code.
I emphasize to students that information obtained from AI is just like information obtained from any source and proper credit must be given. When using AI to help with coding problems, I encourage students to include comments in their code that indicate where they got help from AI. I also point out to them that simply cutting and pasting AI code is unlikely to be a complete solution because 1) it is difficult to get AI to produce something that directly and fully addresses the issue and 2) AI code often has mistakes that need to be corrected for specific problems.
Lessons learned from teaching and learning with AI
My experience from the course is that AI can be used effectively in teaching students to code, with only minor concerns about them cutting and pasting code from AI and presenting it as their own work. AI will certainly get better and it will be easier to get more robust coding solutions from it. It will undoubtedly continue to be an essential tool for students to learn how to code and our approach as instructors to using it will have to evolve as well.
Advice for colleagues on leveraging AI for teaching and learning
For courses where the focus is coding, I think AI is especially useful because it is far from perfect. In many (perhaps most) cases, students will have to modify AI code to get it to work for their specific coding problems. For planning/behind the scenes prep, I would find examples where AI produces code that doesn’t work and show students how it has to be modified. That will help set their expectations for what AI can do for them and make them realize that they still have to learn how to make the code work.