School scores
This example fits a linear regression of test score on study hours and prior score. The data has 250 students from 12 schools and is stored in this app's database. Each change to the predictors refits the model on the server with phit.
Code
$fit = DataFrame::fromQuery(StudentScore::query()) |>
lm('score ~ study_hours + prior_score');
$fit = phplyr(DataFrame::fromQuery(StudentScore::query()))
->lm('score ~ study_hours + prior_score');