modeldb
modeldb copied to clipboard
Improve kmeans query
In the query, pass the actual center numbers as a column rather than the formula
Hi all! Can someone explain more about this issue ?
Is "the actual center numbers" the centroids data frame? Or the argument center, which is by default 3 ?
If you look in the README and check out the results of dbplyr::remote_query(km), notice that there are some formulae that are passed in:
## FROM (SELECT `LHS`.`mpg` AS `mpg`, `LHS`.`cyl` AS `cyl`, `LHS`.`disp` AS `disp`, `LHS`.`hp` AS `hp`, `LHS`.`drat` AS `drat`, `LHS`.`wt` AS `wt`, `LHS`.`qsec` AS `qsec`, `LHS`.`vs` AS `vs`, `LHS`.`am` AS `am`, `LHS`.`gear` AS `gear`, `LHS`.`carb` AS `carb`, `LHS`.`k_center` AS `k_center`, `RHS`.`k_mpg` AS `k_mpg`, `RHS`.`k_wt` AS `k_wt`
This has LHS and RHS for the two sides of the R formula. I believe the idea here is to change the handling to work with columns instead of the formula.