
Explore how machine learning uses training data to build predictive models and differs from statistics in drawing population inferences. Geospatial land use classification uses elevation and distance from a city.
Explore qualitative and quantitative variable types, including nominal, ordinal, interval, ratio, and circular data, and learn how representation affects statistical modeling in geospatial contexts.
Explore simple linear regression in geospatial data science by simulating data, defining Y and X, and fitting models with statsmodels and scikit-learn, including intercept, slope, residuals, and R squared.
Explore multiple linear regression as an extension of simple regression with multiple explanatory variables to predict species from elevation, rainfall, and population density, and contrast statistical analysis with machine learning.
Analyze the five core linear regression assumptions: linear relationship, normally distributed zero-mean residuals, no multicollinearity, no autocorrelation (temporal and spatial), and constant variance. Learn practical checks, tests, and simple remedies.
Explore how variable transformations address linear regression assumptions by transforming the response or explanatory variables, using logarithmic, square root, square, power, reciprocal, and arcsine transformations, and back-transform predictions for interpretation.
Explore polynomial regression as a linear model using powers of X to capture nonlinear relationships and discuss overfitting, inflection points, and the need for domain knowledge in model selection.
Learn how overfitting arises when models include too many explanatory variables, harming generalization by fitting noise rather than the underlying process, especially with sparse data and limited degrees of freedom.
Compare many explanatory variable combinations, transformations, and interactions, then apply information criteria such as AIC or BIC to choose parsimonious models with strong generalization.
Explain how the Akaike information criterion (AIC) helps select among nested models by penalizing parameter count and comparing log-likelihood, with polynomial regression examples.
Explore diversity indices by calculating richness and evenness, using shannon's index, simpson's index, and inverse simpson for species observations across state polygons.
Compute state-level diversity from geospatial mushroom observations by building genus-count dictionaries, then derive richness, Shannon index, Simpson's lambda, and evenness across states using flexible functions.
Explore relationships among mushroom and reptile diversity using correlation matrices, histograms, and scatterplots; assess geographic patterns in Mexico and highlight richness and Simpson's diversity as focus.
Perform exploratory data analysis to refine variables, assess correlations with a heat map, and select Simpson's lambda as the response, linking richness, Shannon's index, and elevation.
Check linear regression assumptions for the best model by examining linearity, residuals with zero mean, normal distribution, homoscedasticity, and spatial autocorrelation in richness and Simpson's diversity index.
Learn how to incorporate categorical variables into linear regression with dummy variables and one-hot encoding, including drop-first, converting to numeric types, and interpreting coefficients as constants.
Explore encoding categorical variables in linear regression, using a four-technique example to create dummy variables, interpret coefficients relative to a reference category, and discuss degrees of freedom and model implications.
Split data with train_test_split, train a model on the training set, and predict on the test set. Assess performance using mean absolute error and RMSE.
Scale data with standardization or normalization to align explanatory variables, applying fit and transform on training data while noting implications for models and interpretation.
Learn how Poisson regression models count data like species richness by linking a log-linear model to explanatory variables, using statsmodels and scikit-learn with dummy variables and scaling.
Compare statistical inference and machine learning approaches to model selection. Emphasize cross-validation and regularization to prevent overfitting in Poisson regression and beyond.
Explore logistic regression for binary and multiclass outcomes. Link explanatory variables to the probability of coastal versus upland municipalities, and discuss thresholds, regularization, and maximum likelihood estimation.
Apply logistic regression with a single explanatory variable to classify municipalities as coastal or upland, and evaluate predictions with confusion matrices and probability curves.
Explore how gini impurity and entropy guide decision trees for supervised classification and regression, from root nodes to leaves, through simple examples like coastal versus upland municipalities.
Explore how a classification decision tree uses petal length and petal width to classify iris species via Gini impurity, with pruning and random forests to reduce overfitting on test data.
Apply simple decision tree models to classify coastal municipalities using minimum elevation, compare with logistic regression, and practice pruning, visualization, and feature importances to prevent overfitting.
Explore how pruning simplifies decision trees and boosts accuracy. Apply a random forest to predict bird richness from 13 features, comparing performance to logistic regression.
Explore how decision trees and random forests apply to regression problems, compare pruning and depth controls to reduce overfitting, and evaluate models with mean absolute error and RMSE.
Explore support vector machines as a classification method that finds a hyperplane to separate classes, using kernels and hyperparameters tuned by grid search for best performance.
Explore the full hyperparameter space with grid search CV (GridSearchCV) for SVMs and other models, using cross-validation and parameter grids for C, gamma, kernels, and regularization to optimize accuracy.
Apply k-means clustering to biodiversity data by grouping polygons based on five taxa richness using a scaled explanatory variable matrix.
In this course I demonstrate open source python packages for the analysis of vector-based geospatial data. I use Jupyter Notebooks as an interactive Python environment. GeoPandas is used for reading and storing geospatial data, exploratory data analysis, preparing data for use in statistical models (feature engineering, dealing with outlier and missing data, etc.), and simple plotting. Statsmodels is used for statistical inference as it provides more detail on the explanatory power of individual explanatory variables and a framework for model selection. Scikit-learn is used for machine learning applications as it includes many advanced machine learning algorithms, as well as tools for cross-validation, regularization, assessing model performance, and more.
This is a project-based course. I use real data related to biodiversity in Mexico and walk through the entire process, from both a statistical inference and machine learning perspective. I use linear regression as the basis for developing conceptual understanding of the methodology and then also discuss Poisson Regression, Logistic Regression, Decision trees, Random Forests, K-NN classification, and unsupervised classification methods such as PCA and K-means clustering.
Throughout the course, the focus is on geospatial data and special considerations for spatial data such as spatial joins, map plotting, and dealing with spatial autocorrelation.
Important concepts including model selection, maximum likelihood estimation, differences between statistical inference and machine learning and more are explained conceptually in a manner intended for geospatial professionals rather than statisticians.