Where are we and what should I be doing?


April 23, 2026

We looked at the pytorch cars example on the webpage.
This is basically the same as what we have in homework 4 but I added
setting the seed and updated the form of the super call in SLNN class.
We also did the MNIST grid search and simple gradient sections in the nnet notes.

There is no class on Tuesday, April 28.

On Thursday April 30 (last class) we will take a quick look at a few things
like k-means and principal components.


April 21, 2026

We did the IMDB and simple mnist examples. We also do the Hitters R torch example lab in ISLR.

Next class is pytorch example from hw4 and back to the notes at MNIST grid search.


April 16, 2026

We are about to do section 10 on the IMBD example in the neural net notes.

Next class we will quickly look at the R torch lab from ISLR and then go back to the notes.


April 9, 2026

We stopped at the beginning of section 4 "Deep Learning" in the neural nets notes.

Homework 4 is due May 1 (end of Semester).
Note that homework 4 just goes through the key methods
trees, random forests, boosting, and neural nets, shows you the code
and results and asks you to just try changing one thing about the model
and see what happens.

I did the python version of homework 4 in google colab
so the pdf looks a bit choppy.
It might look better if you download the notebook and then view it in
jupyter notebook. That works on my machine.

Solutions to homework 3 are on the webpage.
Note the these solutions do a first problem with numeric targe
and then a second problem with a binary target.

Software issues for neural nets are more complex than for other models.
As noted on the webpage, xgboost and pytorch are not included in anaconda.
I put on the webpage the conda I used to create environments with xgboost and pytorch
but, of course, it may be different on your machine. You might want to try xgboost.
It is fairly easy to install torch in R but you may hit some problems for keras which
sits on top of tensorflow. It may also work fine!! Depends on your system.

Good references for learning neural nets, torch, keras:
#####
torch in python:
See the pytorch page.  The tutorials are good.
https://docs.pytorch.org/tutorials/beginner/basics/intro.html

I also really like the stuff in
Machine Learning with PyTorch and Scikit-Learn: Develop machine learning and deep learning models with Python
by Sebastian Raschka (Author), Yuxi (Hayden) Liu (Author), Vahid Mirjalili (Author).
(there are a lot of really crappy books on pytorch, this one is great).

#####
torch in R:
Deep Learning and Scientific Computing with R torch, Sigrid Keydana.
I quite like the ISLR lab for this as well.
I have a version of it under the heading "Examples in R with torch".

#####
keras in R and python:
Deep Learning with Python, Second Edition 2nd Edition
by Francois Chollet (Author)  (there is also an R version of the book).
This is a really nice book.

April 7, 2026

No zoom class today (April 7) but I am hopeful for Thursday.

READ ALL THE TREES NOTES AND WATCH THE RECORDED LECTURES AS NEEDED !!!!.

START HOMEWORK 4 !!!


April 4, 2026

Homework 4 is on the webpage.
Due May 1, and this time I mean it.

Note that I did the python version of hw4 in colab
so that I would not have to worry about the pytorch install.
The best way to view it is to download the file
https://www.rob-mcculloch.org/2026_uml/webpage/hw-sp25/hw4_sp25.ipynb
and then view it in jupyter notebook.
You may not be able to run the notebook on your machine however (you may not have the needed python libs).

Final project is due May 6.

Note the homework 4 shows you how do a single tree, random forests, boosting and neural nets.
Performance on a simple train/test split is then checked.
For each of the four methods the homework just asks you to try changing on (hyper) parameter and see what happens.

Again, a relatively easy, but still very useful to to the project
would be to just do a more thorough job on homework 4.
In homework 4 I just use mileage and year.
We saw in a previous homework that trim might be useful
You (or your group!!) could just try more features and play around with the methods more.
Not also that there is a usedcars.csv dataset which has more observations and features.
> cd = read.csv("https://bitbucket.org/remcc/rob-data-sets/downloads/susedcars.csv")
> dim(cd)
[1] 1000    7
> cd1 = read.csv("https://bitbucket.org/remcc/rob-data-sets/downloads/usedcars.csv")
> dim(cd1)
[1] 20063    11

March 24, 2026

About to do the hockey example in the trees notes.


March 19, 2026

We are about to do the confusion matrix in the classification metrics notes.

Homework 3 is now due March 27th.


March 5, 2026

We are about to do the Diabetes example at the end of the linear regression notes.

Homework 2 is due March 16 and homework 3 is due March 23.
I have example scripts on the webpage on how do do everything so check it out.
Also, remember the ISL(R,python) book has labs on each topic.

We are now the really interesting part of the course:
regularized regression, ensembles of trees and neural networks.

You should be thinking about what you want to do for your project !!!!
An straighforward but good thing to do use the big cars data:
> bcdf = read.csv("http://www.rob-mcculloch.org/data/usedcars.csv")
> dim(bcdf)
[1] 20063    11
> names(bcdf)
 [1] "price"        "trim"         "isOneOwner"   "mileage"      "year"        
 [6] "color"        "displacement" "fuel"         "region"       "soundSystem" 
[11] "wheelType"   
> 
This is the cars data but with 20 thousand observations and a few more features.
You could just work on this data as we cover our key topics and you will be all ready
to write up your results at the end of the semester.

R users should study the R package glmnet.
I have simple examples on our webpage but you should read the help and
check out the vignette.
Try:
> browseVignettes()
Python users should, or course check out the help for Ridge, RidgeCv, Lasso and LassoCV:
from sklearn.linear_model import Ridge
from sklearn.linear_model import RidgeCV

from sklearn.linear_model import Lasso
from sklearn.linear_model import LassoCV

February 26, 2026

About to do KKT in the optimization notes.

Homework 2 is due March 16.
Homework 3 is due March 23.


February 12, 2026

We finished the ''KNN and the Bias-Variance'' notes
and just looked at the imports of the python code for doing KNN.


February 10, 2026

We just started ''6. More on knn, p greater than 1''.


February 5, 2026

We are about to start section 3 ''Out-of-Sample Predictions" in the
notes on knn and the bias-variance tradeoff.

Homework 1 is due February 11.
Homework can be done in groups.

Rob office hours, Monday zoom at 7pm.


January 29, 2026

We were looking at the slide 66 in the sms example in the Naive Bayes notes.

Next time we will finish Naive Bayes and then start the next set of notes on
KNN and the bias-variance tradeoff.

Note the homework 1 is on the webpage.
Due February 11.
Recorded lectures for sections 9. Naive Bayes and 10. Ham or Spam are on the webpage.



January 27, 2026

We are working through the R Hello world and about to do R factors for categorical variables.

Next we will do our first famous machine learning method, naive bayes.
The notes include a quick review of probability (including Bayes Theorem)
which we will skip, but recorded lectures are available on the webpage.


January 22, 2026

We are about to start the section "Standard Regression Output" (about In 104).

Have a look at the scikit-learn web page (scikit-learn)
and read a bit of the documentation on the LinearRegression class.

You might also want to look at the web page for the ISL books.
ISLR.
Note that you can download pdf of the book.

There are also useful ISL labs in both R and python.
Click on Resources at the upper right corner of the webpage.
Pick ISL with R, second edition or ISL with Python.
For both R and Python you can find the labs which are at the end of each chapter of the book.
Have it a look at the lab for Chapter two, it is their introduction to R and python.
You can compare with mine!!

You can get all the ISL python labs here.
You can get al the ISL R labs here.


January 20, 2026

We got to In [84] (just before the section on Help) in the python Hello World.

Optional Reading:
Let's say that from now on we use the following to reference these 4 books:
Ra: Machine Learning with PyTorch and Scikit-Learn: Develop machine learning and deep learning models with Python SL: An Introduction to Statistical Learning: with Applications in Python (or R) MLR: Machine Learning with R - Fourth Edition: Learn techniques for building and improving machine learning models HO: Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow: Concepts, Tools, and Techniques to Build Intelligent Systems 3rd Edition
For more information on the books see books

Ra: Chapter 1
SL: Chapters 1 and 2
MLR: Chapter 1 is an overview of Machine Learning and Chapter 2 is an overview of R.
HO: Chapter 1.


January 15, 2026

On Thursday, January 15, we went the the syllabus and course info.
We are about to look at the Hello world in python (Hello python).

No homework yet, just think about what software you want to use
{e.g. install R/rstudio or anaconda).


January 13, 2026

Folks,

I have had some health issues so the first class (January 13) is cancelled.
I'm hoping to zoom on Thursday January 15 and then make it in person the following week (January 20,22).

Note that the in-person classes will also be available via zoom and recordings of all classes will be available.

All class materials are available at:
https://www.rob-mcculloch.org/2026_uml/webpage/index.html

Please check out the webpage.  In particular note the link
Where are we and what I should be doing?
https://www.rob-mcculloch.org/2026_uml/webpage/ww.html

Basic computational skills are needed for the class.
I will support R and python, but you can use other software (e.g. matlib) if you want.

For python please check out my notes at:
https://www.rob-mcculloch.org/python/index.html.
If you don't have a python/data science installed on your machine you
might want to try installing anaconda as discussed on the webpage.

Please also have a look at
https://www.rob-mcculloch.org/python/Py_Hello-World_Regression.html (at bottom of the webpage above).
This is my basic intro to data science/scikit-learn.
If you don't know python, I think it is feasible to learn it as we go along
but note my suggested books at:
https://www.rob-mcculloch.org/books.txt.

For R please check out my notes at:
https://www.rob-mcculloch.org/R/index.html.
If you don't have a R/rstudio installed on your machine you should do so.
Also have a look at https://www.rob-mcculloch.org/R/R_Hello-World_Regression.html.
This is my basic introduction to R.
If you don't know R, I think it is feasible to learn it as we go along
but note my suggested books at:
https://www.rob-mcculloch.org/books.txt.


January 12, 2026

Hi there, 

Robert McCulloch is inviting you to a scheduled Zoom meeting. 

Topic: STP 494 Applied Machine Learning with R and Python
Time: Jan 13, 2026 03:00 PM Arizona
    Every week on Tue, Thu, until Apr 30, 2026, 32 occurrence(s)
    Jan 13, 2026 03:00 PM
    Jan 15, 2026 03:00 PM
    Jan 20, 2026 03:00 PM
    Jan 22, 2026 03:00 PM
    Jan 27, 2026 03:00 PM
    Jan 29, 2026 03:00 PM
    Feb 3, 2026 03:00 PM
    Feb 5, 2026 03:00 PM
    Feb 10, 2026 03:00 PM
    Feb 12, 2026 03:00 PM
    Feb 17, 2026 03:00 PM
    Feb 19, 2026 03:00 PM
    Feb 24, 2026 03:00 PM
    Feb 26, 2026 03:00 PM
    Mar 3, 2026 03:00 PM
    Mar 5, 2026 03:00 PM
    Mar 10, 2026 03:00 PM
    Mar 12, 2026 03:00 PM
    Mar 17, 2026 03:00 PM
    Mar 19, 2026 03:00 PM
    Mar 24, 2026 03:00 PM
    Mar 26, 2026 03:00 PM
    Mar 31, 2026 03:00 PM
    Apr 2, 2026 03:00 PM
    Apr 7, 2026 03:00 PM
    Apr 9, 2026 03:00 PM
    Apr 14, 2026 03:00 PM
    Apr 16, 2026 03:00 PM
    Apr 21, 2026 03:00 PM
    Apr 23, 2026 03:00 PM
    Apr 28, 2026 03:00 PM
    Apr 30, 2026 03:00 PM
    Please download and import the following iCalendar (.ics) files to your calendar system.
    Weekly: https://asu.zoom.us/meeting/tZckdu-srD0jGNwi0kfamyuFsCarOvb9RTJQ/ics?icsToken=DNEQy7VT3FLVfjEp_gAALAAAAPx65yWc13teWdVQvS6PgELGm6jnuGumH-5rOp2wAzcBo53rJADbSiHfgAiZI8jXzvVW27xMGUZyquIoyDAwMDAwMQ&meetingMasterEventId=VV_jvQMPSL2uUsABOJmWdA

Join from PC, Mac, Linux, iOS or Android: https://asu.zoom.us/j/83916426928?pwd=ZU5kKzfbz9YxSvfkwSX5nOeuJeB5k8.1
    Password: 568725

Or Telephone:
    Dial (for higher quality, dial a number based on your current location): 
        US: +1 669 900 6833  or +1 213 338 8477  or +1 669 219 2599  or +1 602 753 0140  or +1 720 928 9299  or +1 971 247 1195  or +1 253 215 8782  or +1 346 248 7799  or +1 646 518 9805  or +1 646 876 9923  or +1 651 372 8299  or +1 786 635 1003  or +1 267 831 0333  or +1 301 715 8592  or +1 312 626 6799  or +1 470 250 9358  or +1 470 381 2552 
    Meeting ID: 839 1642 6928
    International numbers available: https://asu.zoom.us/u/kdGGpEtROu
	
Or iPhone one-tap (US Toll):  +16699006833,,83916426928# or +12133388477,,83916426928#




January 1, 2026

Nothing to be done at this time.