Associated code

Read full text Summarise with VIRAT
Authors: Laura Hunter
Cited by: 0

Summary

No summary yet. VIRAT can read this paper and write a plain-language summary of its aim, methods, key findings and limitations.

Summarise with VIRAT Free to try with your Science Catalogs account.

Abstract

- spharm_svm.Rmd: this file contains the code used to apply a SVM to the PCA results generated from the spherical harmonics data. Inside of this RMarkdown file, there are these chunks: - SELECT BONE & DIRECTORY: this chunk does as its name says. Change the bone name and the directory name accordingly. - START PARALLELIZING: this chunk reads in the PCA data from spharm_BONENAME_oct2025.csv and parallelizes in preparation for analysis. - MACHINE LEARNING: this chunk runs the SVM and saves the results as BONENAME_accuracy_oct2025.RData and BONENAME_M_oct2025.RData. - analyses_of_spharm_data.Rmd: this file contains the code used to run most analyses in this project. It is written such that any chunk can be run individually/alone, except for SETWD AND LOAD PACKAGES and AESTHETICS, which both must be run prior to any other chunks. Locations/lines where the user must change values are indicated in comments next to that line of code. Most notable examples are the bone (changing this to a different bone's name changes which bone is analyzed) and save_figs (changing this to TRUE saves some visualizations which otherwise will not be saved) variables. Inside of this RMarkdown file, there are these chunks: - SETWD AND LOAD PACKAGES: this chunk does as its name says. Change the directory name accordingly. - AESTHETICS: this chunk records colors and shapes associated with groups and species. It exists only to make visualizations look clearer and cleaner. - PLOT PRINCIPAL COMPONENTS ANALYSIS: this chunk plots the results in spharm_BONENAME_oct2025.csv, as 1) a scatter plot, 2) a box plot, and 3) a convex hull for extant groups with scattered fossils. When this chunk is run, all these plots are saved as .pdf files in the set directory if save_figs is TRUE. - HIERARCHICAL CLUSTERING ANALYSIS: this chunk performs hierarchical clustering analysis on 1) each bone individually, 2) all bones together, and 3) the subsets of bone material available for fossil taxa missing some elements. When this chunk is run, all results are saved as .pdf files in the set directory. - SUPPORT VECTOR MACHINE: this chunk selects the most accurate SVM models generated by spharm_svm.Rmd and applies them to the fossil data to predict each fossil's group. When this chunk is run, the following files are saved in the set directory: .csv files showing how the most accurate models failed (if save_figs is TRUE), scatter plot .pdf files showing the decision boundaries of the SVM models. - DISCRIMINANT FUNCTIONAL ANALYSIS: this chunk runs LDA on each bone, first on extant taxa only to determine accuracy and then on fossil data to predict each fossil's group. When this chunk is run, .pdf files of plot showing the LDs and a .csv file of the fossils' group predictions are saved if save_figs is TRUE. - RANDOM FOREST ANALYSIS: this chunk runs a random forest analysis on each bone, first on extant taxa only to determine accuracy and then on fossil data to predict each fossil's group. When this chunk is run, the following files are saved: a .pdf file showing an MDS of the random forest results, a .csv file of the fossils' group predictions (if saved_figs is TRUE), a .csv file of a confusion matrix from the extant data (if save_figs is TRUE), and a .pdf file of an example decision tree from the random forest.

Fields of Study & Subjects

Morphological variations and asymmetry Topological and Geometric Data Analysis Statistical Methods and Applications

Publication details

Journal / source
Figshare
Publication date
2 April 2026
Language
EN