Skip to content

Add SD-loaded data and pretrained model support - #3

Open
RealBhupesh wants to merge 1 commit into
makkorjamal:mainfrom
RealBhupesh:main
Open

Add SD-loaded data and pretrained model support#3
RealBhupesh wants to merge 1 commit into
makkorjamal:mainfrom
RealBhupesh:main

Conversation

@RealBhupesh

Copy link
Copy Markdown

Summary

This PR adds support for loading training data from SD-backed CSV files and for running prediction directly from a pretrained model without calling train() on-device.

Changes

  • add PLS::setModel(const MatrixXf& B, const MatrixXf& meanX, const MatrixXf& meanY)
  • add reusable CSV/model loading helpers in PLSduinoIO.h and PLSduinoIO.cpp
  • validate pretrained model dimensions before accepting B, meanX, and meanY
  • make predict() fail cleanly when the model is missing or the input feature count is wrong
  • reject empty training data in train()
  • update the SD-card training example to use shared CSV loading helpers and MatrixXf consistently
  • add a new example for loading B.csv, meanX.csv, meanY.csv, and predicting directly from SD
  • update the README to document the new workflows and required CSV shapes

Notes

  • prediction-only mode requires B, meanX, and meanY; loading B alone is not sufficient because prediction applies centering and de-centering
  • SD initialization remains sketch-owned so users can keep using SD, SD_MMC, or another filesystem backend

Testing

  • verified the implementation statically in the repo
  • could not run Arduino example builds in this environment because arduino-cli is not installed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant