CSci574 / AI 520 Machine Learning: Classroom Session 09/01/2026
Overview
Derek Harter introduces the course’s focus on supervised and unsupervised machine learning, then walks through an end-to-end data exploration workflow using the California housing dataset and Python tools including pandas, NumPy, and Matplotlib. He connects the workflow to assignment 2 and the upcoming class project, emphasizing clean Git practices, exploratory visualizations, correlation analysis, feature engineering, and using scikit-learn to build models.
Key takeaways
- In a typical course dataset, each row represents one sample and each column one feature; m and n commonly denote sample and feature counts, and Python indexing begins at zero.
- A supervised model learns from input features paired with target labels; y denotes the actual target and ŷ the model’s prediction.
- Pandas `head()`, `info()`, and `describe()` provide a practical first-pass audit of rows, data types, numeric ranges, and missing values.
- Exploratory plots can expose data properties that affect modeling, including California’s geographic clusters and the apparent $500,000 cap on housing values.
- Correlation is a useful initial clue for feature selection, but both positive and negative correlations can be predictive, and correlation alone does not establish causation.
- Assignment 2 applies dataset inspection and visualization to weather data, then uses temperature to predict evaporation with a regression model.
Chapters
- Assignment 1 feedback is available; Derek Harter may review solutions in a later class after giving some students more time.
- For future assignments, make separate Git commits for each subtask and write clear commit messages.
- Follow basic PEP 8 formatting, especially standard Python indentation, and add docstrings describing functions, parameters, and return values.
- The course opens roughly two units and assigns work about every two weeks; assignment 2 covers introductory scikit-learn topics.
- The end-to-end workflow in chapter 2 is a model for the open-ended class project: select a dataset, explore it, visualize it, and prepare its data.
- The class project repository and invitation link are forthcoming, with a data selection and initial work deadline expected near the end of September or beginning of October.
- Machine learning is a subset of artificial intelligence that learns predictive rules from data rather than relying on hand-coded logic.
- For supervised learning, examples include emails paired with spam or not-spam answers; training produces a model that predicts labels for unseen emails.
- A useful model should generalize to new inputs, although predictions will not be perfect in every case.
- Supervised learning uses input features and known target labels; the model learns a function mapping inputs to predicted outputs.
- Classification predicts discrete categories, such as spam versus not spam or cancer stages, while regression predicts real-valued quantities such as house prices.
- Unsupervised learning works without labels and can discover groupings through clustering or simplify data through dimensionality reduction.
- The course emphasizes supervised learning, with train, validation, and test sets and hyperparameter tuning to be developed alongside specific algorithms.
- Lecture notebooks, slides, and other resources are available in the CSci 574 / AI 520 class resources repository and can be run in JupyterLab.
- In the course’s usual two-dimensional data layout, rows are samples and columns are features.
- The notation m commonly represents the number of samples and n the number of features; uppercase X often denotes a data matrix.
- The California housing data contains 20,640 samples and 10 features, with each row representing a geographic entity and columns describing properties such as income and population.
- The mathematical notation for a sample corresponds to selecting a row in a pandas DataFrame or NumPy array; Python uses zero-based indexing.
- The target y is the value a model should predict, while ŷ denotes its prediction; for this dataset, median house value can be used as the target.
- When training on house value, remove that target column from the input features, and convert or otherwise process nonnumeric fields such as ocean proximity.
- Use pandas DataFrame column names to access features, and use `head()` and `tail()` to inspect sample records.
- Use `info()` to check column data types and identify nonnumeric fields or columns with missing values.
- Use `describe()` to summarize numeric columns, including sample counts, means, and ranges; a count below 20,640 signals missing data in this dataset.
- The housing target has a mean near $26,000 and values capped at about $500,000, details that matter when interpreting the data.
- Inspect categorical values for inconsistent spelling, category counts, and imbalances before encoding them for a model.
- Ocean proximity has five categories and can be represented with integer codes or one-hot encoding, but integer codes may imply an order that categories do not have.
- Histograms reveal feature ranges, skew, and multiple peaks; California latitude and longitude show bimodal patterns associated with the San Francisco and Los Angeles regions.
- Use distribution plots in the class project to explain what is present in a dataset and inform feature preparation.
- A geographic scatter plot can encode more than location by using transparency to show density, circle size to represent population, and color to show median house value.
- The mapped data highlights costly housing around San Francisco Bay and Los Angeles, in contrast with less expensive agricultural regions.
- Layering visual attributes gives project reports a more informative account of a dataset than basic plots alone.
- Linear algebra, statistics, and calculus can deepen understanding of machine learning, but Harter says they are not prerequisites for getting substantial value from the course.
- The class focuses on practical modeling and analysis with scikit-learn and NumPy.
- For a more mathematical treatment, Harter recommends Andrew Ng’s lectures as a resource for interpreting notation and underlying concepts.
- A correlation matrix summarizes relationships between numeric features and can help identify features associated with the target.
- Remove or encode nonnumeric columns such as ocean proximity before calculating correlations with pandas.
- Correlation magnitude matters: a strong negative relationship can be as predictive as a strong positive one, with the direction of change reversed.
- Median income is strongly associated with median house value in the California housing data.
- Scatter plots make correlation visible: a directional trend suggests a relationship, while a shapeless cloud suggests little linear association.
- The horizontal band at $500,000 in the house-value plot likely reflects a dataset cap, so records at that level may mean $500,000 or more rather than an exact value.
- Feature engineering can combine existing measurements; for example, average rooms or bedrooms per household may be more useful than total counts across a county.
- Derived features can be tested after an initial model to see whether they improve predictive accuracy.
- Assignment 2 asks students to inspect a dataset, including its sample and feature counts, data types, and missing values, using methods such as pandas `info()` and `describe()`.
- Students will fill in notebook cells and create visualizations, including a Matplotlib scatter plot of temperature versus evaporation for weather data.
- The assignment uses temperature to predict evaporation with a regression model and also introduces the statsmodels library as an alternative for regression and classification.
- Use the assignment repository created through the course invitation link so submitted work is connected to the autograding and grading system.
- Harter plans to continue chapter 3, review assignment 1, and discuss assignment 2 and statsmodels in a subsequent class.
- The class project will require choosing a dataset and beginning its exploration around the end of September or start of October.
- Students should complete pending assignment setup promptly and use the course-provided repository rather than a separate repository.
Transcript excerpt
0:04 Okay. Um, I guess it's time. Can you guys hear me that just joined here? Let me figure out how to hide that uh thing. Hello. My uh audio on here and video. >> Okay. Thank you. Okie do. Uh going to get started here. We got quorum, I guess. So, um, so hopefully, um, um, I'll have a little bit of a smoother, uh, ride today. I'm checking out stuff here. I think I got everything back set up correctly. So, um, my plan for today is, um, I did return back the assignment one, so everybody should see your, um, assignment one feedback. I I usually will do a little bit of a code review. Uh so you may or may not see a big
0:52 amount of of comments but um almost everybody I I would usually probably review this today but I am giving some people just a little more time so maybe I'll put off uh maybe talking about or looking at some solutions uh until our next meeting. But for everybody else um if you didn't see you know uh it's a good idea to check the feedback poll request um just to see if they had any comments about things. So in in general um going forward I mean I I do ask people to uh make separate commits for each of the subtasks. So I I still had some people weren't doing that. So make sure you're doing that going forward on assignments. Um uh there will be some other stuff like you know I do want
1:39 people to follow basic Python formatting. So like the PEP 8 style guidelines. So at least at a minimum have things like indentation the way Python standard style expects it to be. Um a few whites space kind of things bug
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
In this course
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Derek Harter.