├── .cargo └── config.toml ├── .gitignore ├── .prettierrc.json ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── README.md ├── crates ├── app │ ├── Cargo.toml │ ├── build.rs │ ├── context │ │ ├── Cargo.toml │ │ └── lib.rs │ ├── core │ │ ├── Cargo.toml │ │ ├── alert.rs │ │ ├── alert_sender.rs │ │ ├── clock.rs │ │ ├── cookies.rs │ │ ├── error.rs │ │ ├── heuristics.rs │ │ ├── lib.rs │ │ ├── model.rs │ │ ├── monitor.rs │ │ ├── monitor_checker.rs │ │ ├── options.rs │ │ ├── organizations.rs │ │ ├── repos.rs │ │ ├── storage.rs │ │ ├── test_common.rs │ │ ├── timezone.rs │ │ ├── track.rs │ │ └── user.rs │ ├── date_window │ │ ├── Cargo.toml │ │ └── lib.rs │ ├── layouts │ │ ├── Cargo.toml │ │ ├── app_layout.css │ │ ├── app_layout.rs │ │ ├── auth_layout.css │ │ ├── auth_layout.rs │ │ ├── document.rs │ │ ├── lib.rs │ │ ├── model_layout.css │ │ └── model_layout.rs │ ├── lib.rs │ ├── migrations │ │ ├── Cargo.toml │ │ ├── lib.rs │ │ ├── migration_2020_01_01_000000.rs │ │ ├── migration_2020_01_01_000000.sql │ │ ├── migration_2020_04_19_000000.rs │ │ ├── migration_2020_04_19_000000.sql │ │ ├── migration_2021_11_23_000000.rs │ │ └── migration_2021_11_23_000000.sql │ ├── monitor_event │ │ ├── Cargo.toml │ │ └── lib.rs │ ├── production_metrics │ │ ├── Cargo.toml │ │ ├── binary_classification_production_metrics.rs │ │ ├── lib.rs │ │ ├── multiclass_classification_production_metrics.rs │ │ └── regression_production_metrics.rs │ ├── production_stats │ │ ├── Cargo.toml │ │ ├── column_stats.rs │ │ ├── lib.rs │ │ ├── number_stats.rs │ │ └── prediction_stats.rs │ ├── routes │ │ ├── health │ │ │ └── server │ │ │ │ ├── Cargo.toml │ │ │ │ ├── get.rs │ │ │ │ └── lib.rs │ │ ├── index │ │ │ └── server │ │ │ │ ├── Cargo.toml │ │ │ │ ├── get.rs │ │ │ │ ├── lib.rs │ │ │ │ └── page.rs │ │ ├── login │ │ │ └── server │ │ │ │ ├── Cargo.toml │ │ │ │ ├── get.rs │ │ │ │ ├── lib.rs │ │ │ │ ├── page.css │ │ │ │ ├── page.rs │ │ │ │ └── post.rs │ │ ├── organizations │ │ │ ├── _ │ │ │ │ ├── edit │ │ │ │ │ └── server │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ ├── get.rs │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ ├── page.rs │ │ │ │ │ │ └── post.rs │ │ │ │ ├── index │ │ │ │ │ └── server │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ ├── get.rs │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ ├── page.rs │ │ │ │ │ │ └── post.rs │ │ │ │ └── members │ │ │ │ │ ├── _ │ │ │ │ │ └── server │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ ├── get.rs │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ ├── page.rs │ │ │ │ │ │ └── post.rs │ │ │ │ │ └── new │ │ │ │ │ └── server │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ ├── get.rs │ │ │ │ │ ├── lib.rs │ │ │ │ │ ├── page.rs │ │ │ │ │ └── post.rs │ │ │ └── new │ │ │ │ └── server │ │ │ │ ├── Cargo.toml │ │ │ │ ├── get.rs │ │ │ │ ├── lib.rs │ │ │ │ ├── page.rs │ │ │ │ └── post.rs │ │ ├── repos │ │ │ ├── _ │ │ │ │ ├── edit │ │ │ │ │ └── server │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ ├── get.rs │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ ├── page.rs │ │ │ │ │ │ └── post.rs │ │ │ │ ├── index │ │ │ │ │ └── server │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ ├── get.rs │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ └── page.rs │ │ │ │ └── models │ │ │ │ │ ├── _ │ │ │ │ │ ├── alerts │ │ │ │ │ │ ├── _ │ │ │ │ │ │ │ └── server │ │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ │ ├── get.rs │ │ │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ │ │ └── page.rs │ │ │ │ │ │ └── index │ │ │ │ │ │ │ └── server │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ ├── get.rs │ │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ │ └── page.rs │ │ │ │ │ ├── download │ │ │ │ │ │ └── server │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ ├── get.rs │ │ │ │ │ │ │ └── lib.rs │ │ │ │ │ ├── edit │ │ │ │ │ │ └── server │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ ├── get.rs │ │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ │ ├── page.rs │ │ │ │ │ │ │ └── post.rs │ │ │ │ │ ├── index │ │ │ │ │ │ ├── client │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ └── main.rs │ │ │ │ │ │ └── server │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ ├── binary_classifier.rs │ │ │ │ │ │ │ ├── common.rs │ │ │ │ │ │ │ ├── get.rs │ │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ │ ├── multiclass_classifier.rs │ │ │ │ │ │ │ ├── page.rs │ │ │ │ │ │ │ └── regressor.rs │ │ │ │ │ ├── monitors │ │ │ │ │ │ ├── _ │ │ │ │ │ │ │ └── edit │ │ │ │ │ │ │ │ └── server │ │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ │ ├── get.rs │ │ │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ │ │ ├── page.rs │ │ │ │ │ │ │ │ └── post.rs │ │ │ │ │ │ ├── index │ │ │ │ │ │ │ └── server │ │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ │ ├── get.rs │ │ │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ │ │ └── page.rs │ │ │ │ │ │ └── new │ │ │ │ │ │ │ ├── client │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ └── main.rs │ │ │ │ │ │ │ └── server │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ ├── get.rs │ │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ │ ├── page.rs │ │ │ │ │ │ │ └── post.rs │ │ │ │ │ ├── playground │ │ │ │ │ │ ├── client │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ └── main.rs │ │ │ │ │ │ ├── common │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ └── lib.rs │ │ │ │ │ │ └── server │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ ├── get.rs │ │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ │ ├── page.css │ │ │ │ │ │ │ └── page.rs │ │ │ │ │ ├── production_metrics │ │ │ │ │ │ ├── class_metrics │ │ │ │ │ │ │ ├── client │ │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ │ └── main.rs │ │ │ │ │ │ │ └── server │ │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ │ ├── get.rs │ │ │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ │ │ └── page.rs │ │ │ │ │ │ └── index │ │ │ │ │ │ │ ├── client │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ └── main.rs │ │ │ │ │ │ │ └── server │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ ├── binary_classifier.rs │ │ │ │ │ │ │ ├── get.rs │ │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ │ ├── multiclass_classifier.rs │ │ │ │ │ │ │ ├── page.rs │ │ │ │ │ │ │ └── regressor.rs │ │ │ │ │ ├── production_predictions │ │ │ │ │ │ ├── index │ │ │ │ │ │ │ └── server │ │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ │ ├── get.rs │ │ │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ │ │ ├── page.css │ │ │ │ │ │ │ │ ├── page.rs │ │ │ │ │ │ │ │ └── post.rs │ │ │ │ │ │ └── predictions │ │ │ │ │ │ │ └── _ │ │ │ │ │ │ │ ├── client │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ └── main.rs │ │ │ │ │ │ │ └── server │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ ├── get.rs │ │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ │ └── page.rs │ │ │ │ │ ├── production_stats │ │ │ │ │ │ ├── columns │ │ │ │ │ │ │ └── _ │ │ │ │ │ │ │ │ ├── client │ │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ │ └── main.rs │ │ │ │ │ │ │ │ └── server │ │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ │ ├── enum_column.rs │ │ │ │ │ │ │ │ ├── get.rs │ │ │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ │ │ ├── number_column.rs │ │ │ │ │ │ │ │ ├── page.rs │ │ │ │ │ │ │ │ └── text_column.rs │ │ │ │ │ │ └── index │ │ │ │ │ │ │ ├── client │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ └── main.rs │ │ │ │ │ │ │ └── server │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ ├── binary_classifier.rs │ │ │ │ │ │ │ ├── common.rs │ │ │ │ │ │ │ ├── get.rs │ │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ │ ├── multiclass_classifier.rs │ │ │ │ │ │ │ ├── page.rs │ │ │ │ │ │ │ └── regressor.rs │ │ │ │ │ ├── training_grid │ │ │ │ │ │ ├── common │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ └── lib.rs │ │ │ │ │ │ ├── grid_item │ │ │ │ │ │ │ └── _ │ │ │ │ │ │ │ │ └── server │ │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ │ ├── get.rs │ │ │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ │ │ └── page.rs │ │ │ │ │ │ └── index │ │ │ │ │ │ │ └── server │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ ├── get.rs │ │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ │ └── page.rs │ │ │ │ │ ├── training_metrics │ │ │ │ │ │ ├── class_metrics │ │ │ │ │ │ │ ├── client │ │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ │ └── main.rs │ │ │ │ │ │ │ └── server │ │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ │ ├── get.rs │ │ │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ │ │ └── page.rs │ │ │ │ │ │ ├── index │ │ │ │ │ │ │ └── server │ │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ │ ├── binary_classifier.rs │ │ │ │ │ │ │ │ ├── get.rs │ │ │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ │ │ ├── multiclass_classifier.rs │ │ │ │ │ │ │ │ ├── page.rs │ │ │ │ │ │ │ │ └── regressor.rs │ │ │ │ │ │ ├── precision_recall │ │ │ │ │ │ │ ├── client │ │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ │ └── main.rs │ │ │ │ │ │ │ └── server │ │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ │ ├── get.rs │ │ │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ │ │ └── page.rs │ │ │ │ │ │ └── roc │ │ │ │ │ │ │ ├── client │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ └── main.rs │ │ │ │ │ │ │ └── server │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ ├── get.rs │ │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ │ └── page.rs │ │ │ │ │ ├── training_stats │ │ │ │ │ │ ├── columns │ │ │ │ │ │ │ └── _ │ │ │ │ │ │ │ │ ├── client │ │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ │ └── main.rs │ │ │ │ │ │ │ │ └── server │ │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ │ ├── enum_column.rs │ │ │ │ │ │ │ │ ├── get.rs │ │ │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ │ │ ├── number_column.rs │ │ │ │ │ │ │ │ ├── page.rs │ │ │ │ │ │ │ │ └── text_column.rs │ │ │ │ │ │ └── index │ │ │ │ │ │ │ └── server │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ ├── get.rs │ │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ │ └── page.rs │ │ │ │ │ └── tuning │ │ │ │ │ │ ├── client │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ └── main.rs │ │ │ │ │ │ ├── common │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ └── lib.rs │ │ │ │ │ │ └── server │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ ├── get.rs │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ ├── page.css │ │ │ │ │ │ └── page.rs │ │ │ │ │ └── new │ │ │ │ │ ├── client │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ └── main.rs │ │ │ │ │ └── server │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ ├── get.rs │ │ │ │ │ ├── lib.rs │ │ │ │ │ ├── page.rs │ │ │ │ │ └── post.rs │ │ │ └── new │ │ │ │ └── server │ │ │ │ ├── Cargo.toml │ │ │ │ ├── get.rs │ │ │ │ ├── lib.rs │ │ │ │ ├── page.rs │ │ │ │ └── post.rs │ │ ├── track │ │ │ └── server │ │ │ │ ├── Cargo.toml │ │ │ │ ├── lib.rs │ │ │ │ └── post.rs │ │ └── user │ │ │ └── server │ │ │ ├── Cargo.toml │ │ │ ├── get.rs │ │ │ ├── lib.rs │ │ │ ├── page.rs │ │ │ └── post.rs │ ├── seed.rs │ ├── static │ │ ├── favicon.png │ │ └── jetbrainsmono.woff2 │ └── ui │ │ ├── Cargo.toml │ │ ├── class_select_field.rs │ │ ├── colors.rs │ │ ├── column_type.rs │ │ ├── date_window_select_field.rs │ │ ├── lib.rs │ │ ├── logo.rs │ │ ├── metrics_row.css │ │ ├── metrics_row.rs │ │ ├── page_heading.css │ │ ├── page_heading.rs │ │ ├── pagination.css │ │ ├── pagination.rs │ │ ├── predict.rs │ │ ├── time.rs │ │ ├── tokens.rs │ │ └── topbar.rs ├── build │ ├── Cargo.toml │ └── main.rs ├── charts │ ├── Cargo.toml │ ├── bar_chart.rs │ ├── box_chart.rs │ ├── chart.rs │ ├── charts.css │ ├── common.rs │ ├── components.rs │ ├── config.rs │ ├── feature_contributions_chart.rs │ ├── lib.rs │ ├── line_chart.rs │ └── tooltip.rs ├── cli │ ├── Cargo.toml │ ├── app.rs │ ├── main.rs │ ├── migrate.rs │ ├── predict.rs │ ├── serve.rs │ └── train.rs ├── core │ ├── Cargo.toml │ ├── config.rs │ ├── features.rs │ ├── grid.rs │ ├── heuristics.rs │ ├── lib.rs │ ├── model.rs │ ├── predict.rs │ ├── progress.rs │ ├── stats.rs │ ├── test.rs │ └── train.rs ├── dev │ ├── Cargo.toml │ └── main.rs ├── features │ ├── Cargo.toml │ ├── bag_of_words.rs │ ├── bag_of_words_cosine_similarity.rs │ ├── compute.rs │ ├── identity.rs │ ├── lib.rs │ ├── normalized.rs │ ├── one_hot_encoded.rs │ └── word_embedding.rs ├── finite │ ├── Cargo.toml │ └── lib.rs ├── id │ ├── Cargo.toml │ └── lib.rs ├── kill_chip │ ├── Cargo.toml │ └── lib.rs ├── license │ ├── Cargo.toml │ ├── lib.rs │ ├── license.public.rsa │ └── main.rs ├── linear │ ├── Cargo.toml │ ├── README.md │ ├── benchmarks │ │ ├── .envrc │ │ ├── .gitignore │ │ ├── README.md │ │ ├── allstate.py │ │ ├── allstate.rs │ │ ├── boston.py │ │ ├── boston.rs │ │ ├── census.py │ │ ├── census.rs │ │ ├── flights.py │ │ ├── flights.rs │ │ ├── heart_disease.py │ │ ├── heart_disease.rs │ │ ├── higgs.py │ │ ├── higgs.rs │ │ ├── iris.py │ │ ├── iris.rs │ │ ├── main.rs │ │ └── pytorch_linear.py │ ├── binary_classifier.rs │ ├── lib.rs │ ├── linear.svg │ ├── multiclass_classifier.rs │ ├── regressor.rs │ ├── serialize.rs │ └── shap.rs ├── metrics │ ├── Cargo.toml │ ├── README.md │ ├── accuracy.rs │ ├── auc_roc.rs │ ├── binary_classification.rs │ ├── binary_cross_entropy.rs │ ├── cross_entropy.rs │ ├── lib.rs │ ├── mean.rs │ ├── mean_squared_error.rs │ ├── mean_variance.rs │ ├── metrics.svg │ ├── mode.rs │ ├── multiclass_classification.rs │ └── regression.rs ├── model │ ├── Cargo.toml │ ├── binary_classifier.rs │ ├── features.rs │ ├── grid.rs │ ├── lib.rs │ ├── model_train_options.rs │ ├── multiclass_classifier.rs │ ├── regressor.rs │ └── stats.rs ├── number_formatter │ ├── Cargo.toml │ └── lib.rs ├── progress_counter │ ├── Cargo.toml │ └── lib.rs ├── serve │ ├── Cargo.toml │ └── lib.rs ├── table │ ├── Cargo.toml │ ├── README.md │ ├── lib.rs │ ├── load.rs │ └── table.svg ├── text │ ├── Cargo.toml │ ├── lib.rs │ ├── ngram.rs │ ├── text.svg │ ├── tokenizer.rs │ └── word_embedding.rs ├── tree │ ├── Cargo.toml │ ├── README.md │ ├── benchmarks │ │ ├── .envrc │ │ ├── .gitignore │ │ ├── README.md │ │ ├── allstate.py │ │ ├── allstate.rs │ │ ├── boston.py │ │ ├── boston.rs │ │ ├── census.py │ │ ├── census.rs │ │ ├── conda.yaml │ │ ├── flights.py │ │ ├── flights.rs │ │ ├── heart_disease.py │ │ ├── heart_disease.rs │ │ ├── higgs.py │ │ ├── higgs.rs │ │ ├── iris.py │ │ ├── iris.rs │ │ └── main.rs │ ├── binary_classifier.rs │ ├── choose_best_split.rs │ ├── compute_bin_stats.rs │ ├── compute_binned_features.rs │ ├── compute_binning_instructions.rs │ ├── compute_feature_importances.rs │ ├── lib.rs │ ├── multiclass_classifier.rs │ ├── pool.rs │ ├── rearrange_examples_index.rs │ ├── regressor.rs │ ├── serialize.rs │ ├── shap.rs │ ├── timing.rs │ ├── train.rs │ ├── train_tree.rs │ └── tree.svg ├── ui │ ├── Cargo.toml │ ├── alert.css │ ├── alert.rs │ ├── alert_icon.css │ ├── alert_icon.rs │ ├── asciicast.css │ ├── asciicast.rs │ ├── avatar.css │ ├── avatar.rs │ ├── button.css │ ├── button.rs │ ├── callout.css │ ├── callout.rs │ ├── card.css │ ├── card.rs │ ├── code.css │ ├── code.rs │ ├── confusion_matrix.css │ ├── confusion_matrix.rs │ ├── confusion_matrix_comparison.css │ ├── confusion_matrix_comparison.rs │ ├── details.css │ ├── details.rs │ ├── form │ │ ├── checkbox_field.css │ │ ├── checkbox_field.rs │ │ ├── field_label.css │ │ ├── field_label.rs │ │ ├── file_field.css │ │ ├── file_field.rs │ │ ├── form.css │ │ ├── mod.rs │ │ ├── select_field.css │ │ ├── select_field.rs │ │ ├── text_field.css │ │ └── text_field.rs │ ├── global.css │ ├── image.css │ ├── image.rs │ ├── layout.css │ ├── layout.rs │ ├── lib.rs │ ├── link.css │ ├── link.rs │ ├── markdown.css │ ├── markdown.rs │ ├── nav.css │ ├── nav.rs │ ├── number_card.css │ ├── number_card.rs │ ├── number_comparison_card.css │ ├── number_comparison_card.rs │ ├── slider.css │ ├── slider.rs │ ├── tab_bar.css │ ├── tab_bar.rs │ ├── table.css │ ├── table.rs │ ├── theme.rs │ ├── token.css │ ├── token.rs │ ├── topbar.css │ ├── topbar.rs │ ├── window.css │ └── window.rs ├── wheel_writer │ ├── Cargo.toml │ ├── lib.rs │ └── main.rs ├── www │ ├── Cargo.toml │ ├── build.rs │ ├── content │ │ ├── Cargo.toml │ │ ├── blog │ │ │ ├── what_machine_learning_can_learn_from_ruby_on_rails │ │ │ │ └── post.md │ │ │ └── writing_the_fastest_gbdt_library_in_rust │ │ │ │ └── post.md │ │ ├── docs_guides │ │ │ ├── run_the_app_on_your_own_server │ │ │ │ └── post.md │ │ │ └── train_with_custom_configuration │ │ │ │ └── post.md │ │ ├── docs_internals │ │ │ ├── feature_engineering │ │ │ │ └── post.md │ │ │ └── task_and_model_types │ │ │ │ └── post.md │ │ └── lib.rs │ ├── layouts │ │ ├── Cargo.toml │ │ ├── docs_layout.css │ │ ├── docs_layout.rs │ │ ├── document.rs │ │ ├── footer.css │ │ ├── footer.rs │ │ ├── language.rs │ │ ├── layout.css │ │ ├── layout.rs │ │ ├── lib.rs │ │ ├── page_layout.css │ │ └── page_layout.rs │ ├── main.rs │ ├── routes │ │ ├── benchmarks │ │ │ ├── client │ │ │ │ ├── Cargo.toml │ │ │ │ └── main.rs │ │ │ ├── common │ │ │ │ ├── Cargo.toml │ │ │ │ └── lib.rs │ │ │ └── server │ │ │ │ ├── Cargo.toml │ │ │ │ ├── lib.rs │ │ │ │ ├── page.css │ │ │ │ └── page.rs │ │ ├── blog │ │ │ ├── _ │ │ │ │ └── index │ │ │ │ │ └── server │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ ├── hn.svg │ │ │ │ │ ├── lib.rs │ │ │ │ │ ├── page.css │ │ │ │ │ ├── page.rs │ │ │ │ │ ├── reddit.svg │ │ │ │ │ └── twitter.svg │ │ │ └── index │ │ │ │ └── server │ │ │ │ ├── Cargo.toml │ │ │ │ ├── lib.rs │ │ │ │ └── page.rs │ │ ├── docs │ │ │ ├── getting_started │ │ │ │ ├── index │ │ │ │ │ └── server │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ └── page.rs │ │ │ │ ├── inspect │ │ │ │ │ ├── client │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ └── main.rs │ │ │ │ │ ├── common │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ └── lib.rs │ │ │ │ │ └── server │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ ├── page.css │ │ │ │ │ │ └── page.rs │ │ │ │ ├── monitor │ │ │ │ │ ├── client │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ └── main.rs │ │ │ │ │ └── server │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ └── page.rs │ │ │ │ ├── predict │ │ │ │ │ ├── cli │ │ │ │ │ │ └── server │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ │ ├── page.md │ │ │ │ │ │ │ └── page.rs │ │ │ │ │ ├── elixir │ │ │ │ │ │ └── server │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ │ └── page.rs │ │ │ │ │ ├── go │ │ │ │ │ │ └── server │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ │ └── page.rs │ │ │ │ │ ├── index │ │ │ │ │ │ └── server │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ │ └── page.rs │ │ │ │ │ ├── javascript │ │ │ │ │ │ └── server │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ │ └── page.rs │ │ │ │ │ ├── php │ │ │ │ │ │ └── server │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ │ └── page.rs │ │ │ │ │ ├── python │ │ │ │ │ │ └── server │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ │ └── page.rs │ │ │ │ │ ├── ruby │ │ │ │ │ │ └── server │ │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ │ └── page.rs │ │ │ │ │ └── rust │ │ │ │ │ │ └── server │ │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ │ ├── lib.rs │ │ │ │ │ │ └── page.rs │ │ │ │ └── train │ │ │ │ │ └── server │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ ├── dataset_preview.rs │ │ │ │ │ ├── lib.rs │ │ │ │ │ └── page.rs │ │ │ ├── guides │ │ │ │ └── _ │ │ │ │ │ └── server │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ ├── lib.rs │ │ │ │ │ └── page.rs │ │ │ ├── index │ │ │ │ └── server │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ ├── lib.rs │ │ │ │ │ └── page.rs │ │ │ ├── install │ │ │ │ └── server │ │ │ │ │ ├── Cargo.toml │ │ │ │ │ ├── lib.rs │ │ │ │ │ └── page.rs │ │ │ └── internals │ │ │ │ └── _ │ │ │ │ └── server │ │ │ │ ├── Cargo.toml │ │ │ │ ├── lib.rs │ │ │ │ └── page.rs │ │ ├── index │ │ │ ├── client │ │ │ │ ├── Cargo.toml │ │ │ │ └── main.rs │ │ │ ├── common │ │ │ │ ├── Cargo.toml │ │ │ │ ├── lib.rs │ │ │ │ ├── tuning.css │ │ │ │ └── tuning.rs │ │ │ └── server │ │ │ │ ├── Cargo.toml │ │ │ │ ├── inspection.css │ │ │ │ ├── inspection.rs │ │ │ │ ├── lib.rs │ │ │ │ ├── monitoring.rs │ │ │ │ ├── page.css │ │ │ │ ├── page.rs │ │ │ │ ├── predict.rs │ │ │ │ ├── production_metrics.css │ │ │ │ ├── production_metrics.rs │ │ │ │ ├── production_predictions.css │ │ │ │ ├── production_predictions.rs │ │ │ │ ├── production_stats.css │ │ │ │ ├── production_stats.rs │ │ │ │ ├── train.rs │ │ │ │ ├── train.txt │ │ │ │ ├── training_stats.svg │ │ │ │ └── tuning.rs │ │ └── pricing │ │ │ └── server │ │ │ ├── Cargo.toml │ │ │ ├── lib.rs │ │ │ ├── page.css │ │ │ └── page.rs │ ├── static │ │ ├── blog │ │ │ ├── introducing_tangram │ │ │ │ ├── architecture.png │ │ │ │ ├── model_types.png │ │ │ │ ├── steps.png │ │ │ │ └── today.png │ │ │ ├── what_machine_learning_can_learn_from_ruby_on_rails │ │ │ │ └── rails.png │ │ │ └── writing_the_fastest_gbdt_library_in_rust │ │ │ │ ├── cache_hierarchy.png │ │ │ │ ├── cores_column_wise.png │ │ │ │ ├── cores_row_wise.png │ │ │ │ ├── features_matrix.png │ │ │ │ ├── features_matrix_column_wise.png │ │ │ │ ├── features_matrix_row_wise.png │ │ │ │ ├── flame.png │ │ │ │ ├── flamegraph.png │ │ │ │ ├── gbdt.png │ │ │ │ ├── random_access.png │ │ │ │ ├── training_time.png │ │ │ │ ├── tree.png │ │ │ │ └── tree_with_path.png │ │ ├── favicon.png │ │ ├── heart_disease.csv │ │ └── jetbrainsmono.woff2 │ └── ui │ │ ├── Cargo.toml │ │ ├── lib.rs │ │ └── logo.rs └── zip │ ├── Cargo.toml │ ├── lib.rs │ ├── pzip.rs │ └── zip.rs ├── flake.lock ├── flake.nix ├── heart_disease.csv ├── heart_disease.modelfox ├── languages ├── c │ ├── .gitignore │ ├── Cargo.toml │ ├── Doxyfile │ ├── README.md │ ├── cbindgen.toml │ ├── lib.rs │ └── scripts │ │ ├── docs │ │ └── release ├── elixir │ ├── .formatter.exs │ ├── .gitignore │ ├── Cargo.toml │ ├── LICENSE │ ├── README.md │ ├── build.rs │ ├── examples │ │ ├── advanced │ │ │ ├── .formatter.exs │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── lib │ │ │ │ └── application.ex │ │ │ └── mix.exs │ │ └── basic │ │ │ ├── .formatter.exs │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── lib │ │ │ └── application.ex │ │ │ └── mix.exs │ ├── lib.rs │ ├── lib │ │ └── tangram.ex │ ├── mix.exs │ ├── mix.lock │ ├── scripts │ │ ├── build │ │ ├── dev │ │ ├── docs │ │ ├── fmt │ │ └── release │ └── test │ │ └── test_helper.exs ├── go │ ├── .gitignore │ ├── LICENSE │ ├── README.md │ ├── examples │ │ ├── advanced │ │ │ ├── README.md │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ └── main.go │ │ └── basic │ │ │ ├── README.md │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ └── main.go │ ├── go.mod │ ├── go.sum │ ├── scripts │ │ ├── build │ │ ├── dev │ │ ├── docs │ │ ├── fmt │ │ └── release │ └── tangram.go ├── javascript │ ├── .gitignore │ ├── .npmignore │ ├── LICENSE │ ├── README.md │ ├── common.ts │ ├── entrypoints │ │ ├── bundler.js │ │ ├── deno.ts │ │ ├── node.cjs │ │ ├── node.js │ │ └── web.js │ ├── examples │ │ ├── bundler │ │ │ └── webpack │ │ │ │ ├── .gitignore │ │ │ │ ├── README.md │ │ │ │ ├── index.html │ │ │ │ ├── index.js │ │ │ │ ├── package.json │ │ │ │ └── webpack.config.js │ │ ├── deno │ │ │ └── basic │ │ │ │ ├── README.md │ │ │ │ ├── dev.json │ │ │ │ └── main.ts │ │ ├── node │ │ │ ├── advanced │ │ │ │ ├── README.md │ │ │ │ ├── main.js │ │ │ │ └── package.json │ │ │ ├── basic │ │ │ │ ├── README.md │ │ │ │ ├── main.js │ │ │ │ └── package.json │ │ │ ├── commonjs │ │ │ │ ├── README.md │ │ │ │ ├── main.js │ │ │ │ └── package.json │ │ │ └── typescript │ │ │ │ ├── .gitignore │ │ │ │ ├── README.md │ │ │ │ ├── main.ts │ │ │ │ ├── package.json │ │ │ │ └── tsconfig.json │ │ └── web │ │ │ └── basic │ │ │ ├── README.md │ │ │ ├── index.html │ │ │ └── index.js │ ├── node │ │ ├── Cargo.toml │ │ ├── build.rs │ │ └── lib.rs │ ├── package-lock.json │ ├── package.json │ ├── scripts │ │ ├── build │ │ ├── dev │ │ ├── docs │ │ ├── fmt │ │ └── release │ ├── tsconfig.json │ └── wasm │ │ ├── Cargo.toml │ │ └── lib.rs ├── php │ ├── .gitignore │ ├── .php_cs-fixer.dist.php │ ├── README.md │ ├── composer.json │ ├── composer.lock │ ├── examples │ │ ├── advanced │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── composer.json │ │ │ └── src │ │ │ │ └── main.php │ │ └── basic │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── composer.json │ │ │ └── src │ │ │ └── main.php │ ├── phpdoc.dist.xml │ ├── scripts │ │ ├── build │ │ ├── dev │ │ ├── docs │ │ ├── fmt │ │ └── release │ └── src │ │ ├── BagOfWordsCosineSimilarityFeatureContribution.php │ │ ├── BagOfWordsFeatureContribution.php │ │ ├── Bigram.php │ │ ├── BinaryClassificationPredictOutput.php │ │ ├── FeatureContributions.php │ │ ├── IdentityFeatureContribution.php │ │ ├── LoadModelOptions.php │ │ ├── Model.php │ │ ├── MulticlassClassificationPredictOutput.php │ │ ├── Ngram.php │ │ ├── NormalizedFeatureContribution.php │ │ ├── OneHotEncodedFeatureContribution.php │ │ ├── PredictOptions.php │ │ ├── PredictOutput.php │ │ ├── RegressionPredictOutput.php │ │ ├── TangramFeatureContributionEntryType.php │ │ ├── TangramNGramType.php │ │ ├── TangramStringView.php │ │ ├── TangramTaskType.php │ │ ├── Unigram.php │ │ └── WordEmbeddingFeatureContribution.php ├── python │ ├── .gitignore │ ├── Cargo.toml │ ├── LICENSE │ ├── MANIFEST.in │ ├── README.md │ ├── build.rs │ ├── examples │ │ ├── advanced │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── main.py │ │ │ └── requirements.txt │ │ └── basic │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── main.py │ │ │ └── requirements.txt │ ├── lib.rs │ ├── metadata.toml │ ├── modelfox │ │ ├── __init__.py │ │ ├── py.typed │ │ ├── tangram_python.pyi │ │ └── tangram_python.so │ ├── module.html.jinja2 │ ├── python3.lib │ ├── scripts │ │ ├── build │ │ ├── check │ │ ├── dev │ │ ├── docs │ │ ├── fmt │ │ └── release │ └── setup.py ├── ruby │ ├── .gitignore │ ├── Gemfile │ ├── Gemfile.lock │ ├── LICENSE │ ├── README.md │ ├── examples │ │ ├── advanced │ │ │ ├── Gemfile │ │ │ ├── README.md │ │ │ └── main.rb │ │ └── basic │ │ │ ├── Gemfile │ │ │ ├── README.md │ │ │ └── main.rb │ ├── lib │ │ ├── modelfox.rb │ │ └── modelfox │ │ │ └── modelfox.rb │ ├── modelfox.gemspec │ └── scripts │ │ ├── build │ │ ├── dev │ │ ├── docs │ │ ├── fmt │ │ └── release └── rust │ ├── .gitignore │ ├── Cargo.toml │ ├── LICENSE │ ├── README.md │ ├── examples │ ├── advanced │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── main.rs │ └── basic │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── main.rs │ ├── lib.rs │ ├── macro │ ├── Cargo.toml │ └── lib.rs │ └── scripts │ ├── build │ ├── docs │ └── release ├── modelfox.png ├── modelfox.svg ├── readme ├── drift.png ├── metrics.png ├── predictions.png ├── report.png └── tune.png ├── rust-toolchain.toml ├── rustfmt.toml └── scripts ├── app ├── dev └── seed ├── build ├── license ├── release └── www ├── dev └── docs /.cargo/config.toml: -------------------------------------------------------------------------------- 1 | target-applies-to-host = false 2 | 3 | [unstable] 4 | bindeps = true 5 | host-config = true 6 | multitarget = true 7 | target-applies-to-host = true 8 | 9 | [env] 10 | CFLAGS = "-fno-sanitize=undefined" 11 | PYO3_NO_PYTHON = "1" 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /.direnv/ 3 | /.envrc 4 | /data/ 5 | /dist/ 6 | /result/ 7 | /secrets/ 8 | /target/ 9 | -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "arrowParens": "avoid", 3 | "bracketSpacing": true, 4 | "jsxBracketSameLine": false, 5 | "semi": false, 6 | "trailingComma": "all", 7 | "useTabs": true 8 | } 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | All of this repository is MIT licensed, except for the `crates/app` directory, which is source available and free to use for testing, but requires a paid license to use in production. Send us an email at hello@modelfox.dev if you are interested in a license. 2 | -------------------------------------------------------------------------------- /crates/app/build.rs: -------------------------------------------------------------------------------- 1 | use anyhow::Result; 2 | use std::path::PathBuf; 3 | 4 | fn main() -> Result<()> { 5 | let crate_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); 6 | let workspace_path = crate_path.parent().unwrap().parent().unwrap().to_owned(); 7 | let crate_out_dir = PathBuf::from(std::env::var("OUT_DIR").unwrap()); 8 | let css_paths = vec![workspace_path.to_owned()]; 9 | println!("cargo:rerun-if-changed=../../Cargo.lock"); 10 | println!("cargo:rerun-if-changed=../"); 11 | sunfish::build(sunfish::BuildOptions { 12 | workspace_path, 13 | crate_path, 14 | crate_out_dir, 15 | css_paths, 16 | })?; 17 | Ok(()) 18 | } 19 | -------------------------------------------------------------------------------- /crates/app/context/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_app_context" 5 | 6 | authors = { workspace = true } 7 | edition = { workspace = true } 8 | homepage = { workspace = true } 9 | license = "UNLICENSED" 10 | publish = false 11 | repository = { workspace = true } 12 | version = { workspace = true } 13 | 14 | [lib] 15 | path = "lib.rs" 16 | 17 | [dependencies] 18 | anyhow = { workspace = true } 19 | sunfish = { workspace = true } 20 | 21 | modelfox_app_core = { path = "../core" } -------------------------------------------------------------------------------- /crates/app/context/lib.rs: -------------------------------------------------------------------------------- 1 | use modelfox_app_core::App; 2 | 3 | pub struct Context { 4 | pub app: App, 5 | pub sunfish: sunfish::Sunfish, 6 | } 7 | -------------------------------------------------------------------------------- /crates/app/core/cookies.rs: -------------------------------------------------------------------------------- 1 | use std::collections::BTreeMap; 2 | 3 | pub struct ParseCookiesError; 4 | 5 | pub fn parse_cookies(cookies_str: &str) -> Result, ParseCookiesError> { 6 | cookies_str 7 | .split("; ") 8 | .map(|cookie| { 9 | let mut components = cookie.split('='); 10 | let key = match components.next() { 11 | Some(key) => key, 12 | None => return Err(ParseCookiesError), 13 | }; 14 | let value = match components.next() { 15 | Some(value) => value, 16 | None => return Err(ParseCookiesError), 17 | }; 18 | Ok((key, value)) 19 | }) 20 | .collect() 21 | } 22 | -------------------------------------------------------------------------------- /crates/app/core/timezone.rs: -------------------------------------------------------------------------------- 1 | use super::cookies::parse_cookies; 2 | use chrono_tz::Tz; 3 | 4 | pub fn get_timezone(request: &http::Request) -> Tz { 5 | request 6 | .headers() 7 | .get(http::header::COOKIE) 8 | .and_then(|cookie_header_value| cookie_header_value.to_str().ok()) 9 | .and_then(|cookie_header_value| parse_cookies(cookie_header_value).ok()) 10 | .and_then(|cookies| cookies.get("modelfox_timezone").cloned()) 11 | .and_then(|timezone_str| timezone_str.parse().ok()) 12 | .unwrap_or(Tz::UTC) 13 | } 14 | -------------------------------------------------------------------------------- /crates/app/date_window/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_app_date_window" 5 | 6 | authors = { workspace = true } 7 | edition = { workspace = true } 8 | homepage = { workspace = true } 9 | license = "UNLICENSED" 10 | publish = false 11 | repository = { workspace = true } 12 | version = { workspace = true } 13 | 14 | [lib] 15 | path = "lib.rs" 16 | 17 | [dependencies] 18 | serde = { workspace = true } 19 | -------------------------------------------------------------------------------- /crates/app/layouts/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_app_layouts" 5 | 6 | authors = { workspace = true } 7 | edition = { workspace = true } 8 | homepage = { workspace = true } 9 | license = "UNLICENSED" 10 | publish = false 11 | repository = { workspace = true } 12 | version = { workspace = true } 13 | 14 | [lib] 15 | path = "lib.rs" 16 | 17 | [dependencies] 18 | anyhow = { workspace = true } 19 | futures = { workspace = true } 20 | http = { workspace = true } 21 | hyper = { workspace = true } 22 | pinwheel = { workspace = true } 23 | serde = { workspace = true } 24 | sqlx = { workspace = true } 25 | sunfish = { workspace = true } 26 | 27 | modelfox_id = { workspace = true } 28 | modelfox_ui = { workspace = true } 29 | 30 | modelfox_app_context = { path = "../context" } 31 | modelfox_app_core = { path = "../core" } 32 | modelfox_app_ui = { path = "../../app/ui" } 33 | -------------------------------------------------------------------------------- /crates/app/layouts/app_layout.css: -------------------------------------------------------------------------------- 1 | .app-layout-topbar-grid { 2 | color: var(--text-color); 3 | display: grid; 4 | grid: auto 1fr / auto; 5 | min-height: 100vh; 6 | overflow-x: hidden; 7 | } 8 | 9 | .app-layout { 10 | box-sizing: border-box; 11 | margin: 0 auto; 12 | max-width: var(--max-width); 13 | padding: 2rem; 14 | width: 100%; 15 | } 16 | -------------------------------------------------------------------------------- /crates/app/layouts/auth_layout.css: -------------------------------------------------------------------------------- 1 | .auth-layout { 2 | display: grid; 3 | row-gap: 1rem; 4 | justify-content: center; 5 | justify-items: center; 6 | padding-top: 1rem; 7 | } 8 | 9 | .auth-layout-logo-wrapper { 10 | height: 5rem; 11 | width: 5rem; 12 | } 13 | 14 | .auth-layout-card-wrapper { 15 | width: 300px; 16 | } 17 | -------------------------------------------------------------------------------- /crates/app/layouts/auth_layout.rs: -------------------------------------------------------------------------------- 1 | use modelfox_app_ui::logo::Logo; 2 | use modelfox_ui as ui; 3 | use pinwheel::prelude::*; 4 | 5 | #[derive(children, Default, new)] 6 | #[new(default)] 7 | pub struct AuthLayout { 8 | pub children: Vec, 9 | } 10 | 11 | impl Component for AuthLayout { 12 | fn into_node(self) -> Node { 13 | div() 14 | .class("auth-layout") 15 | .child(div().class("auth-layout-logo-wrapper").child(Logo::new())) 16 | .child( 17 | div() 18 | .class("auth-layout-card-wrapper") 19 | .child(ui::Card::new().child(self.children)), 20 | ) 21 | .into_node() 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /crates/app/layouts/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod app_layout; 2 | pub mod auth_layout; 3 | pub mod document; 4 | pub mod model_layout; 5 | -------------------------------------------------------------------------------- /crates/app/migrations/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_app_migrations" 5 | 6 | authors = { workspace = true } 7 | edition = { workspace = true } 8 | homepage = { workspace = true } 9 | license = "UNLICENSED" 10 | publish = false 11 | repository = { workspace = true } 12 | version = { workspace = true } 13 | 14 | [lib] 15 | path = "lib.rs" 16 | 17 | [dependencies] 18 | anyhow = { workspace = true } 19 | futures = { workspace = true } 20 | once_cell = { workspace = true } 21 | sqlx = { workspace = true } 22 | 23 | modelfox_zip = { workspace = true } 24 | -------------------------------------------------------------------------------- /crates/app/migrations/migration_2020_01_01_000000.rs: -------------------------------------------------------------------------------- 1 | use anyhow::Result; 2 | use sqlx::prelude::*; 3 | 4 | pub async fn migrate(db: &mut sqlx::Transaction<'_, sqlx::Any>) -> Result<()> { 5 | db.execute(include_str!("./migration_2020_01_01_000000.sql")) 6 | .await?; 7 | Ok(()) 8 | } 9 | -------------------------------------------------------------------------------- /crates/app/migrations/migration_2020_04_19_000000.rs: -------------------------------------------------------------------------------- 1 | use anyhow::Result; 2 | use sqlx::prelude::*; 3 | 4 | pub async fn migrate(db: &mut sqlx::Transaction<'_, sqlx::Any>) -> Result<()> { 5 | db.execute(include_str!("./migration_2020_04_19_000000.sql")) 6 | .await?; 7 | Ok(()) 8 | } 9 | -------------------------------------------------------------------------------- /crates/app/migrations/migration_2020_04_19_000000.sql: -------------------------------------------------------------------------------- 1 | alter table models add column tag varchar(64); 2 | -------------------------------------------------------------------------------- /crates/app/migrations/migration_2021_11_23_000000.rs: -------------------------------------------------------------------------------- 1 | use anyhow::Result; 2 | use sqlx::prelude::*; 3 | 4 | pub async fn migrate(db: &mut sqlx::Transaction<'_, sqlx::Any>) -> Result<()> { 5 | db.execute(include_str!("./migration_2021_11_23_000000.sql")) 6 | .await?; 7 | Ok(()) 8 | } 9 | -------------------------------------------------------------------------------- /crates/app/migrations/migration_2021_11_23_000000.sql: -------------------------------------------------------------------------------- 1 | create table monitors ( 2 | id char(32) primary key, 3 | model_id char(32) references models (id) not null, 4 | data text not null, 5 | cadence integer not null, 6 | last_checked bigint 7 | ); 8 | 9 | create table alerts ( 10 | id char(32) primary key, 11 | monitor_id char(32) references monitors (id) not null, 12 | data text not null, 13 | date bigint not null 14 | ); 15 | 16 | create table alert_sends ( 17 | id char(32) primary key, 18 | alert_id char(32) references alerts (id) not null, 19 | attempt_count integer not null, 20 | method text not null, 21 | status integer not null, 22 | initiated_date bigint not null, 23 | completed_date bigint 24 | ); 25 | -------------------------------------------------------------------------------- /crates/app/monitor_event/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_app_monitor_event" 5 | 6 | authors = { workspace = true } 7 | edition = { workspace = true } 8 | homepage = { workspace = true } 9 | license = "UNLICENSED" 10 | publish = false 11 | repository = { workspace = true } 12 | version = { workspace = true } 13 | 14 | [lib] 15 | path = "lib.rs" 16 | 17 | [dependencies] 18 | chrono = { workspace = true } 19 | serde = { workspace = true } 20 | serde_json = { workspace = true } 21 | 22 | modelfox_finite = { workspace = true } 23 | modelfox_id = { workspace = true } 24 | -------------------------------------------------------------------------------- /crates/app/routes/health/server/get.rs: -------------------------------------------------------------------------------- 1 | use anyhow::Result; 2 | use modelfox_app_context::Context; 3 | use std::sync::Arc; 4 | 5 | pub async fn get(request: &mut http::Request) -> Result> { 6 | let context = Arc::clone(request.extensions().get::>().unwrap()); 7 | match context.app.db_acquire().await { 8 | Ok(_) => { 9 | let response = http::Response::builder() 10 | .status(http::StatusCode::OK) 11 | .body(hyper::Body::empty()) 12 | .unwrap(); 13 | Ok(response) 14 | } 15 | Err(_) => { 16 | let response = http::Response::builder() 17 | .status(http::StatusCode::SERVICE_UNAVAILABLE) 18 | .body(hyper::Body::empty()) 19 | .unwrap(); 20 | Ok(response) 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /crates/app/routes/health/server/lib.rs: -------------------------------------------------------------------------------- 1 | use futures::FutureExt; 2 | use modelfox_app_core::error::method_not_allowed; 3 | 4 | mod get; 5 | 6 | pub fn init() -> sunfish::Route { 7 | sunfish::Route::new_dynamic(|request| match *request.method() { 8 | http::Method::GET => self::get::get(request).boxed(), 9 | _ => async { Ok(method_not_allowed()) }.boxed(), 10 | }) 11 | } 12 | -------------------------------------------------------------------------------- /crates/app/routes/index/server/lib.rs: -------------------------------------------------------------------------------- 1 | use futures::FutureExt; 2 | use modelfox_app_core::error::method_not_allowed; 3 | 4 | mod get; 5 | mod page; 6 | 7 | pub fn init() -> sunfish::Route { 8 | sunfish::Route::new_dynamic(|request| match *request.method() { 9 | http::Method::GET => self::get::get(request).boxed(), 10 | _ => async { Ok(method_not_allowed()) }.boxed(), 11 | }) 12 | } 13 | -------------------------------------------------------------------------------- /crates/app/routes/login/server/lib.rs: -------------------------------------------------------------------------------- 1 | use futures::FutureExt; 2 | use modelfox_app_core::error::method_not_allowed; 3 | 4 | mod get; 5 | mod page; 6 | mod post; 7 | 8 | pub fn init() -> sunfish::Route { 9 | sunfish::Route::new_dynamic(|request| match *request.method() { 10 | http::Method::GET => self::get::get(request).boxed(), 11 | http::Method::POST => self::post::post(request).boxed(), 12 | _ => async { Ok(method_not_allowed()) }.boxed(), 13 | }) 14 | } 15 | -------------------------------------------------------------------------------- /crates/app/routes/login/server/page.css: -------------------------------------------------------------------------------- 1 | .login-code-message { 2 | line-height: 1.5; 3 | text-align: center; 4 | } 5 | -------------------------------------------------------------------------------- /crates/app/routes/organizations/_/edit/server/get.rs: -------------------------------------------------------------------------------- 1 | use crate::page::Page; 2 | use anyhow::Result; 3 | use modelfox_app_context::Context; 4 | use modelfox_app_core::error::not_found; 5 | use modelfox_app_layouts::app_layout::app_layout_info; 6 | use pinwheel::prelude::*; 7 | use std::sync::Arc; 8 | 9 | pub async fn get(request: &mut http::Request) -> Result> { 10 | let context = Arc::clone(request.extensions().get::>().unwrap()); 11 | let app = &context.app; 12 | if !app.options().auth_enabled() { 13 | return Ok(not_found()); 14 | } 15 | let app_layout_info = app_layout_info(app).await?; 16 | let page = Page { 17 | app_layout_info, 18 | error: None, 19 | }; 20 | let html = html(page); 21 | let response = http::Response::builder() 22 | .status(http::StatusCode::OK) 23 | .body(hyper::Body::from(html)) 24 | .unwrap(); 25 | Ok(response) 26 | } 27 | -------------------------------------------------------------------------------- /crates/app/routes/organizations/_/edit/server/lib.rs: -------------------------------------------------------------------------------- 1 | use futures::FutureExt; 2 | use modelfox_app_core::error::method_not_allowed; 3 | 4 | mod get; 5 | mod page; 6 | mod post; 7 | 8 | pub fn init() -> sunfish::Route { 9 | sunfish::Route::new_dynamic(|request| match *request.method() { 10 | http::Method::GET => self::get::get(request).boxed(), 11 | http::Method::POST => self::post::post(request).boxed(), 12 | _ => async { Ok(method_not_allowed()) }.boxed(), 13 | }) 14 | } 15 | -------------------------------------------------------------------------------- /crates/app/routes/organizations/_/index/server/lib.rs: -------------------------------------------------------------------------------- 1 | use futures::FutureExt; 2 | use modelfox_app_core::error::method_not_allowed; 3 | 4 | mod get; 5 | mod page; 6 | mod post; 7 | 8 | pub fn init() -> sunfish::Route { 9 | sunfish::Route::new_dynamic(|request| match *request.method() { 10 | http::Method::GET => self::get::get(request).boxed(), 11 | http::Method::POST => self::post::post(request).boxed(), 12 | _ => async { Ok(method_not_allowed()) }.boxed(), 13 | }) 14 | } 15 | -------------------------------------------------------------------------------- /crates/app/routes/organizations/_/members/_/server/lib.rs: -------------------------------------------------------------------------------- 1 | use futures::FutureExt; 2 | use modelfox_app_core::error::method_not_allowed; 3 | 4 | mod get; 5 | mod page; 6 | mod post; 7 | 8 | pub fn init() -> sunfish::Route { 9 | sunfish::Route::new_dynamic(|request| match *request.method() { 10 | http::Method::GET => self::get::get(request).boxed(), 11 | http::Method::POST => self::post::post(request).boxed(), 12 | _ => async { Ok(method_not_allowed()) }.boxed(), 13 | }) 14 | } 15 | -------------------------------------------------------------------------------- /crates/app/routes/organizations/_/members/new/server/get.rs: -------------------------------------------------------------------------------- 1 | use crate::page::Page; 2 | use anyhow::Result; 3 | use modelfox_app_context::Context; 4 | use modelfox_app_core::error::not_found; 5 | use modelfox_app_layouts::app_layout::app_layout_info; 6 | use pinwheel::prelude::*; 7 | use std::sync::Arc; 8 | 9 | pub async fn get(request: &mut http::Request) -> Result> { 10 | let context = Arc::clone(request.extensions().get::>().unwrap()); 11 | let app = &context.app; 12 | if !app.options().auth_enabled() { 13 | return Ok(not_found()); 14 | } 15 | let app_layout_info = app_layout_info(app).await?; 16 | let page = Page { 17 | app_layout_info, 18 | error: None, 19 | }; 20 | let html = html(page); 21 | let response = http::Response::builder() 22 | .status(http::StatusCode::OK) 23 | .body(hyper::Body::from(html)) 24 | .unwrap(); 25 | Ok(response) 26 | } 27 | -------------------------------------------------------------------------------- /crates/app/routes/organizations/_/members/new/server/lib.rs: -------------------------------------------------------------------------------- 1 | use futures::FutureExt; 2 | use modelfox_app_core::error::method_not_allowed; 3 | 4 | mod get; 5 | mod page; 6 | mod post; 7 | 8 | pub fn init() -> sunfish::Route { 9 | sunfish::Route::new_dynamic(|request| match *request.method() { 10 | http::Method::GET => self::get::get(request).boxed(), 11 | http::Method::POST => self::post::post(request).boxed(), 12 | _ => async { Ok(method_not_allowed()) }.boxed(), 13 | }) 14 | } 15 | -------------------------------------------------------------------------------- /crates/app/routes/organizations/new/server/get.rs: -------------------------------------------------------------------------------- 1 | use crate::page::Page; 2 | use anyhow::Result; 3 | use modelfox_app_context::Context; 4 | use modelfox_app_layouts::app_layout::app_layout_info; 5 | use pinwheel::prelude::*; 6 | use std::sync::Arc; 7 | 8 | pub async fn get(request: &mut http::Request) -> Result> { 9 | let context = Arc::clone(request.extensions().get::>().unwrap()); 10 | let app_layout_info = app_layout_info(&context.app).await?; 11 | let page = Page { 12 | app_layout_info, 13 | error: None, 14 | }; 15 | let html = html(page); 16 | let response = http::Response::builder() 17 | .status(http::StatusCode::OK) 18 | .body(hyper::Body::from(html)) 19 | .unwrap(); 20 | Ok(response) 21 | } 22 | -------------------------------------------------------------------------------- /crates/app/routes/organizations/new/server/lib.rs: -------------------------------------------------------------------------------- 1 | use futures::FutureExt; 2 | use modelfox_app_core::error::method_not_allowed; 3 | 4 | mod get; 5 | mod page; 6 | mod post; 7 | 8 | pub fn init() -> sunfish::Route { 9 | sunfish::Route::new_dynamic(|request| match *request.method() { 10 | http::Method::GET => self::get::get(request).boxed(), 11 | http::Method::POST => self::post::post(request).boxed(), 12 | _ => async { Ok(method_not_allowed()) }.boxed(), 13 | }) 14 | } 15 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/edit/server/lib.rs: -------------------------------------------------------------------------------- 1 | use futures::FutureExt; 2 | use modelfox_app_core::error::method_not_allowed; 3 | 4 | mod get; 5 | mod page; 6 | mod post; 7 | 8 | pub fn init() -> sunfish::Route { 9 | sunfish::Route::new_dynamic(|request| match *request.method() { 10 | http::Method::GET => self::get::get(request).boxed(), 11 | http::Method::POST => self::post::post(request).boxed(), 12 | _ => async { Ok(method_not_allowed()) }.boxed(), 13 | }) 14 | } 15 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/index/server/lib.rs: -------------------------------------------------------------------------------- 1 | use futures::FutureExt; 2 | use modelfox_app_core::error::method_not_allowed; 3 | 4 | mod get; 5 | mod page; 6 | 7 | pub fn init() -> sunfish::Route { 8 | sunfish::Route::new_dynamic(|request| match *request.method() { 9 | http::Method::GET => self::get::get(request).boxed(), 10 | _ => async { Ok(method_not_allowed()) }.boxed(), 11 | }) 12 | } 13 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/alerts/_/server/lib.rs: -------------------------------------------------------------------------------- 1 | use futures::FutureExt; 2 | use modelfox_app_core::error::method_not_allowed; 3 | 4 | mod get; 5 | mod page; 6 | 7 | pub fn init() -> sunfish::Route { 8 | sunfish::Route::new_dynamic(|request| match *request.method() { 9 | http::Method::GET => self::get::get(request).boxed(), 10 | _ => async { Ok(method_not_allowed()) }.boxed(), 11 | }) 12 | } 13 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/alerts/index/server/lib.rs: -------------------------------------------------------------------------------- 1 | mod get; 2 | mod page; 3 | 4 | use futures::FutureExt; 5 | use modelfox_app_core::error::method_not_allowed; 6 | 7 | pub fn init() -> sunfish::Route { 8 | sunfish::Route::new_dynamic(|request| match *request.method() { 9 | http::Method::GET => self::get::get(request).boxed(), 10 | _ => async { Ok(method_not_allowed()) }.boxed(), 11 | }) 12 | } 13 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/download/server/lib.rs: -------------------------------------------------------------------------------- 1 | use futures::FutureExt; 2 | use modelfox_app_core::error::method_not_allowed; 3 | 4 | mod get; 5 | 6 | pub fn init() -> sunfish::Route { 7 | sunfish::Route::new_dynamic(|request| match *request.method() { 8 | http::Method::GET => self::get::get(request).boxed(), 9 | _ => async { Ok(method_not_allowed()) }.boxed(), 10 | }) 11 | } 12 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/edit/server/lib.rs: -------------------------------------------------------------------------------- 1 | use futures::FutureExt; 2 | use modelfox_app_core::error::method_not_allowed; 3 | 4 | mod get; 5 | mod page; 6 | mod post; 7 | 8 | pub fn init() -> sunfish::Route { 9 | sunfish::Route::new_dynamic(|request| match *request.method() { 10 | http::Method::GET => self::get::get(request).boxed(), 11 | http::Method::POST => self::post::post(request).boxed(), 12 | _ => async { Ok(method_not_allowed()) }.boxed(), 13 | }) 14 | } 15 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/index/client/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_app_model_index_client" 5 | 6 | authors = { workspace = true } 7 | edition = { workspace = true } 8 | homepage = { workspace = true } 9 | license = "UNLICENSED" 10 | publish = false 11 | repository = { workspace = true } 12 | version = { workspace = true } 13 | 14 | [[bin]] 15 | name = "modelfox_app_model_index_client" 16 | path = "main.rs" 17 | 18 | [dependencies] 19 | console_error_panic_hook = { workspace = true } 20 | pinwheel = { workspace = true } 21 | wasm-bindgen = { workspace = true } 22 | 23 | modelfox_charts = { workspace = true } 24 | modelfox_ui = { workspace = true } -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/index/client/main.rs: -------------------------------------------------------------------------------- 1 | use pinwheel::prelude::*; 2 | 3 | pub fn main() { 4 | modelfox_ui::client_start(); 5 | hydrate::("loss"); 6 | hydrate::("feature_importances"); 7 | } 8 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/index/server/lib.rs: -------------------------------------------------------------------------------- 1 | mod binary_classifier; 2 | mod common; 3 | mod get; 4 | mod multiclass_classifier; 5 | mod page; 6 | mod regressor; 7 | 8 | use futures::FutureExt; 9 | use modelfox_app_core::error::method_not_allowed; 10 | 11 | pub fn init() -> sunfish::Route { 12 | sunfish::Route::new_dynamic(|request| match *request.method() { 13 | http::Method::GET => self::get::get(request).boxed(), 14 | _ => async { Ok(method_not_allowed()) }.boxed(), 15 | }) 16 | } 17 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/monitors/_/edit/server/lib.rs: -------------------------------------------------------------------------------- 1 | use futures::FutureExt; 2 | use modelfox_app_core::error::method_not_allowed; 3 | 4 | mod get; 5 | mod page; 6 | mod post; 7 | 8 | pub fn init() -> sunfish::Route { 9 | sunfish::Route::new_dynamic(|request| match *request.method() { 10 | http::Method::GET => self::get::get(request).boxed(), 11 | http::Method::POST => self::post::post(request).boxed(), 12 | _ => async { Ok(method_not_allowed()) }.boxed(), 13 | }) 14 | } 15 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/monitors/index/server/lib.rs: -------------------------------------------------------------------------------- 1 | mod get; 2 | mod page; 3 | 4 | use futures::FutureExt; 5 | use modelfox_app_core::error::method_not_allowed; 6 | 7 | pub fn init() -> sunfish::Route { 8 | sunfish::Route::new_dynamic(|request| match *request.method() { 9 | http::Method::GET => self::get::get(request).boxed(), 10 | _ => async { Ok(method_not_allowed()) }.boxed(), 11 | }) 12 | } 13 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/monitors/new/client/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_app_new_monitor_client" 5 | 6 | authors = { workspace = true } 7 | edition = { workspace = true } 8 | homepage = { workspace = true } 9 | license = "UNLICENSED" 10 | publish = false 11 | repository = { workspace = true } 12 | version = { workspace = true } 13 | 14 | [[bin]] 15 | name = "modelfox_app_new_monitor_client" 16 | path = "main.rs" 17 | 18 | [dependencies] 19 | modelfox_ui = { workspace = true } 20 | web-sys = { workspace = true } 21 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/monitors/new/client/main.rs: -------------------------------------------------------------------------------- 1 | use modelfox_ui as ui; 2 | 3 | pub fn main() { 4 | modelfox_ui::client_start(); 5 | ui::boot_file_fields(); 6 | } 7 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/monitors/new/server/lib.rs: -------------------------------------------------------------------------------- 1 | use futures::FutureExt; 2 | use modelfox_app_core::error::method_not_allowed; 3 | 4 | mod get; 5 | mod page; 6 | mod post; 7 | 8 | pub fn init() -> sunfish::Route { 9 | sunfish::Route::new_dynamic(|request| match *request.method() { 10 | http::Method::GET => self::get::get(request).boxed(), 11 | http::Method::POST => self::post::post(request).boxed(), 12 | _ => async { Ok(method_not_allowed()) }.boxed(), 13 | }) 14 | } 15 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/playground/client/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_app_playground_client" 5 | 6 | authors = { workspace = true } 7 | edition = { workspace = true } 8 | homepage = { workspace = true } 9 | license = "UNLICENSED" 10 | publish = false 11 | repository = { workspace = true } 12 | version = { workspace = true } 13 | 14 | [[bin]] 15 | name = "modelfox_app_playground_client" 16 | path = "main.rs" 17 | 18 | [dependencies] 19 | pinwheel = { workspace = true } 20 | wasm-bindgen = { workspace = true } 21 | web-sys = { workspace = true } 22 | 23 | modelfox_charts = { workspace = true } 24 | modelfox_ui = { workspace = true } 25 | 26 | modelfox_app_playground_common = { path = "../common" } -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/playground/common/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_app_playground_common" 5 | 6 | authors = { workspace = true } 7 | edition = { workspace = true } 8 | homepage = { workspace = true } 9 | license = "UNLICENSED" 10 | publish = false 11 | repository = { workspace = true } 12 | version = { workspace = true } 13 | 14 | [lib] 15 | path = "lib.rs" 16 | 17 | [dependencies] 18 | pinwheel = { workspace = true } 19 | serde = { workspace = true } 20 | 21 | modelfox_charts = { workspace = true } 22 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/playground/common/lib.rs: -------------------------------------------------------------------------------- 1 | use modelfox_charts::components::{BarChart, BoxChart}; 2 | use pinwheel::prelude::*; 3 | 4 | #[derive(serde::Serialize, serde::Deserialize)] 5 | #[serde(tag = "type")] 6 | pub enum ColumnChart { 7 | #[serde(rename = "bar")] 8 | Bar(BarChart), 9 | #[serde(rename = "box")] 10 | Box(BoxChart), 11 | } 12 | 13 | impl Component for ColumnChart { 14 | fn into_node(self) -> Node { 15 | let chart = match self { 16 | ColumnChart::Bar(bar_chart) => bar_chart.into_node(), 17 | ColumnChart::Box(box_chart) => box_chart.into_node(), 18 | }; 19 | div() 20 | .class("predict-column-chart-wrapper") 21 | .child(chart) 22 | .into_node() 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/playground/server/lib.rs: -------------------------------------------------------------------------------- 1 | use futures::FutureExt; 2 | use modelfox_app_core::error::method_not_allowed; 3 | 4 | mod get; 5 | mod page; 6 | 7 | pub fn init() -> sunfish::Route { 8 | sunfish::Route::new_dynamic(|request| match *request.method() { 9 | http::Method::GET => self::get::get(request).boxed(), 10 | _ => async { Ok(method_not_allowed()) }.boxed(), 11 | }) 12 | } 13 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/playground/server/page.css: -------------------------------------------------------------------------------- 1 | .predict-output-wrapper { 2 | display: grid; 3 | grid: auto / 1fr 1fr; 4 | gap: 1rem; 5 | } 6 | 7 | .predict-form-grid { 8 | display: grid; 9 | grid: auto / 1fr 20%; 10 | align-content: center; 11 | align-items: center; 12 | gap: 1rem; 13 | } 14 | 15 | @media (max-width: 1023px) { 16 | .predict-form-grid { 17 | grid: auto / minmax(0, 1fr); 18 | } 19 | } 20 | 21 | @media (max-width: 1023px) { 22 | .predict-column-chart-wrapper { 23 | display: none; 24 | } 25 | } 26 | 27 | .predict-field-wrapper { 28 | display: grid; 29 | gap: 0.5rem; 30 | } 31 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/production_metrics/class_metrics/client/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_app_production_class_metrics_client" 5 | 6 | authors = { workspace = true } 7 | edition = { workspace = true } 8 | homepage = { workspace = true } 9 | license = "UNLICENSED" 10 | publish = false 11 | repository = { workspace = true } 12 | version = { workspace = true } 13 | 14 | [[bin]] 15 | name = "modelfox_app_production_class_metrics_client" 16 | path = "main.rs" 17 | 18 | [dependencies] 19 | pinwheel = { workspace = true } 20 | 21 | modelfox_charts = { workspace = true } 22 | modelfox_ui = { workspace = true } 23 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/production_metrics/class_metrics/client/main.rs: -------------------------------------------------------------------------------- 1 | use modelfox_ui as ui; 2 | use pinwheel::prelude::*; 3 | 4 | pub fn main() { 5 | modelfox_ui::client_start(); 6 | ui::select_field_submit_on_change("date_window_select_field".to_owned()); 7 | ui::select_field_submit_on_change("class_select_field".to_owned()); 8 | hydrate::("precision_intervals"); 9 | hydrate::("recall_intervals"); 10 | hydrate::("f1_intervals"); 11 | } 12 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/production_metrics/class_metrics/server/lib.rs: -------------------------------------------------------------------------------- 1 | use futures::FutureExt; 2 | use modelfox_app_core::error::method_not_allowed; 3 | 4 | mod get; 5 | mod page; 6 | 7 | pub fn init() -> sunfish::Route { 8 | sunfish::Route::new_dynamic(|request| match *request.method() { 9 | http::Method::GET => self::get::get(request).boxed(), 10 | _ => async { Ok(method_not_allowed()) }.boxed(), 11 | }) 12 | } 13 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/production_metrics/index/client/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_app_production_metrics_index_client" 5 | 6 | authors = { workspace = true } 7 | edition = { workspace = true } 8 | homepage = { workspace = true } 9 | license = "UNLICENSED" 10 | publish = false 11 | repository = { workspace = true } 12 | version = { workspace = true } 13 | 14 | [[bin]] 15 | name = "modelfox_app_production_metrics_index_client" 16 | path = "main.rs" 17 | 18 | [dependencies] 19 | pinwheel = { workspace = true } 20 | web-sys = { workspace = true } 21 | 22 | modelfox_charts = { workspace = true } 23 | modelfox_ui = { workspace = true } -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/production_metrics/index/client/main.rs: -------------------------------------------------------------------------------- 1 | use modelfox_ui as ui; 2 | use pinwheel::prelude::*; 3 | use web_sys as dom; 4 | 5 | pub fn main() { 6 | modelfox_ui::client_start(); 7 | ui::select_field_submit_on_change("date_window_select_field".to_owned()); 8 | let window = dom::window().unwrap(); 9 | let document = window.document().unwrap(); 10 | if document.get_element_by_id("mse").is_some() { 11 | hydrate::("mse"); 12 | } 13 | if document.get_element_by_id("accuracy").is_some() { 14 | hydrate::("accuracy"); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/production_metrics/index/server/lib.rs: -------------------------------------------------------------------------------- 1 | use futures::FutureExt; 2 | use modelfox_app_core::error::method_not_allowed; 3 | 4 | mod binary_classifier; 5 | mod get; 6 | mod multiclass_classifier; 7 | mod page; 8 | mod regressor; 9 | 10 | pub fn init() -> sunfish::Route { 11 | sunfish::Route::new_dynamic(|request| match *request.method() { 12 | http::Method::GET => self::get::get(request).boxed(), 13 | _ => async { Ok(method_not_allowed()) }.boxed(), 14 | }) 15 | } 16 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/production_predictions/index/server/lib.rs: -------------------------------------------------------------------------------- 1 | use futures::FutureExt; 2 | use modelfox_app_core::error::method_not_allowed; 3 | 4 | mod get; 5 | mod page; 6 | mod post; 7 | 8 | pub fn init() -> sunfish::Route { 9 | sunfish::Route::new_dynamic(|request| match *request.method() { 10 | http::Method::GET => self::get::get(request).boxed(), 11 | http::Method::POST => self::post::post(request).boxed(), 12 | _ => async { Ok(method_not_allowed()) }.boxed(), 13 | }) 14 | } 15 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/production_predictions/index/server/page.css: -------------------------------------------------------------------------------- 1 | .search-bar-wrapper { 2 | display: grid; 3 | grid: auto / 1fr auto; 4 | gap: 2rem; 5 | align-items: end; 6 | } 7 | 8 | .pagination-buttons { 9 | display: grid; 10 | grid: auto / auto auto auto; 11 | justify-content: center; 12 | align-items: center; 13 | gap: 2rem; 14 | } 15 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/production_predictions/predictions/_/client/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_app_production_prediction_client" 5 | 6 | authors = { workspace = true } 7 | edition = { workspace = true } 8 | homepage = { workspace = true } 9 | license = "UNLICENSED" 10 | publish = false 11 | repository = { workspace = true } 12 | version = { workspace = true } 13 | 14 | [[bin]] 15 | name = "modelfox_app_production_prediction_client" 16 | path = "main.rs" 17 | 18 | [dependencies] 19 | pinwheel = { workspace = true } 20 | web-sys = { workspace = true } 21 | 22 | modelfox_charts = { workspace = true } 23 | modelfox_ui = { workspace = true } -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/production_predictions/predictions/_/server/lib.rs: -------------------------------------------------------------------------------- 1 | use futures::FutureExt; 2 | use modelfox_app_core::error::method_not_allowed; 3 | 4 | mod get; 5 | mod page; 6 | 7 | pub fn init() -> sunfish::Route { 8 | sunfish::Route::new_dynamic(|request| match *request.method() { 9 | http::Method::GET => self::get::get(request).boxed(), 10 | _ => async { Ok(method_not_allowed()) }.boxed(), 11 | }) 12 | } 13 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/production_stats/columns/_/client/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_app_production_stats_column_client" 5 | 6 | authors = { workspace = true } 7 | edition = { workspace = true } 8 | homepage = { workspace = true } 9 | license = "UNLICENSED" 10 | publish = false 11 | repository = { workspace = true } 12 | version = { workspace = true } 13 | 14 | [[bin]] 15 | name = "modelfox_app_production_stats_column_client" 16 | path = "main.rs" 17 | 18 | [dependencies] 19 | pinwheel = { workspace = true } 20 | web-sys = { workspace = true } 21 | 22 | modelfox_charts = { workspace = true } 23 | modelfox_ui = { workspace = true } -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/production_stats/columns/_/server/lib.rs: -------------------------------------------------------------------------------- 1 | pub use enum_column::{ 2 | EnumColumnInvalidValuesSection, EnumColumnOverallHistogramEntry, EnumColumnStatsSection, 3 | EnumColumnUniqueValuesSection, EnumInvalidValuesTable, EnumInvalidValuesTableRow, 4 | EnumUniqueValuesTable, EnumUniqueValuesTableRow, 5 | }; 6 | use futures::FutureExt; 7 | use modelfox_app_core::error::method_not_allowed; 8 | 9 | mod enum_column; 10 | mod get; 11 | mod number_column; 12 | mod page; 13 | mod text_column; 14 | 15 | pub fn init() -> sunfish::Route { 16 | sunfish::Route::new_dynamic(|request| match *request.method() { 17 | http::Method::GET => self::get::get(request).boxed(), 18 | _ => async { Ok(method_not_allowed()) }.boxed(), 19 | }) 20 | } 21 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/production_stats/index/client/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_app_production_stats_index_client" 5 | 6 | authors = { workspace = true } 7 | edition = { workspace = true } 8 | homepage = { workspace = true } 9 | license = "UNLICENSED" 10 | publish = false 11 | repository = { workspace = true } 12 | version = { workspace = true } 13 | 14 | [[bin]] 15 | name = "modelfox_app_production_stats_index_client" 16 | path = "main.rs" 17 | 18 | [dependencies] 19 | pinwheel = { workspace = true } 20 | web-sys = { workspace = true } 21 | 22 | modelfox_charts = { workspace = true } 23 | modelfox_ui = { workspace = true } -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/production_stats/index/server/lib.rs: -------------------------------------------------------------------------------- 1 | pub use self::common::{ColumnStatsTable, ColumnStatsTableRow}; 2 | 3 | mod binary_classifier; 4 | mod common; 5 | mod get; 6 | mod multiclass_classifier; 7 | mod page; 8 | mod regressor; 9 | 10 | use futures::FutureExt; 11 | use modelfox_app_core::error::method_not_allowed; 12 | 13 | pub fn init() -> sunfish::Route { 14 | sunfish::Route::new_dynamic(|request| match *request.method() { 15 | http::Method::GET => self::get::get(request).boxed(), 16 | _ => async { Ok(method_not_allowed()) }.boxed(), 17 | }) 18 | } 19 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/training_grid/common/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_app_training_grid_common" 5 | 6 | authors = { workspace = true } 7 | edition = { workspace = true } 8 | homepage = { workspace = true } 9 | license = "UNLICENSED" 10 | publish = false 11 | repository = { workspace = true } 12 | version = { workspace = true } 13 | 14 | [lib] 15 | path = "lib.rs" 16 | 17 | [dependencies] 18 | anyhow = { workspace = true } 19 | http = { workspace = true } 20 | hyper = { workspace = true } 21 | num = { workspace = true } 22 | pinwheel = { workspace = true } 23 | 24 | modelfox_charts = { workspace = true } 25 | modelfox_core = { workspace = true } 26 | modelfox_id = { workspace = true } 27 | modelfox_model = { workspace = true } 28 | modelfox_ui = { workspace = true } 29 | 30 | modelfox_app_core = { path = "../../../../../../../core" } -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/training_grid/grid_item/_/server/lib.rs: -------------------------------------------------------------------------------- 1 | use futures::FutureExt; 2 | use modelfox_app_core::error::method_not_allowed; 3 | 4 | mod get; 5 | mod page; 6 | 7 | pub fn init() -> sunfish::Route { 8 | sunfish::Route::new_dynamic(|request| match *request.method() { 9 | http::Method::GET => self::get::get(request).boxed(), 10 | _ => async { Ok(method_not_allowed()) }.boxed(), 11 | }) 12 | } 13 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/training_grid/index/server/lib.rs: -------------------------------------------------------------------------------- 1 | use futures::FutureExt; 2 | use modelfox_app_core::error::method_not_allowed; 3 | 4 | mod get; 5 | mod page; 6 | 7 | pub fn init() -> sunfish::Route { 8 | sunfish::Route::new_dynamic(|request| match *request.method() { 9 | http::Method::GET => self::get::get(request).boxed(), 10 | _ => async { Ok(method_not_allowed()) }.boxed(), 11 | }) 12 | } 13 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/training_metrics/class_metrics/client/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_app_training_class_metrics_client" 5 | 6 | authors = { workspace = true } 7 | edition = { workspace = true } 8 | homepage = { workspace = true } 9 | license = "UNLICENSED" 10 | publish = false 11 | repository = { workspace = true } 12 | version = { workspace = true } 13 | 14 | [[bin]] 15 | name = "modelfox_app_training_class_metrics_client" 16 | path = "main.rs" 17 | 18 | [dependencies] 19 | modelfox_ui = { workspace = true } 20 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/training_metrics/class_metrics/client/main.rs: -------------------------------------------------------------------------------- 1 | use modelfox_ui as ui; 2 | 3 | pub fn main() { 4 | modelfox_ui::client_start(); 5 | ui::select_field_submit_on_change("class_select_field".to_owned()); 6 | } 7 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/training_metrics/class_metrics/server/lib.rs: -------------------------------------------------------------------------------- 1 | use futures::FutureExt; 2 | use modelfox_app_core::error::method_not_allowed; 3 | 4 | mod get; 5 | mod page; 6 | 7 | pub fn init() -> sunfish::Route { 8 | sunfish::Route::new_dynamic(|request| match *request.method() { 9 | http::Method::GET => self::get::get(request).boxed(), 10 | _ => async { Ok(method_not_allowed()) }.boxed(), 11 | }) 12 | } 13 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/training_metrics/index/server/lib.rs: -------------------------------------------------------------------------------- 1 | use futures::FutureExt; 2 | use modelfox_app_core::error::method_not_allowed; 3 | 4 | mod binary_classifier; 5 | mod get; 6 | mod multiclass_classifier; 7 | mod page; 8 | mod regressor; 9 | 10 | pub fn init() -> sunfish::Route { 11 | sunfish::Route::new_dynamic(|request| match *request.method() { 12 | http::Method::GET => self::get::get(request).boxed(), 13 | _ => async { Ok(method_not_allowed()) }.boxed(), 14 | }) 15 | } 16 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/training_metrics/precision_recall/client/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_app_training_metrics_precision_recall_client" 5 | 6 | authors = { workspace = true } 7 | edition = { workspace = true } 8 | homepage = { workspace = true } 9 | license = "UNLICENSED" 10 | publish = false 11 | repository = { workspace = true } 12 | version = { workspace = true } 13 | 14 | [[bin]] 15 | name = "modelfox_app_training_metrics_precision_recall_client" 16 | path = "main.rs" 17 | 18 | [dependencies] 19 | pinwheel = { workspace = true } 20 | 21 | modelfox_charts = { workspace = true } 22 | modelfox_ui = { workspace = true } 23 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/training_metrics/precision_recall/client/main.rs: -------------------------------------------------------------------------------- 1 | use pinwheel::prelude::*; 2 | 3 | pub fn main() { 4 | modelfox_ui::client_start(); 5 | hydrate::("parametric_pr"); 6 | hydrate::("non_parametric_pr"); 7 | } 8 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/training_metrics/precision_recall/server/lib.rs: -------------------------------------------------------------------------------- 1 | use futures::FutureExt; 2 | use modelfox_app_core::error::method_not_allowed; 3 | 4 | mod get; 5 | mod page; 6 | 7 | pub fn init() -> sunfish::Route { 8 | sunfish::Route::new_dynamic(|request| match *request.method() { 9 | http::Method::GET => self::get::get(request).boxed(), 10 | _ => async { Ok(method_not_allowed()) }.boxed(), 11 | }) 12 | } 13 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/training_metrics/roc/client/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_app_training_metrics_roc_client" 5 | 6 | authors = { workspace = true } 7 | edition = { workspace = true } 8 | homepage = { workspace = true } 9 | license = "UNLICENSED" 10 | publish = false 11 | repository = { workspace = true } 12 | version = { workspace = true } 13 | 14 | [[bin]] 15 | name = "modelfox_app_training_metrics_roc_client" 16 | path = "main.rs" 17 | 18 | [dependencies] 19 | pinwheel = { workspace = true } 20 | 21 | modelfox_charts = { workspace = true } 22 | modelfox_ui = { workspace = true } 23 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/training_metrics/roc/client/main.rs: -------------------------------------------------------------------------------- 1 | use pinwheel::prelude::*; 2 | 3 | pub fn main() { 4 | modelfox_ui::client_start(); 5 | hydrate::("roc"); 6 | } 7 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/training_metrics/roc/server/lib.rs: -------------------------------------------------------------------------------- 1 | use futures::FutureExt; 2 | use modelfox_app_core::error::method_not_allowed; 3 | 4 | mod get; 5 | mod page; 6 | 7 | pub fn init() -> sunfish::Route { 8 | sunfish::Route::new_dynamic(|request| match *request.method() { 9 | http::Method::GET => self::get::get(request).boxed(), 10 | _ => async { Ok(method_not_allowed()) }.boxed(), 11 | }) 12 | } 13 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/training_stats/columns/_/client/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_app_training_stats_column_client" 5 | 6 | authors = { workspace = true } 7 | edition = { workspace = true } 8 | homepage = { workspace = true } 9 | license = "UNLICENSED" 10 | publish = false 11 | repository = { workspace = true } 12 | version = { workspace = true } 13 | 14 | [[bin]] 15 | name = "modelfox_app_training_stats_column_client" 16 | path = "main.rs" 17 | 18 | [dependencies] 19 | console_error_panic_hook = { workspace = true } 20 | pinwheel = { workspace = true } 21 | wasm-bindgen = { workspace = true } 22 | web-sys = { workspace = true } 23 | 24 | modelfox_charts = { workspace = true } 25 | modelfox_ui = { workspace = true } -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/training_stats/columns/_/client/main.rs: -------------------------------------------------------------------------------- 1 | use pinwheel::prelude::*; 2 | use web_sys as dom; 3 | 4 | pub fn main() { 5 | modelfox_ui::client_start(); 6 | let window = dom::window().unwrap(); 7 | let document = window.document().unwrap(); 8 | if document.get_element_by_id("enum_histogram").is_some() { 9 | hydrate::("enum_histogram"); 10 | } 11 | if document.get_element_by_id("number_quantiles").is_some() { 12 | hydrate::("number_quantiles"); 13 | } 14 | if document.get_element_by_id("number_histogram").is_some() { 15 | hydrate::("number_histogram"); 16 | } 17 | if document.get_element_by_id("ngram_histogram").is_some() { 18 | hydrate::("ngram_histogram"); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/training_stats/columns/_/server/lib.rs: -------------------------------------------------------------------------------- 1 | mod enum_column; 2 | mod get; 3 | mod number_column; 4 | mod page; 5 | mod text_column; 6 | 7 | use futures::FutureExt; 8 | use modelfox_app_core::error::method_not_allowed; 9 | 10 | pub fn init() -> sunfish::Route { 11 | sunfish::Route::new_dynamic(|request| match *request.method() { 12 | http::Method::GET => self::get::get(request).boxed(), 13 | _ => async { Ok(method_not_allowed()) }.boxed(), 14 | }) 15 | } 16 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/training_stats/index/server/lib.rs: -------------------------------------------------------------------------------- 1 | use futures::FutureExt; 2 | use modelfox_app_core::error::method_not_allowed; 3 | 4 | mod get; 5 | mod page; 6 | 7 | pub fn init() -> sunfish::Route { 8 | sunfish::Route::new_dynamic(|request| match *request.method() { 9 | http::Method::GET => self::get::get(request).boxed(), 10 | _ => async { Ok(method_not_allowed()) }.boxed(), 11 | }) 12 | } 13 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/tuning/client/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_app_tuning_client" 5 | 6 | authors = { workspace = true } 7 | edition = { workspace = true } 8 | homepage = { workspace = true } 9 | license = "UNLICENSED" 10 | publish = false 11 | repository = { workspace = true } 12 | version = { workspace = true } 13 | 14 | [[bin]] 15 | name = "modelfox_app_tuning_client" 16 | path = "main.rs" 17 | 18 | [dependencies] 19 | pinwheel = { workspace = true } 20 | web-sys = { workspace = true } 21 | 22 | modelfox_ui = { workspace = true } 23 | 24 | modelfox_app_tuning_common = { path = "../common" } -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/tuning/client/main.rs: -------------------------------------------------------------------------------- 1 | use pinwheel::prelude::*; 2 | 3 | pub fn main() { 4 | modelfox_ui::client_start(); 5 | hydrate::("tuning"); 6 | } 7 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/tuning/common/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_app_tuning_common" 5 | 6 | authors = { workspace = true } 7 | edition = { workspace = true } 8 | homepage = { workspace = true } 9 | license = "UNLICENSED" 10 | publish = false 11 | repository = { workspace = true } 12 | version = { workspace = true } 13 | 14 | [lib] 15 | path = "lib.rs" 16 | 17 | [dependencies] 18 | num = { workspace = true } 19 | pinwheel = { workspace = true } 20 | serde = { workspace = true } 21 | serde_json = { workspace = true } 22 | tracing = { workspace = true } 23 | 24 | modelfox_ui = { workspace = true } 25 | 26 | modelfox_app_ui = { path = "../../../../../../../../app/ui" } -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/tuning/server/lib.rs: -------------------------------------------------------------------------------- 1 | use futures::FutureExt; 2 | use modelfox_app_core::error::method_not_allowed; 3 | 4 | mod get; 5 | mod page; 6 | 7 | pub fn init() -> sunfish::Route { 8 | sunfish::Route::new_dynamic(|request| match *request.method() { 9 | http::Method::GET => self::get::get(request).boxed(), 10 | _ => async { Ok(method_not_allowed()) }.boxed(), 11 | }) 12 | } 13 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/tuning/server/page.css: -------------------------------------------------------------------------------- 1 | .tuning-metrics-grid { 2 | display: grid; 3 | grid: auto auto / 1fr 1fr; 4 | gap: 1rem; 5 | } 6 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/_/tuning/server/page.rs: -------------------------------------------------------------------------------- 1 | use modelfox_app_layouts::{ 2 | document::Document, 3 | model_layout::{ModelLayout, ModelLayoutInfo}, 4 | }; 5 | use modelfox_app_tuning_common::Tuning; 6 | use modelfox_ui as ui; 7 | use pinwheel::prelude::*; 8 | 9 | pub struct Page { 10 | pub model_layout_info: ModelLayoutInfo, 11 | pub tuning: Option, 12 | } 13 | 14 | impl Component for Page { 15 | fn into_node(self) -> Node { 16 | let inner = match self.tuning { 17 | Some(tuning) => Dehydrate::new("tuning", tuning).into_node(), 18 | None => ui::S1::new() 19 | .child(ui::P::new().child("Tuning is not supported for this model.")) 20 | .into_node(), 21 | }; 22 | Document::new() 23 | .client("modelfox_app_tuning_client") 24 | .child(ModelLayout::new(self.model_layout_info).child(inner)) 25 | .into_node() 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/new/client/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_app_new_model_client" 5 | 6 | authors = { workspace = true } 7 | edition = { workspace = true } 8 | homepage = { workspace = true } 9 | license = "UNLICENSED" 10 | publish = false 11 | repository = { workspace = true } 12 | version = { workspace = true } 13 | 14 | [[bin]] 15 | name = "modelfox_app_new_model_client" 16 | path = "main.rs" 17 | 18 | [dependencies] 19 | modelfox_ui = { workspace = true } 20 | web-sys = { workspace = true } 21 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/new/client/main.rs: -------------------------------------------------------------------------------- 1 | use modelfox_ui as ui; 2 | 3 | pub fn main() { 4 | modelfox_ui::client_start(); 5 | ui::boot_file_fields(); 6 | } 7 | -------------------------------------------------------------------------------- /crates/app/routes/repos/_/models/new/server/lib.rs: -------------------------------------------------------------------------------- 1 | use futures::FutureExt; 2 | use modelfox_app_core::error::method_not_allowed; 3 | 4 | mod get; 5 | mod page; 6 | mod post; 7 | 8 | pub fn init() -> sunfish::Route { 9 | sunfish::Route::new_dynamic(|request| match *request.method() { 10 | http::Method::GET => self::get::get(request).boxed(), 11 | http::Method::POST => self::post::post(request).boxed(), 12 | _ => async { Ok(method_not_allowed()) }.boxed(), 13 | }) 14 | } 15 | -------------------------------------------------------------------------------- /crates/app/routes/repos/new/server/lib.rs: -------------------------------------------------------------------------------- 1 | use futures::FutureExt; 2 | use modelfox_app_core::error::method_not_allowed; 3 | 4 | mod get; 5 | mod page; 6 | mod post; 7 | 8 | pub fn init() -> sunfish::Route { 9 | sunfish::Route::new_dynamic(|request| match *request.method() { 10 | http::Method::GET => self::get::get(request).boxed(), 11 | http::Method::POST => self::post::post(request).boxed(), 12 | _ => async { Ok(method_not_allowed()) }.boxed(), 13 | }) 14 | } 15 | -------------------------------------------------------------------------------- /crates/app/routes/track/server/lib.rs: -------------------------------------------------------------------------------- 1 | use futures::FutureExt; 2 | use modelfox_app_core::error::method_not_allowed; 3 | 4 | mod post; 5 | 6 | pub fn init() -> sunfish::Route { 7 | sunfish::Route::new_dynamic(|request| match *request.method() { 8 | http::Method::POST => self::post::post(request).boxed(), 9 | _ => async { Ok(method_not_allowed()) }.boxed(), 10 | }) 11 | } 12 | -------------------------------------------------------------------------------- /crates/app/routes/user/server/lib.rs: -------------------------------------------------------------------------------- 1 | use futures::FutureExt; 2 | use modelfox_app_core::error::method_not_allowed; 3 | 4 | mod get; 5 | mod page; 6 | mod post; 7 | 8 | pub fn init() -> sunfish::Route { 9 | sunfish::Route::new_dynamic(|request| match *request.method() { 10 | http::Method::GET => self::get::get(request).boxed(), 11 | http::Method::POST => self::post::post(request).boxed(), 12 | _ => async { Ok(method_not_allowed()) }.boxed(), 13 | }) 14 | } 15 | -------------------------------------------------------------------------------- /crates/app/static/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modelfoxdotdev/modelfox/ec5d86b0a0557859231fd0a2cf98fa5550828f22/crates/app/static/favicon.png -------------------------------------------------------------------------------- /crates/app/static/jetbrainsmono.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modelfoxdotdev/modelfox/ec5d86b0a0557859231fd0a2cf98fa5550828f22/crates/app/static/jetbrainsmono.woff2 -------------------------------------------------------------------------------- /crates/app/ui/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_app_ui" 5 | 6 | authors = { workspace = true } 7 | edition = { workspace = true } 8 | homepage = { workspace = true } 9 | license = "UNLICENSED" 10 | publish = false 11 | repository = { workspace = true } 12 | version = { workspace = true } 13 | 14 | [lib] 15 | path = "lib.rs" 16 | 17 | [dependencies] 18 | chrono = { workspace = true } 19 | chrono-tz = { workspace = true } 20 | num = { workspace = true } 21 | pinwheel = { workspace = true } 22 | serde = { workspace = true } 23 | 24 | modelfox_model = { workspace = true } 25 | modelfox_charts = { workspace = true } 26 | modelfox_core = { workspace = true } 27 | modelfox_ui = { workspace = true } 28 | 29 | modelfox_app_date_window = { path = "../date_window" } -------------------------------------------------------------------------------- /crates/app/ui/class_select_field.rs: -------------------------------------------------------------------------------- 1 | use modelfox_ui as ui; 2 | use pinwheel::prelude::*; 3 | 4 | pub struct ClassSelectField { 5 | pub class: String, 6 | pub classes: Vec, 7 | } 8 | 9 | impl Component for ClassSelectField { 10 | fn into_node(self) -> Node { 11 | let options = self 12 | .classes 13 | .iter() 14 | .map(|class_name| ui::SelectFieldOption { 15 | text: class_name.clone(), 16 | value: class_name.clone(), 17 | }) 18 | .collect::>(); 19 | ui::SelectField::new() 20 | .id("class_select_field".to_owned()) 21 | .label("Select Class".to_owned()) 22 | .name("class".to_owned()) 23 | .options(options) 24 | .value(self.class) 25 | .into_node() 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /crates/app/ui/colors.rs: -------------------------------------------------------------------------------- 1 | pub use modelfox_ui as ui; 2 | 3 | pub const TRAINING_COLOR: &str = ui::colors::BLUE; 4 | pub const PRODUCTION_COLOR: &str = ui::colors::GREEN; 5 | pub const BASELINE_COLOR: &str = ui::colors::GRAY; 6 | pub const SELECTED_THRESHOLD_COLOR: &str = ui::colors::BLUE; 7 | -------------------------------------------------------------------------------- /crates/app/ui/column_type.rs: -------------------------------------------------------------------------------- 1 | #[derive(PartialEq, Eq, Clone, Copy)] 2 | pub enum ColumnType { 3 | Unknown, 4 | Number, 5 | Enum, 6 | Text, 7 | } 8 | -------------------------------------------------------------------------------- /crates/app/ui/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod class_select_field; 2 | pub mod colors; 3 | pub mod column_type; 4 | pub mod date_window_select_field; 5 | pub mod logo; 6 | pub mod metrics_row; 7 | pub mod page_heading; 8 | pub mod pagination; 9 | pub mod predict; 10 | pub mod time; 11 | pub mod tokens; 12 | pub mod topbar; 13 | -------------------------------------------------------------------------------- /crates/app/ui/metrics_row.css: -------------------------------------------------------------------------------- 1 | .metrics-row { 2 | display: grid; 3 | gap: 1rem; 4 | } 5 | 6 | @media (min-width: 1024px) { 7 | .metrics-row { 8 | grid-auto-flow: column; 9 | } 10 | } 11 | 12 | @media (max-width: 1023px) { 13 | .metrics-row { 14 | grid-auto-flow: row; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /crates/app/ui/metrics_row.rs: -------------------------------------------------------------------------------- 1 | use pinwheel::prelude::*; 2 | 3 | #[derive(children, Default, new)] 4 | #[new(default)] 5 | pub struct MetricsRow { 6 | pub children: Vec, 7 | } 8 | 9 | impl Component for MetricsRow { 10 | fn into_node(self) -> Node { 11 | div().class("metrics-row").child(self.children).into_node() 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /crates/app/ui/page_heading.css: -------------------------------------------------------------------------------- 1 | .page-heading { 2 | align-items: center; 3 | display: grid; 4 | } 5 | 6 | @media (max-width: 1023px) { 7 | .page-heading { 8 | grid-auto-flow: row; 9 | row-gap: 1rem; 10 | } 11 | } 12 | 13 | @media (min-width: 1024px) { 14 | .page-heading { 15 | justify-content: space-between; 16 | min-height: 2.5rem; 17 | grid-auto-flow: column; 18 | } 19 | } 20 | 21 | .page-heading-buttons { 22 | display: grid; 23 | } 24 | 25 | @media (max-width: 1023px) { 26 | .page-heading-buttons { 27 | grid-auto-flow: row; 28 | row-gap: 1rem; 29 | } 30 | } 31 | 32 | @media (min-width: 1024px) { 33 | .page-heading-buttons { 34 | grid-auto-flow: column; 35 | column-gap: 1rem; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /crates/app/ui/page_heading.rs: -------------------------------------------------------------------------------- 1 | use pinwheel::prelude::*; 2 | 3 | #[derive(children, Default, new)] 4 | #[new(default)] 5 | pub struct PageHeading { 6 | pub children: Vec, 7 | } 8 | 9 | impl Component for PageHeading { 10 | fn into_node(self) -> Node { 11 | div().class("page-heading").child(self.children).into_node() 12 | } 13 | } 14 | 15 | #[derive(children, Default, new)] 16 | #[new(default)] 17 | pub struct PageHeadingButtons { 18 | pub children: Vec, 19 | } 20 | 21 | impl Component for PageHeadingButtons { 22 | fn into_node(self) -> Node { 23 | div() 24 | .class("page-heading-buttons") 25 | .child(self.children) 26 | .into_node() 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /crates/app/ui/pagination.css: -------------------------------------------------------------------------------- 1 | .offset-pagination-buttons { 2 | display: grid; 3 | grid: auto / auto auto auto auto; 4 | justify-content: center; 5 | align-items: center; 6 | gap: 2rem; 7 | } 8 | -------------------------------------------------------------------------------- /crates/charts/lib.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::pedantic)] 2 | #![allow(clippy::module_name_repetitions)] 3 | 4 | pub mod bar_chart; 5 | pub mod box_chart; 6 | pub mod chart; 7 | pub mod common; 8 | pub mod components; 9 | pub mod config; 10 | pub mod feature_contributions_chart; 11 | pub mod line_chart; 12 | mod tooltip; 13 | -------------------------------------------------------------------------------- /crates/cli/migrate.rs: -------------------------------------------------------------------------------- 1 | use crate::{app::default_database_url, MigrateArgs}; 2 | use anyhow::Result; 3 | 4 | pub fn migrate(args: MigrateArgs) -> Result<()> { 5 | let database_url = match args.database_url { 6 | Some(database_url) => database_url.parse()?, 7 | None => default_database_url(), 8 | }; 9 | modelfox_app_core::migrate(database_url) 10 | } 11 | -------------------------------------------------------------------------------- /crates/core/heuristics.rs: -------------------------------------------------------------------------------- 1 | pub const MIN_TRAIN_ROWS: usize = 35; 2 | pub const MIN_TEST_ROWS: usize = 10; 3 | pub const MIN_COMPARISON_ROWS: usize = 5; 4 | -------------------------------------------------------------------------------- /crates/core/lib.rs: -------------------------------------------------------------------------------- 1 | mod config; 2 | mod features; 3 | mod grid; 4 | pub mod heuristics; 5 | pub mod model; 6 | pub mod predict; 7 | pub mod progress; 8 | mod stats; 9 | mod test; 10 | pub mod train; 11 | -------------------------------------------------------------------------------- /crates/dev/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_dev" 5 | 6 | authors = { workspace = true } 7 | documentation = { workspace = true } 8 | edition = { workspace = true } 9 | homepage = { workspace = true } 10 | license = { workspace = true } 11 | publish = false 12 | repository = { workspace = true } 13 | version = { workspace = true } 14 | 15 | [[bin]] 16 | name = "modelfox_dev" 17 | path = "main.rs" 18 | 19 | [dependencies] 20 | clap = { workspace = true } 21 | sunfish = { workspace = true } 22 | tokio = { workspace = true } 23 | -------------------------------------------------------------------------------- /crates/features/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_features" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = true 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [lib] 17 | path = "lib.rs" 18 | 19 | [dependencies] 20 | anyhow = { workspace = true } 21 | fnv = { workspace = true } 22 | indexmap = { workspace = true } 23 | itertools = { workspace = true } 24 | ndarray = { workspace = true } 25 | num = { workspace = true } 26 | serde = { workspace = true } 27 | 28 | modelfox_metrics = { workspace = true } 29 | modelfox_table = { workspace = true } 30 | modelfox_text = { workspace = true } 31 | modelfox_zip = { workspace = true } 32 | -------------------------------------------------------------------------------- /crates/finite/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_finite" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = true 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [lib] 17 | path = "lib.rs" 18 | 19 | [dependencies] 20 | num = { workspace = true } 21 | serde = { workspace = true } 22 | -------------------------------------------------------------------------------- /crates/id/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_id" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = true 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [lib] 17 | path = "lib.rs" 18 | 19 | [dependencies] 20 | rand = { workspace = true } 21 | serde = { workspace = true } 22 | -------------------------------------------------------------------------------- /crates/kill_chip/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_kill_chip" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = true 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [lib] 17 | path = "lib.rs" 18 | -------------------------------------------------------------------------------- /crates/kill_chip/lib.rs: -------------------------------------------------------------------------------- 1 | #![warn(clippy::pedantic)] 2 | 3 | use std::sync::atomic::{AtomicBool, Ordering}; 4 | 5 | pub struct KillChip(AtomicBool); 6 | 7 | impl KillChip { 8 | #[must_use] 9 | pub const fn new() -> Self { 10 | KillChip(AtomicBool::new(false)) 11 | } 12 | 13 | pub fn activate(&self) -> bool { 14 | self.0.swap(true, Ordering::SeqCst) 15 | } 16 | 17 | pub fn is_activated(&self) -> bool { 18 | self.0.load(Ordering::SeqCst) 19 | } 20 | } 21 | 22 | impl Default for KillChip { 23 | fn default() -> Self { 24 | KillChip(AtomicBool::new(false)) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /crates/license/license.public.rsa: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PUBLIC KEY----- 2 | MIIBCgKCAQEAq+JphywG8wCe6cX+bx4xKH8xphMhaI5BgYefQHUXwp8xavoor6Fy 3 | B54yZba/pkfTnao+P9BvPT0PlSJ1L9aGzq45lcQCcaT+ZdPC5qUogTrKu4eB2qSj 4 | yTt5pGnPsna+/7yh2sDhC/SHMvTPKt4oHgobWYkH3/039Rj7z5X2WGq69gJzSknX 5 | /lraNlVUqCWi3yCnMP9QOV5Tou5gQi4nxlfEJO3razrif5jHw1NufQ+xpx1GCpN9 6 | WhFBU2R4GFZsxlEXV9g1Os1ZpyVuoOe9BnenuS57TixU9SC8kFUHAyAWRSiuLjoP 7 | xAmGGm4wQ4FlMAt+Bj/K6rvdG3FJUu5ttQIDAQAB 8 | -----END RSA PUBLIC KEY----- 9 | -------------------------------------------------------------------------------- /crates/linear/benchmarks/.envrc: -------------------------------------------------------------------------------- 1 | use flake 2 | -------------------------------------------------------------------------------- /crates/linear/benchmarks/.gitignore: -------------------------------------------------------------------------------- 1 | /.direnv 2 | __pycache__ 3 | -------------------------------------------------------------------------------- /crates/linear/linear.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /crates/metrics/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_metrics" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = true 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [lib] 17 | path = "lib.rs" 18 | 19 | [dev-dependencies] 20 | insta = { workspace = true } 21 | 22 | [dependencies] 23 | itertools = { workspace = true } 24 | ndarray = { workspace = true } 25 | num = { workspace = true } 26 | 27 | modelfox_zip = { workspace = true } 28 | -------------------------------------------------------------------------------- /crates/metrics/README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 | 5 | # ModelFox Metrics 6 | 7 | This crate is documented using rustdoc. View the docs for the most recent version at https://docs.rs/modelfox_metrics or run `cargo doc -p modelfox_metrics --open` in the root of this repository. 8 | -------------------------------------------------------------------------------- /crates/metrics/accuracy.rs: -------------------------------------------------------------------------------- 1 | use super::mean::Mean; 2 | 3 | /// The accuracy is the proportion of examples where predicted == label. 4 | #[derive(Default)] 5 | pub struct Accuracy(Mean); 6 | 7 | impl Accuracy { 8 | pub fn new() -> Accuracy { 9 | Accuracy::default() 10 | } 11 | } 12 | 13 | impl Accuracy { 14 | pub fn update(&mut self, value: (usize, usize)) { 15 | self.0.update(if value.0 == value.1 { 1.0 } else { 0.0 }) 16 | } 17 | 18 | pub fn merge(&mut self, other: Accuracy) { 19 | self.0.merge(other.0) 20 | } 21 | 22 | pub fn finalize(self) -> Option { 23 | self.0.finalize() 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /crates/metrics/mean_squared_error.rs: -------------------------------------------------------------------------------- 1 | use super::mean::Mean; 2 | 3 | /// The mean squared error is the sum of squared differences between the predicted value and the label. 4 | #[derive(Default)] 5 | pub struct MeanSquaredError(Mean); 6 | 7 | impl MeanSquaredError { 8 | pub fn new() -> MeanSquaredError { 9 | MeanSquaredError::default() 10 | } 11 | } 12 | 13 | impl MeanSquaredError { 14 | pub fn update(&mut self, value: (f32, f32)) { 15 | self.0.update((value.1 - value.0).powi(2)) 16 | } 17 | 18 | pub fn merge(&mut self, other: MeanSquaredError) { 19 | self.0.merge(other.0) 20 | } 21 | 22 | pub fn finalize(self) -> Option { 23 | self.0.finalize() 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /crates/metrics/metrics.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /crates/metrics/mode.rs: -------------------------------------------------------------------------------- 1 | use std::collections::BTreeMap; 2 | 3 | #[derive(Debug, Clone, Default)] 4 | pub struct Mode(Option<(usize, usize)>); 5 | 6 | impl Mode { 7 | pub fn compute(input: &[usize]) -> Option { 8 | let mut histogram = BTreeMap::new(); 9 | for value in input.iter() { 10 | *histogram.entry(value).or_insert(0) += 1; 11 | } 12 | histogram 13 | .into_iter() 14 | .max_by(|a, b| a.1.cmp(&b.1)) 15 | .map(|label| *label.0) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /crates/model/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_model" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = true 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [lib] 17 | path = "lib.rs" 18 | 19 | [dependencies] 20 | anyhow = { workspace = true } 21 | buffalo = { workspace = true } 22 | fnv = { workspace = true } 23 | num = { workspace = true } 24 | 25 | modelfox_linear = { workspace = true } 26 | modelfox_text = { workspace = true } 27 | modelfox_tree = { workspace = true } 28 | -------------------------------------------------------------------------------- /crates/model/grid.rs: -------------------------------------------------------------------------------- 1 | use crate::ModelTrainOptions; 2 | 3 | #[derive(buffalo::Read, buffalo::Write)] 4 | #[buffalo(size = "dynamic")] 5 | pub struct TrainGridItemOutput { 6 | #[buffalo(id = 0, required)] 7 | pub hyperparameters: ModelTrainOptions, 8 | #[buffalo(id = 1, required)] 9 | pub comparison_metric_value: f32, 10 | #[buffalo(id = 2, required)] 11 | pub duration: f32, 12 | } 13 | -------------------------------------------------------------------------------- /crates/number_formatter/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_number_formatter" 5 | 6 | authors = { workspace = true } 7 | documentation = { workspace = true } 8 | edition = { workspace = true } 9 | homepage = { workspace = true } 10 | license = { workspace = true } 11 | publish = true 12 | repository = { workspace = true } 13 | version = { workspace = true } 14 | 15 | [lib] 16 | path = "lib.rs" 17 | 18 | [dependencies] 19 | num = { workspace = true } 20 | serde = { workspace = true } 21 | -------------------------------------------------------------------------------- /crates/progress_counter/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_progress_counter" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = true 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [lib] 17 | path = "lib.rs" 18 | 19 | [dev-dependencies] 20 | rayon = { workspace = true } 21 | -------------------------------------------------------------------------------- /crates/serve/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_serve" 5 | 6 | authors = { workspace = true } 7 | documentation = { workspace = true } 8 | edition = { workspace = true } 9 | homepage = { workspace = true } 10 | license = { workspace = true } 11 | publish = false 12 | repository = { workspace = true } 13 | version = { workspace = true } 14 | 15 | [lib] 16 | path = "lib.rs" 17 | 18 | [dependencies] 19 | anyhow = { workspace = true } 20 | backtrace = { workspace = true } 21 | futures = { workspace = true } 22 | hyper = { workspace = true, features = ["http1", "server", "tcp"] } 23 | tokio = { workspace = true } 24 | tracing = { workspace = true } 25 | 26 | modelfox_id = { workspace = true } -------------------------------------------------------------------------------- /crates/table/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_table" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = true 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [lib] 17 | path = "lib.rs" 18 | 19 | [dev-dependencies] 20 | insta = { workspace = true } 21 | 22 | [dependencies] 23 | anyhow = { workspace = true } 24 | csv = { workspace = true } 25 | fast-float = { workspace = true } 26 | fnv = { workspace = true } 27 | ndarray = { workspace = true } 28 | num = { workspace = true } 29 | 30 | modelfox_progress_counter = { workspace = true } 31 | modelfox_zip = { workspace = true } 32 | -------------------------------------------------------------------------------- /crates/table/README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 | 5 | # ModelFox Table 6 | 7 | This crate is documented using rustdoc. View the docs for the most recent version at https://docs.rs/modelfox_table or run `cargo doc -p modelfox_table --open` in the root of this repository. 8 | -------------------------------------------------------------------------------- /crates/table/table.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /crates/text/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_text" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = true 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [lib] 17 | path = "lib.rs" 18 | 19 | [dependencies] 20 | fnv = { workspace = true } 21 | indexmap = { workspace = true } 22 | serde = { workspace = true } 23 | -------------------------------------------------------------------------------- /crates/text/lib.rs: -------------------------------------------------------------------------------- 1 | pub use self::{ 2 | ngram::{NGram, NGramRef, NGramType}, 3 | tokenizer::Tokenizer, 4 | word_embedding::WordEmbeddingModel, 5 | }; 6 | 7 | mod ngram; 8 | mod tokenizer; 9 | mod word_embedding; 10 | -------------------------------------------------------------------------------- /crates/text/text.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /crates/text/word_embedding.rs: -------------------------------------------------------------------------------- 1 | use fnv::FnvHashMap; 2 | 3 | #[derive(Clone, Debug)] 4 | pub struct WordEmbeddingModel { 5 | pub size: usize, 6 | pub words: FnvHashMap, 7 | pub values: Vec, 8 | } 9 | 10 | impl WordEmbeddingModel { 11 | /// Get the word embedding for `word` if it is present in the model. 12 | pub fn get(&self, word: &str) -> Option<&[f32]> { 13 | let index = self.words.get(word)?; 14 | let embedding = self 15 | .values 16 | .get(index * self.size..index * self.size + self.size)?; 17 | Some(embedding) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /crates/tree/README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 | 5 | # ModelFox Tree 6 | 7 | This crate is documented using rustdoc. View the docs for the most recent version at https://docs.rs/modelfox_tree or run `cargo doc -p modelfox_tree --open` in the root of this repository. 8 | -------------------------------------------------------------------------------- /crates/tree/benchmarks/.envrc: -------------------------------------------------------------------------------- 1 | use flake 2 | -------------------------------------------------------------------------------- /crates/tree/benchmarks/.gitignore: -------------------------------------------------------------------------------- 1 | /.direnv 2 | -------------------------------------------------------------------------------- /crates/tree/benchmarks/conda.yaml: -------------------------------------------------------------------------------- 1 | name: modelfox_tree_benchmarks 2 | channels: 3 | - conda-forge 4 | - h2oai 5 | dependencies: 6 | - h2o 7 | - lightgbm 8 | - numpy 9 | - openjdk 10 | - pandas 11 | - scikit-learn 12 | - xgboost 13 | - pip: 14 | - catboost 15 | -------------------------------------------------------------------------------- /crates/tree/tree.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /crates/ui/alert.css: -------------------------------------------------------------------------------- 1 | .alert-wrapper { 2 | border-radius: var(--border-radius); 3 | color: var(--fun-text-color); 4 | padding: 1rem; 5 | } 6 | 7 | .alert-level-info { 8 | background-color: var(--blue); 9 | } 10 | 11 | .alert-level-success { 12 | background-color: var(--green); 13 | } 14 | 15 | .alert-level-warning { 16 | background-color: var(--yellow); 17 | } 18 | 19 | .alert-level-danger { 20 | background-color: var(--red); 21 | } 22 | 23 | .alert-title { 24 | color: var(--fun-text-color); 25 | font-weight: bold; 26 | margin-bottom: 1rem; 27 | } 28 | 29 | .alert-text { 30 | line-height: 1.5; 31 | } 32 | -------------------------------------------------------------------------------- /crates/ui/alert.rs: -------------------------------------------------------------------------------- 1 | use pinwheel::prelude::*; 2 | 3 | #[derive(builder, children, new)] 4 | pub struct Alert { 5 | pub level: Level, 6 | #[builder] 7 | #[new(default)] 8 | pub title: Option, 9 | #[new(default)] 10 | pub children: Vec, 11 | } 12 | 13 | pub enum Level { 14 | Info, 15 | Success, 16 | Warning, 17 | Danger, 18 | } 19 | 20 | impl Component for Alert { 21 | fn into_node(self) -> Node { 22 | let level_class = match self.level { 23 | Level::Info => "alert-level-info", 24 | Level::Success => "alert-level-success", 25 | Level::Warning => "alert-level-warning", 26 | Level::Danger => "alert-level-danger", 27 | }; 28 | let title = self 29 | .title 30 | .map(|title| div().class("alert-title").child(title).into_node()); 31 | div() 32 | .class("alert-wrapper") 33 | .class(level_class) 34 | .child(title) 35 | .child(self.children) 36 | .into_node() 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /crates/ui/asciicast.css: -------------------------------------------------------------------------------- 1 | .asciicast { 2 | background-color: var(--header-color); 3 | border-radius: var(--border-radius); 4 | color: var(--text-color); 5 | font-size: 1rem; 6 | line-height: 1.5; 7 | overflow: auto; 8 | padding: 1rem; 9 | } 10 | -------------------------------------------------------------------------------- /crates/ui/avatar.css: -------------------------------------------------------------------------------- 1 | .avatar { 2 | background-color: var(--surface-color); 3 | border-radius: 50%; 4 | height: 2rem; 5 | overflow: hidden; 6 | width: 2rem; 7 | } 8 | 9 | .avatar:hover { 10 | filter: brightness(90%); 11 | } 12 | 13 | .avatar-img { 14 | border: none; 15 | height: 100%; 16 | outline: none; 17 | width: 100%; 18 | } 19 | 20 | .avatar-placeholder { 21 | background-color: var(--surface-color); 22 | height: 100%; 23 | width: 100%; 24 | } 25 | -------------------------------------------------------------------------------- /crates/ui/button.css: -------------------------------------------------------------------------------- 1 | .button { 2 | background-color: var(--accent-color); 3 | border-radius: var(--border-radius); 4 | border: none; 5 | box-sizing: border-box; 6 | color: var(--fun-text-color); 7 | cursor: pointer; 8 | display: block; 9 | font-size: 1rem; 10 | font: inherit; 11 | line-height: 1; 12 | margin: 0; 13 | outline: none; 14 | overflow: hidden; 15 | padding: 0.75rem 1rem; 16 | text-align: center; 17 | text-decoration: none; 18 | text-overflow: ellipsis; 19 | user-select: none; 20 | white-space: nowrap; 21 | width: 100%; 22 | } 23 | 24 | .button[disabled] { 25 | background-color: var(--gray); 26 | cursor: not-allowed; 27 | } 28 | 29 | .button:hover:not([disabled]) { 30 | filter: brightness(90%); 31 | } 32 | 33 | .button:focus { 34 | filter: brightness(90%); 35 | } 36 | 37 | .button:active { 38 | filter: brightness(80%); 39 | } 40 | 41 | .button::-moz-focus-inner { 42 | border: none; 43 | } 44 | -------------------------------------------------------------------------------- /crates/ui/callout.css: -------------------------------------------------------------------------------- 1 | .callout-wrapper { 2 | border-left-style: solid; 3 | border-left-width: 4px; 4 | display: grid; 5 | gap: 0.5rem; 6 | padding: 1rem; 7 | } 8 | 9 | .callout-wrapper-success { 10 | background-color: var(--surface-color); 11 | border-left-color: var(--green); 12 | } 13 | 14 | .callout-wrapper-info { 15 | background-color: var(--surface-color); 16 | border-left-color: var(--blue); 17 | } 18 | 19 | .callout-wrapper-warning { 20 | background-color: var(--surface-color); 21 | border-left-color: var(--yellow); 22 | } 23 | 24 | .callout-wrapper-danger { 25 | background-color: var(--surface-color); 26 | border-left-color: var(--red); 27 | } 28 | 29 | .callout-title { 30 | color: var(--text); 31 | font-weight: bold; 32 | } 33 | 34 | .callout-inner { 35 | color: var(--text); 36 | line-height: 1.5; 37 | } 38 | -------------------------------------------------------------------------------- /crates/ui/callout.rs: -------------------------------------------------------------------------------- 1 | use crate as ui; 2 | use pinwheel::prelude::*; 3 | 4 | #[derive(builder)] 5 | pub struct Callout { 6 | pub level: ui::Level, 7 | #[builder] 8 | pub title: Option, 9 | pub children: Vec, 10 | } 11 | 12 | impl Component for Callout { 13 | fn into_node(self) -> Node { 14 | let level_class = match self.level { 15 | ui::Level::Danger => "callout-wrapper-danger", 16 | ui::Level::Info => "callout-wrapper-info", 17 | ui::Level::Warning => "callout-wrapper-warning", 18 | ui::Level::Success => "callout-wrapper-success", 19 | }; 20 | div() 21 | .class("callout-wrapper") 22 | .class(level_class) 23 | .child({ 24 | self.title 25 | .map(|title| div().class("callout-title").child(title)) 26 | }) 27 | .child(div().class("callout-inner").child(self.children)) 28 | .into_node() 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /crates/ui/card.css: -------------------------------------------------------------------------------- 1 | .card { 2 | background-color: var(--surface-color); 3 | border: var(--border); 4 | border-radius: var(--border-radius); 5 | box-sizing: border-box; 6 | padding: 1rem; 7 | } 8 | -------------------------------------------------------------------------------- /crates/ui/card.rs: -------------------------------------------------------------------------------- 1 | use pinwheel::prelude::*; 2 | 3 | #[derive(children, Default, new)] 4 | #[new(default)] 5 | pub struct Card { 6 | pub children: Vec, 7 | } 8 | 9 | impl Component for Card { 10 | fn into_node(self) -> Node { 11 | div().class("card").child(self.children).into_node() 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /crates/ui/details.rs: -------------------------------------------------------------------------------- 1 | use pinwheel::prelude::*; 2 | 3 | #[derive(builder)] 4 | pub struct Details { 5 | pub options: Vec, 6 | pub summary: Option, 7 | } 8 | 9 | pub struct DetailsOption { 10 | pub href: String, 11 | pub title: String, 12 | } 13 | 14 | impl Component for Details { 15 | fn into_node(self) -> Node { 16 | details() 17 | .class("details") 18 | .child(summary().child(self.summary)) 19 | .child( 20 | div() 21 | .class("details-list") 22 | .children(self.options.into_iter().map(|option| { 23 | a().class("details-list-item") 24 | .attribute("href", option.href) 25 | .child(option.title) 26 | })), 27 | ) 28 | .into_node() 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /crates/ui/form/field_label.css: -------------------------------------------------------------------------------- 1 | .field-label { 2 | color: var(--heading-text-color); 3 | display: grid; 4 | gap: 0.5rem; 5 | user-select: none; 6 | } 7 | -------------------------------------------------------------------------------- /crates/ui/form/field_label.rs: -------------------------------------------------------------------------------- 1 | use pinwheel::prelude::*; 2 | 3 | #[derive(builder, children, Default, new)] 4 | #[new(default)] 5 | pub struct FieldLabel { 6 | #[builder] 7 | pub html_for: Option, 8 | children: Vec, 9 | } 10 | 11 | impl Component for FieldLabel { 12 | fn into_node(self) -> Node { 13 | label() 14 | .class("field-label") 15 | .attribute("for", self.html_for) 16 | .child(self.children) 17 | .into_node() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /crates/ui/form/file_field.css: -------------------------------------------------------------------------------- 1 | .form-file-wrapper { 2 | background-color: var(--surface-color); 3 | border: var(--border); 4 | border-radius: var(--border-radius); 5 | box-sizing: border-box; 6 | color: var(--text-color); 7 | cursor: pointer; 8 | font-size: 1rem; 9 | height: 2.5rem; 10 | line-height: 1.5; 11 | outline: none; 12 | padding: calc(0.5rem - var(--border-width)) 1rem; 13 | position: relative; 14 | user-select: text; 15 | width: 100%; 16 | } 17 | 18 | .form-file-wrapper:hover { 19 | border-color: var(--hover-color); 20 | } 21 | 22 | .form-file-wrapper:focus-within { 23 | border-color: var(--accent-color); 24 | } 25 | 26 | .form-file-input { 27 | bottom: 0; 28 | left: 0; 29 | opacity: 0; 30 | position: absolute; 31 | right: 0; 32 | top: 0; 33 | width: 100%; 34 | } 35 | -------------------------------------------------------------------------------- /crates/ui/form/form.css: -------------------------------------------------------------------------------- 1 | .form-title { 2 | text-align: center; 3 | } 4 | 5 | .form { 6 | display: grid; 7 | row-gap: 1rem; 8 | margin: 0; 9 | } 10 | -------------------------------------------------------------------------------- /crates/ui/form/select_field.css: -------------------------------------------------------------------------------- 1 | .form-select-field { 2 | -moz-appearance: none; 3 | -webkit-appearance: none; 4 | -webkit-text-fill-color: inherit; 5 | appearance: none; 6 | background-color: var(--surface-color); 7 | border-radius: var(--border-radius); 8 | border: var(--border); 9 | box-sizing: border-box; 10 | color: var(--text-color); 11 | cursor: pointer; 12 | font-size: 1rem; 13 | font: inherit; 14 | height: 2.5rem; 15 | outline: none; 16 | padding: calc(0.5rem - var(--border-width)) 1rem; 17 | user-select: text; 18 | width: 100%; 19 | } 20 | 21 | .form-select-field:hover { 22 | border-color: var(--hover-color); 23 | } 24 | 25 | .form-select-field:focus { 26 | border-color: var(--accent-color); 27 | } 28 | 29 | .form-select-field::-webkit-input-placeholder { 30 | -webkit-text-fill-color: var(--muted-text-color); 31 | color: var(--muted-text-color); 32 | } 33 | -------------------------------------------------------------------------------- /crates/ui/form/text_field.css: -------------------------------------------------------------------------------- 1 | .form-text-field { 2 | -moz-appearance: none; 3 | -webkit-appearance: none; 4 | -webkit-text-fill-color: inherit; 5 | appearance: none; 6 | background-color: var(--surface-color); 7 | border-radius: var(--border-radius); 8 | border: var(--border); 9 | box-sizing: border-box; 10 | color: var(--text-color); 11 | font-size: 1rem; 12 | font: inherit; 13 | height: 2.5rem; 14 | outline: none; 15 | padding: calc(0.5rem - var(--border-width)) 1rem; 16 | user-select: text; 17 | width: 100%; 18 | } 19 | 20 | .form-text-field:not(:disabled):hover { 21 | border-color: var(--hover-color); 22 | } 23 | 24 | .form-text-field:focus { 25 | border-color: var(--accent-color); 26 | } 27 | 28 | .form-text-field::-webkit-input-placeholder { 29 | -webkit-text-fill-color: var(--muted-text-color); 30 | color: var(--muted-text-color); 31 | } 32 | -------------------------------------------------------------------------------- /crates/ui/image.css: -------------------------------------------------------------------------------- 1 | .image-details[open] > summary::before { 2 | -webkit-appearance: none; 3 | background: transparent; 4 | bottom: 0; 5 | content: " "; 6 | cursor: zoom-out; 7 | display: block; 8 | left: 0; 9 | position: fixed; 10 | right: 0; 11 | top: 0; 12 | z-index: 1; 13 | } 14 | 15 | .image-details-summary { 16 | display: grid; 17 | list-style-type: none; 18 | outline: none; 19 | } 20 | 21 | .image-img { 22 | border-radius: 4px; 23 | cursor: zoom-in; 24 | width: 100%; 25 | } 26 | 27 | .image-viewer { 28 | background-color: rgba(0, 0, 0, 0.8); 29 | bottom: 0; 30 | left: 0; 31 | padding: 1rem; 32 | position: fixed; 33 | right: 0; 34 | top: 0; 35 | user-select: none; 36 | -moz-user-select: none; 37 | -webkit-user-select: none; 38 | } 39 | 40 | .image-viewer-img { 41 | height: 100%; 42 | object-fit: contain; 43 | width: 100%; 44 | } 45 | -------------------------------------------------------------------------------- /crates/ui/image.rs: -------------------------------------------------------------------------------- 1 | use pinwheel::prelude::*; 2 | 3 | #[derive(builder, Default, new)] 4 | #[new(default)] 5 | pub struct Img { 6 | #[builder] 7 | pub alt: Option, 8 | #[builder] 9 | pub src: Option, 10 | } 11 | 12 | impl Component for Img { 13 | fn into_node(self) -> Node { 14 | details() 15 | .class("image-details") 16 | .child( 17 | summary().class("image-details-summary").child( 18 | img() 19 | .class("image-img") 20 | .attribute("alt", self.alt.clone()) 21 | .attribute("src", self.src.clone()), 22 | ), 23 | ) 24 | .child( 25 | div().class("image-viewer").child( 26 | img() 27 | .class("image-viewer-img") 28 | .attribute("alt", self.alt) 29 | .attribute("src", self.src), 30 | ), 31 | ) 32 | .into_node() 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /crates/ui/link.css: -------------------------------------------------------------------------------- 1 | .link { 2 | color: var(--blue); 3 | cursor: pointer; 4 | text-decoration: none; 5 | } 6 | 7 | .link:hover { 8 | filter: brightness(90%); 9 | } 10 | 11 | .link:focus { 12 | filter: brightness(90%); 13 | } 14 | -------------------------------------------------------------------------------- /crates/ui/link.rs: -------------------------------------------------------------------------------- 1 | use pinwheel::prelude::*; 2 | 3 | #[derive(builder, children, Default, new)] 4 | #[new(default)] 5 | pub struct Link { 6 | #[builder] 7 | pub class: Option, 8 | #[builder] 9 | pub href: Option, 10 | #[builder] 11 | pub target: Option, 12 | #[builder] 13 | pub title: Option, 14 | pub children: Vec, 15 | } 16 | 17 | impl Component for Link { 18 | fn into_node(self) -> Node { 19 | a().class("link") 20 | .class(self.class) 21 | .href(self.href) 22 | .target(self.target) 23 | .title(self.title) 24 | .child(self.children) 25 | .into_node() 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /crates/ui/number_card.css: -------------------------------------------------------------------------------- 1 | .number-wrapper { 2 | color: var(--text-color); 3 | display: flex; 4 | flex-direction: column; 5 | justify-content: center; 6 | text-align: center; 7 | } 8 | 9 | .number-value { 10 | color: var(--heading-text-color); 11 | font-size: 2rem; 12 | margin-bottom: 1rem; 13 | } 14 | 15 | @media (max-width: 1023px) { 16 | .number-value { 17 | font-size: 1.5rem; 18 | } 19 | } 20 | 21 | .number-title { 22 | color: var(--text-color); 23 | } 24 | -------------------------------------------------------------------------------- /crates/ui/number_card.rs: -------------------------------------------------------------------------------- 1 | use crate as ui; 2 | use pinwheel::prelude::*; 3 | 4 | #[derive(builder, new)] 5 | pub struct NumberCard { 6 | pub title: String, 7 | pub value: String, 8 | } 9 | 10 | impl Component for NumberCard { 11 | fn into_node(self) -> Node { 12 | ui::Card::new() 13 | .child( 14 | div() 15 | .class("number-wrapper") 16 | .child(div().class("number-value").child(self.value)) 17 | .child(div().class("number-title").child(self.title)), 18 | ) 19 | .into_node() 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /crates/ui/table.css: -------------------------------------------------------------------------------- 1 | .table { 2 | overflow: auto; 3 | } 4 | 5 | .table table { 6 | background-color: var(--surface-color); 7 | border: var(--border); 8 | border-radius: var(--border-radius); 9 | border-spacing: 0; 10 | margin: 0; 11 | } 12 | 13 | .table thead { 14 | border-top-left-radius: var(--border-radius); 15 | border-top-right-radius: var(--border-radius); 16 | } 17 | 18 | .table th { 19 | background-color: var(--header-color); 20 | border-bottom: var(--border-color); 21 | color: var(--heading-text-color); 22 | font-weight: normal; 23 | padding: 0.5rem 1rem; 24 | white-space: nowrap; 25 | } 26 | 27 | .table td { 28 | padding: 1rem 1rem; 29 | white-space: nowrap; 30 | } 31 | -------------------------------------------------------------------------------- /crates/ui/token.css: -------------------------------------------------------------------------------- 1 | .token { 2 | background-color: var(--accent-color); 3 | align-items: center; 4 | border-radius: 4px; 5 | box-sizing: border-box; 6 | color: var(--fun-text-color); 7 | display: inline-flex; 8 | font-size: 1em; 9 | height: 1.5em; 10 | padding: 0em 0.5em; 11 | white-space: nowrap; 12 | } 13 | -------------------------------------------------------------------------------- /crates/ui/token.rs: -------------------------------------------------------------------------------- 1 | use pinwheel::prelude::*; 2 | 3 | #[derive(builder, children, Default, new)] 4 | #[new(default)] 5 | pub struct Token { 6 | #[builder] 7 | pub color: Option, 8 | children: Vec, 9 | } 10 | 11 | impl Component for Token { 12 | fn into_node(self) -> Node { 13 | span() 14 | .class("token") 15 | .style(style::BACKGROUND_COLOR, self.color) 16 | .child(self.children) 17 | .into_node() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /crates/www/build.rs: -------------------------------------------------------------------------------- 1 | use anyhow::Result; 2 | use std::path::PathBuf; 3 | 4 | fn main() -> Result<()> { 5 | let crate_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); 6 | let workspace_path = crate_path.parent().unwrap().parent().unwrap().to_owned(); 7 | let crate_out_dir = PathBuf::from(std::env::var("OUT_DIR").unwrap()); 8 | let css_paths = vec![workspace_path.to_owned()]; 9 | println!("cargo:rerun-if-changed=../../Cargo.lock"); 10 | println!("cargo:rerun-if-changed=../"); 11 | sunfish::build(sunfish::BuildOptions { 12 | workspace_path, 13 | crate_path, 14 | crate_out_dir, 15 | css_paths, 16 | })?; 17 | Ok(()) 18 | } 19 | -------------------------------------------------------------------------------- /crates/www/content/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_www_content" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = false 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [lib] 17 | path = "lib.rs" 18 | 19 | [dependencies] 20 | anyhow = { workspace = true } 21 | pinwheel = { workspace = true } 22 | serde = { workspace = true } 23 | serde_json = { workspace = true } 24 | sunfish = { workspace = true } 25 | 26 | modelfox_ui = { workspace = true } 27 | -------------------------------------------------------------------------------- /crates/www/layouts/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_www_layouts" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = false 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [lib] 17 | path = "lib.rs" 18 | 19 | [dependencies] 20 | chrono = { workspace = true } 21 | pinwheel = { workspace = true } 22 | sunfish = { workspace = true } 23 | 24 | modelfox_ui = { workspace = true } 25 | 26 | modelfox_www_content = { path = "../content" } 27 | modelfox_www_ui = { path = "../ui" } 28 | -------------------------------------------------------------------------------- /crates/www/layouts/language.rs: -------------------------------------------------------------------------------- 1 | export enum Language { 2 | JavaScript = "javascript", 3 | PHP = "php", 4 | Python = "python", 5 | Ruby = "ruby", 6 | Go = "go", 7 | } 8 | -------------------------------------------------------------------------------- /crates/www/layouts/layout.css: -------------------------------------------------------------------------------- 1 | .layout { 2 | background-color: var(--background-color); 3 | color: var(--text-color); 4 | display: grid; 5 | grid: auto 1fr auto / auto; 6 | min-height: 100vh; 7 | } 8 | 9 | .github-icon:hover { 10 | filter: brightness(90%); 11 | } 12 | -------------------------------------------------------------------------------- /crates/www/layouts/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod docs_layout; 2 | pub mod document; 3 | pub mod footer; 4 | pub mod layout; 5 | pub mod page_layout; 6 | -------------------------------------------------------------------------------- /crates/www/layouts/page_layout.css: -------------------------------------------------------------------------------- 1 | .page-layout { 2 | box-sizing: border-box; 3 | margin: 0 auto; 4 | max-width: var(--max-width); 5 | padding: 2rem; 6 | } 7 | -------------------------------------------------------------------------------- /crates/www/layouts/page_layout.rs: -------------------------------------------------------------------------------- 1 | use crate::layout::Layout; 2 | use pinwheel::prelude::*; 3 | 4 | #[derive(children, Default, new)] 5 | #[new(default)] 6 | pub struct PageLayout { 7 | pub children: Vec, 8 | } 9 | 10 | impl Component for PageLayout { 11 | fn into_node(self) -> Node { 12 | Layout::new() 13 | .child(div().class("page-layout").child(self.children)) 14 | .into_node() 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /crates/www/routes/benchmarks/client/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_www_benchmarks_client" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = false 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [[bin]] 17 | name = "modelfox_www_benchmarks_client" 18 | path = "main.rs" 19 | 20 | [dependencies] 21 | console_error_panic_hook = { workspace = true } 22 | pinwheel = { workspace = true } 23 | web-sys = { workspace = true } 24 | 25 | modelfox_charts = { workspace = true } 26 | modelfox_ui = { workspace = true } 27 | 28 | modelfox_www_benchmarks_common = { path = "../common" } -------------------------------------------------------------------------------- /crates/www/routes/benchmarks/client/main.rs: -------------------------------------------------------------------------------- 1 | use pinwheel::prelude::*; 2 | 3 | pub fn main() { 4 | modelfox_ui::client_start(); 5 | hydrate::("benchmarks"); 6 | } 7 | -------------------------------------------------------------------------------- /crates/www/routes/benchmarks/common/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_www_benchmarks_common" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = false 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [lib] 17 | path = "lib.rs" 18 | 19 | [dependencies] 20 | futures-signals = { workspace = true } 21 | num = { workspace = true } 22 | pinwheel = { workspace = true } 23 | serde = { workspace = true } 24 | tracing = { workspace = true } 25 | 26 | modelfox_charts = { workspace = true } 27 | modelfox_ui = { workspace = true } -------------------------------------------------------------------------------- /crates/www/routes/benchmarks/server/lib.rs: -------------------------------------------------------------------------------- 1 | use pinwheel::prelude::*; 2 | 3 | mod page; 4 | 5 | pub fn init() -> sunfish::Route { 6 | sunfish::Route::new_static(|_| html(self::page::Page)) 7 | } 8 | -------------------------------------------------------------------------------- /crates/www/routes/benchmarks/server/page.css: -------------------------------------------------------------------------------- 1 | .benchmarks-table-chart-grid { 2 | display: grid; 3 | } 4 | 5 | @media (max-width: 1023px) { 6 | .benchmarks-table-chart-grid { 7 | row-gap: 1rem; 8 | grid: auto auto / auto; 9 | } 10 | } 11 | 12 | @media (min-width: 1024px) { 13 | .benchmarks-table-chart-grid { 14 | column-gap: 1rem; 15 | grid: auto / minmax(0, 1fr) minmax(0, 1fr); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /crates/www/routes/benchmarks/server/page.rs: -------------------------------------------------------------------------------- 1 | use modelfox_www_benchmarks_common::Benchmarks; 2 | use modelfox_www_layouts::{document::Document, page_layout::PageLayout}; 3 | use pinwheel::prelude::*; 4 | 5 | pub struct Page; 6 | 7 | impl Component for Page { 8 | fn into_node(self) -> Node { 9 | Document::new() 10 | .client("modelfox_www_benchmarks_client") 11 | .child(PageLayout::new().child(Dehydrate::new("benchmarks", Benchmarks::new()))) 12 | .into_node() 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /crates/www/routes/blog/_/index/server/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_www_blog_server" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = false 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [lib] 17 | path = "lib.rs" 18 | 19 | [dependencies] 20 | pinwheel = { workspace = true } 21 | sunfish = { workspace = true } 22 | 23 | modelfox_ui = { workspace = true } 24 | 25 | modelfox_www_content = { path = "../../../../../content" } 26 | modelfox_www_layouts = { path = "../../../../../layouts" } 27 | -------------------------------------------------------------------------------- /crates/www/routes/blog/_/index/server/hn.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /crates/www/routes/blog/_/index/server/lib.rs: -------------------------------------------------------------------------------- 1 | use modelfox_www_content::Content; 2 | use pinwheel::prelude::*; 3 | 4 | mod page; 5 | 6 | pub fn init() -> sunfish::Route { 7 | sunfish::Route::new_static_with_paths( 8 | || { 9 | modelfox_www_content::BlogPost::slugs() 10 | .unwrap() 11 | .into_iter() 12 | .map(|slug| format!("/blog/{}/", slug)) 13 | .collect() 14 | }, 15 | |path| { 16 | let slug = if let ["blog", slug, ""] = *sunfish::path_components(&path).as_slice() { 17 | slug 18 | } else { 19 | panic!() 20 | }; 21 | html(self::page::Page::new(slug.to_owned())) 22 | }, 23 | ) 24 | } 25 | -------------------------------------------------------------------------------- /crates/www/routes/blog/_/index/server/page.css: -------------------------------------------------------------------------------- 1 | .blog-post-content { 2 | max-width: 780px; 3 | margin: auto; 4 | } 5 | 6 | .blog-post-date { 7 | font-size: 1rem; 8 | margin-top: 1rem; 9 | color: var(--muted-text-color); 10 | } 11 | 12 | .blog-post-author { 13 | display: grid; 14 | grid: auto/auto 1fr; 15 | gap: 1rem; 16 | justify-items: start; 17 | align-items: center; 18 | font-size: 1rem; 19 | margin-top: 1rem; 20 | color: var(--muted-text-color); 21 | line-height: 1.5; 22 | } 23 | 24 | .blog-post-author-facehole { 25 | width: 40px; 26 | height: 40px; 27 | border-radius: 20px; 28 | } 29 | 30 | .blog-post-share-wrapper { 31 | display: grid; 32 | gap: 1rem; 33 | } 34 | 35 | .blog-post-share-buttons { 36 | display: grid; 37 | grid: auto/auto auto auto; 38 | gap: 1rem; 39 | justify-items: start; 40 | justify-content: start; 41 | align-items: center; 42 | align-content: center; 43 | } 44 | -------------------------------------------------------------------------------- /crates/www/routes/blog/index/server/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_www_blog_index_server" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = false 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [lib] 17 | path = "lib.rs" 18 | 19 | [dependencies] 20 | pinwheel = { workspace = true } 21 | sunfish = { workspace = true } 22 | 23 | modelfox_ui = { workspace = true } 24 | 25 | modelfox_www_content = { path = "../../../../content" } 26 | modelfox_www_layouts = { path = "../../../../layouts" } 27 | -------------------------------------------------------------------------------- /crates/www/routes/blog/index/server/lib.rs: -------------------------------------------------------------------------------- 1 | use pinwheel::prelude::*; 2 | 3 | mod page; 4 | 5 | pub fn init() -> sunfish::Route { 6 | sunfish::Route::new_static(|_| html(self::page::Page)) 7 | } 8 | -------------------------------------------------------------------------------- /crates/www/routes/blog/index/server/page.rs: -------------------------------------------------------------------------------- 1 | use modelfox_ui as ui; 2 | use modelfox_www_content::{BlogPost, Content}; 3 | use modelfox_www_layouts::{document::Document, page_layout::PageLayout}; 4 | use pinwheel::prelude::*; 5 | 6 | pub struct Page; 7 | 8 | impl Component for Page { 9 | fn into_node(self) -> Node { 10 | let blog_posts = BlogPost::list().unwrap().into_iter().map(|blog_post| { 11 | let href = format!("/blog/{}/", blog_post.slug); 12 | div() 13 | .child( 14 | ui::Link::new() 15 | .href(href) 16 | .child(blog_post.front_matter.title), 17 | ) 18 | .child(ui::P::new().child(blog_post.front_matter.date)) 19 | }); 20 | Document::new() 21 | .child( 22 | PageLayout::new().child( 23 | ui::S1::new() 24 | .child(ui::H1::new("Blog")) 25 | .child(ui::S2::new().children(blog_posts)), 26 | ), 27 | ) 28 | .into_node() 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /crates/www/routes/docs/getting_started/index/server/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_www_docs_getting_started_index_server" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = false 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [lib] 17 | path = "lib.rs" 18 | 19 | [dependencies] 20 | pinwheel = { workspace = true } 21 | sunfish = { workspace = true } 22 | 23 | modelfox_ui = { workspace = true } 24 | 25 | modelfox_www_layouts = { path = "../../../../../layouts" } -------------------------------------------------------------------------------- /crates/www/routes/docs/getting_started/index/server/lib.rs: -------------------------------------------------------------------------------- 1 | use pinwheel::prelude::*; 2 | 3 | mod page; 4 | 5 | pub fn init() -> sunfish::Route { 6 | sunfish::Route::new_static(|_| html(self::page::Page)) 7 | } 8 | -------------------------------------------------------------------------------- /crates/www/routes/docs/getting_started/inspect/client/main.rs: -------------------------------------------------------------------------------- 1 | use modelfox_ui as ui; 2 | use pinwheel::prelude::*; 3 | 4 | pub fn main() { 5 | console_error_panic_hook::set_once(); 6 | ui::boot_code_select(); 7 | hydrate::("tuning"); 8 | } 9 | -------------------------------------------------------------------------------- /crates/www/routes/docs/getting_started/inspect/common/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_www_docs_inspect_common" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = false 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [lib] 17 | path = "lib.rs" 18 | 19 | [dependencies] 20 | modelfox_www_index_common = { path = "../../../../index/common" } 21 | -------------------------------------------------------------------------------- /crates/www/routes/docs/getting_started/inspect/common/lib.rs: -------------------------------------------------------------------------------- 1 | pub use modelfox_www_index_common::tuning::{ThresholdMetrics, Tuning}; 2 | -------------------------------------------------------------------------------- /crates/www/routes/docs/getting_started/inspect/server/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_www_docs_getting_started_inspect_server" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = false 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [lib] 17 | path = "lib.rs" 18 | 19 | [dependencies] 20 | num = { workspace = true } 21 | pinwheel = { workspace = true } 22 | sunfish = { workspace = true } 23 | 24 | modelfox_ui = { workspace = true } 25 | 26 | modelfox_www_docs_inspect_common = { path = "../common" } 27 | modelfox_www_layouts = { path = "../../../../../layouts" } 28 | modelfox_www_ui = { path = "../../../../../ui" } 29 | -------------------------------------------------------------------------------- /crates/www/routes/docs/getting_started/inspect/server/lib.rs: -------------------------------------------------------------------------------- 1 | use pinwheel::prelude::*; 2 | 3 | mod page; 4 | 5 | pub fn init() -> sunfish::Route { 6 | sunfish::Route::new_static(|_| html(self::page::Page)) 7 | } 8 | -------------------------------------------------------------------------------- /crates/www/routes/docs/getting_started/inspect/server/page.css: -------------------------------------------------------------------------------- 1 | .docs-inspect-tuning-number-chart-grid { 2 | display: grid; 3 | gap: 1rem; 4 | } 5 | 6 | @media (max-width: 1023px) { 7 | .docs-inspect-tuning-number-chart-grid { 8 | grid: 9 | "accuracy accuracy" auto "precision recall" auto / 10 | minmax(0, 1fr) minmax(0, 1fr); 11 | } 12 | } 13 | 14 | @media (min-width: 1024px) { 15 | .docs-inspect-tuning-number-chart-grid { 16 | grid: 17 | "accuracy precision recall" auto / 18 | minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /crates/www/routes/docs/getting_started/monitor/client/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_www_docs_getting_started_monitor_client" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = false 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [[bin]] 17 | name = "modelfox_www_docs_getting_started_monitor_client" 18 | path = "main.rs" 19 | 20 | [dependencies] 21 | console_error_panic_hook = { workspace = true } 22 | pinwheel = { workspace = true } 23 | wasm-bindgen = { workspace = true } 24 | web-sys = { workspace = true } 25 | 26 | modelfox_charts = { workspace = true } 27 | modelfox_ui = { workspace = true } -------------------------------------------------------------------------------- /crates/www/routes/docs/getting_started/monitor/client/main.rs: -------------------------------------------------------------------------------- 1 | use modelfox_ui as ui; 2 | use pinwheel::prelude::*; 3 | use web_sys as dom; 4 | 5 | pub fn main() { 6 | modelfox_ui::client_start(); 7 | let document = dom::window().unwrap().document().unwrap(); 8 | ui::boot_code_select(); 9 | if document.get_element_by_id("enum_overall").is_some() { 10 | hydrate::("enum_overall"); 11 | } 12 | if document 13 | .get_element_by_id("production-explanations") 14 | .is_some() 15 | { 16 | hydrate::( 17 | "production-explanations", 18 | ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /crates/www/routes/docs/getting_started/monitor/server/lib.rs: -------------------------------------------------------------------------------- 1 | use pinwheel::prelude::*; 2 | 3 | mod page; 4 | 5 | pub fn init() -> sunfish::Route { 6 | sunfish::Route::new_static(|_| html(self::page::Page)) 7 | } 8 | -------------------------------------------------------------------------------- /crates/www/routes/docs/getting_started/predict/cli/server/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_www_docs_getting_started_predict_cli_server" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = false 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [lib] 17 | path = "lib.rs" 18 | 19 | [dependencies] 20 | pinwheel = { workspace = true } 21 | sunfish = { workspace = true } 22 | 23 | modelfox_ui = { workspace = true } 24 | 25 | modelfox_www_layouts = { path = "../../../../../../layouts" } 26 | modelfox_www_ui = { path = "../../../../../../ui" } 27 | -------------------------------------------------------------------------------- /crates/www/routes/docs/getting_started/predict/cli/server/lib.rs: -------------------------------------------------------------------------------- 1 | use pinwheel::prelude::*; 2 | 3 | mod page; 4 | 5 | pub fn init() -> sunfish::Route { 6 | sunfish::Route::new_static(|_| html(self::page::Page)) 7 | } 8 | -------------------------------------------------------------------------------- /crates/www/routes/docs/getting_started/predict/elixir/server/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_www_docs_getting_started_predict_elixir_server" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = false 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [lib] 17 | path = "lib.rs" 18 | 19 | [dependencies] 20 | pinwheel = { workspace = true } 21 | sunfish = { workspace = true } 22 | 23 | modelfox_ui = { workspace = true } 24 | 25 | modelfox_www_layouts = { path = "../../../../../../layouts" } 26 | modelfox_www_ui = { path = "../../../../../../ui" } 27 | -------------------------------------------------------------------------------- /crates/www/routes/docs/getting_started/predict/elixir/server/lib.rs: -------------------------------------------------------------------------------- 1 | use pinwheel::prelude::*; 2 | 3 | mod page; 4 | 5 | pub fn init() -> sunfish::Route { 6 | sunfish::Route::new_static(|_| html(self::page::Page)) 7 | } 8 | -------------------------------------------------------------------------------- /crates/www/routes/docs/getting_started/predict/go/server/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_www_docs_getting_started_predict_go_server" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = false 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [lib] 17 | path = "lib.rs" 18 | 19 | [dependencies] 20 | pinwheel = { workspace = true } 21 | sunfish = { workspace = true } 22 | 23 | modelfox_ui = { workspace = true } 24 | 25 | modelfox_www_layouts = { path = "../../../../../../layouts" } 26 | modelfox_www_ui = { path = "../../../../../../ui" } 27 | -------------------------------------------------------------------------------- /crates/www/routes/docs/getting_started/predict/go/server/lib.rs: -------------------------------------------------------------------------------- 1 | use pinwheel::prelude::*; 2 | 3 | mod page; 4 | 5 | pub fn init() -> sunfish::Route { 6 | sunfish::Route::new_static(|_| html(self::page::Page)) 7 | } 8 | -------------------------------------------------------------------------------- /crates/www/routes/docs/getting_started/predict/index/server/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_www_docs_getting_started_predict_index_server" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = false 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [lib] 17 | path = "lib.rs" 18 | 19 | [dependencies] 20 | pinwheel = { workspace = true } 21 | sunfish = { workspace = true } 22 | 23 | modelfox_ui = { workspace = true } 24 | 25 | modelfox_www_layouts = { path = "../../../../../../layouts" } 26 | modelfox_www_ui = { path = "../../../../../../ui" } 27 | -------------------------------------------------------------------------------- /crates/www/routes/docs/getting_started/predict/index/server/lib.rs: -------------------------------------------------------------------------------- 1 | use pinwheel::prelude::*; 2 | 3 | mod page; 4 | 5 | pub fn init() -> sunfish::Route { 6 | sunfish::Route::new_static(|_| html(self::page::Page)) 7 | } 8 | -------------------------------------------------------------------------------- /crates/www/routes/docs/getting_started/predict/javascript/server/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_www_docs_getting_started_predict_javascript_server" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = false 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [lib] 17 | path = "lib.rs" 18 | 19 | [dependencies] 20 | pinwheel = { workspace = true } 21 | sunfish = { workspace = true } 22 | 23 | modelfox_ui = { workspace = true } 24 | 25 | modelfox_www_layouts = { path = "../../../../../../layouts" } 26 | modelfox_www_ui = { path = "../../../../../../ui" } 27 | -------------------------------------------------------------------------------- /crates/www/routes/docs/getting_started/predict/javascript/server/lib.rs: -------------------------------------------------------------------------------- 1 | use pinwheel::prelude::*; 2 | 3 | mod page; 4 | 5 | pub fn init() -> sunfish::Route { 6 | sunfish::Route::new_static(|_| html(self::page::Page)) 7 | } 8 | -------------------------------------------------------------------------------- /crates/www/routes/docs/getting_started/predict/php/server/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_www_docs_getting_started_predict_php_server" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = false 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [lib] 17 | path = "lib.rs" 18 | 19 | [dependencies] 20 | pinwheel = { workspace = true } 21 | sunfish = { workspace = true } 22 | 23 | modelfox_ui = { workspace = true } 24 | 25 | modelfox_www_layouts = { path = "../../../../../../layouts" } 26 | modelfox_www_ui = { path = "../../../../../../ui" } 27 | -------------------------------------------------------------------------------- /crates/www/routes/docs/getting_started/predict/php/server/lib.rs: -------------------------------------------------------------------------------- 1 | use pinwheel::prelude::*; 2 | 3 | mod page; 4 | 5 | pub fn init() -> sunfish::Route { 6 | sunfish::Route::new_static(|_| html(self::page::Page)) 7 | } 8 | -------------------------------------------------------------------------------- /crates/www/routes/docs/getting_started/predict/python/server/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_www_docs_getting_started_predict_python_server" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = false 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [lib] 17 | path = "lib.rs" 18 | 19 | [dependencies] 20 | pinwheel = { workspace = true } 21 | sunfish = { workspace = true } 22 | 23 | modelfox_ui = { workspace = true } 24 | 25 | modelfox_www_layouts = { path = "../../../../../../layouts" } 26 | modelfox_www_ui = { path = "../../../../../../ui" } 27 | -------------------------------------------------------------------------------- /crates/www/routes/docs/getting_started/predict/python/server/lib.rs: -------------------------------------------------------------------------------- 1 | use pinwheel::prelude::*; 2 | 3 | mod page; 4 | 5 | pub fn init() -> sunfish::Route { 6 | sunfish::Route::new_static(|_| html(self::page::Page)) 7 | } 8 | -------------------------------------------------------------------------------- /crates/www/routes/docs/getting_started/predict/ruby/server/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_www_docs_getting_started_predict_ruby_server" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = false 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [lib] 17 | path = "lib.rs" 18 | 19 | [dependencies] 20 | pinwheel = { workspace = true } 21 | sunfish = { workspace = true } 22 | 23 | modelfox_ui = { workspace = true } 24 | 25 | modelfox_www_layouts = { path = "../../../../../../layouts" } 26 | modelfox_www_ui = { path = "../../../../../../ui" } 27 | -------------------------------------------------------------------------------- /crates/www/routes/docs/getting_started/predict/ruby/server/lib.rs: -------------------------------------------------------------------------------- 1 | use pinwheel::prelude::*; 2 | 3 | mod page; 4 | 5 | pub fn init() -> sunfish::Route { 6 | sunfish::Route::new_static(|_| html(self::page::Page)) 7 | } 8 | -------------------------------------------------------------------------------- /crates/www/routes/docs/getting_started/predict/rust/server/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_www_docs_getting_started_predict_rust_server" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = false 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [lib] 17 | path = "lib.rs" 18 | 19 | [dependencies] 20 | pinwheel = { workspace = true } 21 | sunfish = { workspace = true } 22 | 23 | modelfox_ui = { workspace = true } 24 | 25 | modelfox_www_layouts = { path = "../../../../../../layouts" } 26 | modelfox_www_ui = { path = "../../../../../../ui" } 27 | -------------------------------------------------------------------------------- /crates/www/routes/docs/getting_started/predict/rust/server/lib.rs: -------------------------------------------------------------------------------- 1 | use pinwheel::prelude::*; 2 | 3 | mod page; 4 | 5 | pub fn init() -> sunfish::Route { 6 | sunfish::Route::new_static(|_| html(self::page::Page)) 7 | } 8 | -------------------------------------------------------------------------------- /crates/www/routes/docs/getting_started/train/server/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_www_docs_getting_started_train_server" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = false 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [lib] 17 | path = "lib.rs" 18 | 19 | [dependencies] 20 | pinwheel = { workspace = true } 21 | sunfish = { workspace = true } 22 | 23 | modelfox_ui = { workspace = true } 24 | 25 | modelfox_www_ui = { path = "../../../../../ui" } 26 | modelfox_www_layouts = { path = "../../../../../layouts" } -------------------------------------------------------------------------------- /crates/www/routes/docs/getting_started/train/server/lib.rs: -------------------------------------------------------------------------------- 1 | use pinwheel::prelude::*; 2 | 3 | mod dataset_preview; 4 | mod page; 5 | 6 | pub fn init() -> sunfish::Route { 7 | sunfish::Route::new_static(|_| html(self::page::Page)) 8 | } 9 | -------------------------------------------------------------------------------- /crates/www/routes/docs/guides/_/server/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_www_docs_guide_server" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = false 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [lib] 17 | path = "lib.rs" 18 | 19 | [dependencies] 20 | pinwheel = { workspace = true } 21 | sunfish = { workspace = true } 22 | 23 | modelfox_ui = { workspace = true } 24 | 25 | modelfox_www_content = { path = "../../../../../content" } 26 | modelfox_www_ui = { path = "../../../../../ui" } 27 | modelfox_www_layouts = { path = "../../../../../layouts" } -------------------------------------------------------------------------------- /crates/www/routes/docs/guides/_/server/lib.rs: -------------------------------------------------------------------------------- 1 | use modelfox_www_content::Content; 2 | use pinwheel::prelude::*; 3 | 4 | mod page; 5 | 6 | pub fn init() -> sunfish::Route { 7 | sunfish::Route::new_static_with_paths( 8 | || { 9 | modelfox_www_content::DocsGuide::slugs() 10 | .unwrap() 11 | .into_iter() 12 | .map(|slug| format!("/docs/guides/{}", slug)) 13 | .collect() 14 | }, 15 | |path| { 16 | let slug = if let ["docs", "guides", slug] = *sunfish::path_components(&path).as_slice() 17 | { 18 | slug 19 | } else { 20 | panic!() 21 | }; 22 | html(self::page::Page::new(slug.to_owned())) 23 | }, 24 | ) 25 | } 26 | -------------------------------------------------------------------------------- /crates/www/routes/docs/guides/_/server/page.rs: -------------------------------------------------------------------------------- 1 | use modelfox_ui as ui; 2 | use modelfox_www_content::{Content, DocsGuide}; 3 | use modelfox_www_layouts::{ 4 | docs_layout::{DocsLayout, DocsPage}, 5 | document::Document, 6 | }; 7 | use pinwheel::prelude::*; 8 | 9 | #[derive(new)] 10 | pub struct Page { 11 | pub slug: String, 12 | } 13 | 14 | impl Component for Page { 15 | fn into_node(self) -> Node { 16 | let guide = DocsGuide::from_slug(self.slug).unwrap(); 17 | let content = ui::S1::new() 18 | .child(ui::H1::new(guide.front_matter.title)) 19 | .child(guide.markdown); 20 | let layout = DocsLayout::new() 21 | .selected_page(DocsPage::Guides(guide.slug)) 22 | .child(content); 23 | Document::new().child(layout).into_node() 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /crates/www/routes/docs/index/server/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_www_docs_index_server" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = false 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [lib] 17 | path = "lib.rs" 18 | 19 | [dependencies] 20 | pinwheel = { workspace = true } 21 | sunfish = { workspace = true } 22 | 23 | modelfox_ui = { workspace = true } 24 | 25 | modelfox_app_core = { path = "../../../../../app/core" } 26 | modelfox_www_ui = { path = "../../../../ui" } 27 | modelfox_www_layouts = { path = "../../../../layouts" } -------------------------------------------------------------------------------- /crates/www/routes/docs/index/server/lib.rs: -------------------------------------------------------------------------------- 1 | use pinwheel::prelude::*; 2 | 3 | mod page; 4 | 5 | pub fn init() -> sunfish::Route { 6 | sunfish::Route::new_static(|_| html(self::page::Page)) 7 | } 8 | -------------------------------------------------------------------------------- /crates/www/routes/docs/install/server/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_www_docs_install_server" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = false 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [lib] 17 | path = "lib.rs" 18 | 19 | [dependencies] 20 | pinwheel = { workspace = true } 21 | sunfish = { workspace = true } 22 | 23 | modelfox_ui = { workspace = true } 24 | 25 | modelfox_www_layouts = { path = "../../../../layouts" } 26 | modelfox_www_ui = { path = "../../../../ui" } -------------------------------------------------------------------------------- /crates/www/routes/docs/install/server/lib.rs: -------------------------------------------------------------------------------- 1 | use pinwheel::prelude::*; 2 | 3 | mod page; 4 | 5 | pub fn init() -> sunfish::Route { 6 | sunfish::Route::new_static(|_| html(self::page::Page)) 7 | } 8 | -------------------------------------------------------------------------------- /crates/www/routes/docs/internals/_/server/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_www_docs_internals_server" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = false 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [lib] 17 | path = "lib.rs" 18 | 19 | [dependencies] 20 | pinwheel = { workspace = true } 21 | sunfish = { workspace = true } 22 | 23 | modelfox_ui = { workspace = true } 24 | 25 | modelfox_www_content = { path = "../../../../../content" } 26 | modelfox_www_layouts = { path = "../../../../../layouts" } 27 | modelfox_www_ui = { path = "../../../../../ui" } -------------------------------------------------------------------------------- /crates/www/routes/docs/internals/_/server/lib.rs: -------------------------------------------------------------------------------- 1 | use modelfox_www_content::Content; 2 | use pinwheel::prelude::*; 3 | 4 | mod page; 5 | 6 | pub fn init() -> sunfish::Route { 7 | sunfish::Route::new_static_with_paths( 8 | || { 9 | modelfox_www_content::DocsInternals::slugs() 10 | .unwrap() 11 | .into_iter() 12 | .map(|slug| format!("/docs/internals/{}", slug)) 13 | .collect() 14 | }, 15 | |path| { 16 | let slug = 17 | if let ["docs", "internals", slug] = *sunfish::path_components(&path).as_slice() { 18 | slug 19 | } else { 20 | panic!() 21 | }; 22 | html(self::page::Page::new(slug.to_owned())) 23 | }, 24 | ) 25 | } 26 | -------------------------------------------------------------------------------- /crates/www/routes/docs/internals/_/server/page.rs: -------------------------------------------------------------------------------- 1 | use modelfox_ui as ui; 2 | use modelfox_www_content::{Content, DocsInternals}; 3 | use modelfox_www_layouts::{ 4 | docs_layout::{DocsLayout, DocsPage}, 5 | document::Document, 6 | }; 7 | use pinwheel::prelude::*; 8 | 9 | #[derive(new)] 10 | pub struct Page { 11 | pub slug: String, 12 | } 13 | 14 | impl Component for Page { 15 | fn into_node(self) -> Node { 16 | let internal = DocsInternals::from_slug(self.slug).unwrap(); 17 | let content = ui::S1::new() 18 | .child(ui::H1::new(internal.front_matter.title)) 19 | .child(internal.markdown); 20 | let layout = DocsLayout::new() 21 | .selected_page(DocsPage::Internals(internal.slug)) 22 | .child(content); 23 | Document::new().child(layout).into_node() 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /crates/www/routes/index/client/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_www_index_client" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = false 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [[bin]] 17 | name = "modelfox_www_index_client" 18 | path = "main.rs" 19 | 20 | [dependencies] 21 | pinwheel = { workspace = true } 22 | web-sys = { workspace = true } 23 | 24 | modelfox_charts = { workspace = true } 25 | modelfox_ui = { workspace = true } 26 | 27 | modelfox_www_index_common = { path = "../common" } 28 | -------------------------------------------------------------------------------- /crates/www/routes/index/client/main.rs: -------------------------------------------------------------------------------- 1 | use modelfox_ui as ui; 2 | use pinwheel::prelude::*; 3 | 4 | fn main() { 5 | modelfox_ui::client_start(); 6 | ui::boot_code_select(); 7 | hydrate::("pr-curve"); 8 | hydrate::("roc-curve"); 9 | hydrate::("production-explanations"); 10 | hydrate::("production-stats-enum"); 11 | hydrate::("production-stats-number"); 12 | hydrate::("production-accuracy"); 13 | hydrate::("production-precision"); 14 | hydrate::("tuning"); 15 | } 16 | -------------------------------------------------------------------------------- /crates/www/routes/index/common/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_www_index_common" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = false 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [lib] 17 | path = "lib.rs" 18 | 19 | [dependencies] 20 | num = { workspace = true } 21 | pinwheel = { workspace = true } 22 | serde = { workspace = true } 23 | wasm-bindgen = { workspace = true } 24 | web-sys = { workspace = true } 25 | 26 | modelfox_ui = { workspace = true } -------------------------------------------------------------------------------- /crates/www/routes/index/common/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod tuning; 2 | -------------------------------------------------------------------------------- /crates/www/routes/index/common/tuning.css: -------------------------------------------------------------------------------- 1 | .tuning-grid { 2 | display: grid; 3 | gap: 1rem; 4 | } 5 | 6 | .tuning-number-chart-grid { 7 | display: grid; 8 | gap: 1rem; 9 | } 10 | 11 | @media (max-width: 1023px) { 12 | .tuning-number-chart-grid { 13 | grid: 14 | "accuracy accuracy" auto "precision recall" auto / 15 | minmax(0, 1fr) minmax(0, 1fr); 16 | } 17 | } 18 | 19 | @media (min-width: 1024px) { 20 | .tuning-number-chart-grid { 21 | grid: 22 | "accuracy precision recall" auto / 23 | minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /crates/www/routes/index/server/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_www_index_server" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = false 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [lib] 17 | path = "lib.rs" 18 | 19 | [dependencies] 20 | futures = { workspace = true } 21 | pinwheel = { workspace = true } 22 | sunfish = { workspace = true } 23 | 24 | modelfox_charts = { workspace = true } 25 | modelfox_finite = { workspace = true } 26 | modelfox_ui = { workspace = true } 27 | 28 | modelfox_www_index_common = { path = "../common" } 29 | modelfox_www_layouts = { path = "../../../layouts" } 30 | modelfox_www_ui = { path = "../../../ui" } 31 | -------------------------------------------------------------------------------- /crates/www/routes/index/server/inspection.css: -------------------------------------------------------------------------------- 1 | .inspection-metrics-wrapper { 2 | display: grid; 3 | gap: 1rem; 4 | } 5 | 6 | @media (max-width: 1023px) { 7 | .inspection-metrics-wrapper { 8 | grid: auto auto auto / auto; 9 | grid-template-areas: 10 | "accuracy" 11 | "pr" 12 | "roc"; 13 | } 14 | } 15 | 16 | @media (min-width: 1024px) { 17 | .inspection-metrics-wrapper { 18 | grid: auto auto / minmax(0, 1fr) minmax(0, 1fr); 19 | grid-template-areas: 20 | "accuracy accuracy" 21 | "pr roc"; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /crates/www/routes/index/server/lib.rs: -------------------------------------------------------------------------------- 1 | use pinwheel::prelude::*; 2 | 3 | mod inspection; 4 | mod monitoring; 5 | mod page; 6 | mod predict; 7 | mod production_metrics; 8 | mod production_predictions; 9 | mod production_stats; 10 | mod train; 11 | mod tuning; 12 | 13 | pub fn init() -> sunfish::Route { 14 | sunfish::Route::new_static(|_| html(self::page::Page)) 15 | } 16 | -------------------------------------------------------------------------------- /crates/www/routes/index/server/production_metrics.css: -------------------------------------------------------------------------------- 1 | .production-metrics-wrapper { 2 | display: grid; 3 | gap: 1rem; 4 | } 5 | 6 | @media (max-width: 1023px) { 7 | .production-metrics-wrapper { 8 | grid: auto auto auto / auto; 9 | grid-template-areas: 10 | "accuracy" 11 | "precision"; 12 | } 13 | } 14 | 15 | @media (min-width: 1024px) { 16 | .production-metrics-wrapper { 17 | grid: auto auto / minmax(0, 1fr) minmax(0, 1fr); 18 | grid-template-areas: "accuracy precision"; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /crates/www/routes/index/server/production_predictions.css: -------------------------------------------------------------------------------- 1 | .production-explanations-grid { 2 | display: grid; 3 | gap: 1rem; 4 | grid-template-areas: 5 | "prediction probability" 6 | "feature-contributions feature-contributions"; 7 | } 8 | -------------------------------------------------------------------------------- /crates/www/routes/index/server/production_stats.css: -------------------------------------------------------------------------------- 1 | .production-stats-wrapper { 2 | display: grid; 3 | gap: 1rem; 4 | } 5 | 6 | @media (max-width: 1023px) { 7 | .production-stats-wrapper { 8 | grid: auto auto auto auto / auto; 9 | grid-template-areas: 10 | "number-alert" 11 | "number" 12 | "enum-alert" 13 | "enum"; 14 | } 15 | } 16 | 17 | @media (min-width: 1024px) { 18 | .production-stats-wrapper { 19 | grid: auto auto / minmax(0, 1fr) minmax(0, 1fr); 20 | grid-template-areas: 21 | "number-alert enum-alert" 22 | "number enum"; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /crates/www/routes/index/server/train.txt: -------------------------------------------------------------------------------- 1 | $ modelfox train --file heart_disease.csv --target diagnosis 2 | ✅ Loading train data. 3 | ✅ Loading test data. 4 | ✅ Shuffling train data. 5 | ✅ Shuffling test data. 6 | ✅ Inferring column types. 7 | ✅ Computing train stats. 8 | ✅ Computing test stats. 9 | ✅ Computing baseline metrics. 10 | ✅ Computing features. 11 | info: Press ctrl-c to stop early and save the best model trained so far. 12 | ✅ Training model 1 of 8. 13 | ✅ Training model 2 of 8. 14 | ✅ Training model 3 of 8. 15 | ✅ Computing model comparison features. 16 | ✅ Computing comparison metric. 17 | ✅ Computing features. 18 | 🚂 Training model 4 of 8. 19 | [==========================================> ] 20 | -------------------------------------------------------------------------------- /crates/www/routes/index/server/training_stats.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /crates/www/routes/pricing/server/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_www_pricing_server" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = false 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [lib] 17 | path = "lib.rs" 18 | 19 | [dependencies] 20 | pinwheel = { workspace = true } 21 | sunfish = { workspace = true } 22 | 23 | modelfox_ui = { workspace = true } 24 | 25 | modelfox_www_layouts = { path = "../../../layouts" } -------------------------------------------------------------------------------- /crates/www/routes/pricing/server/lib.rs: -------------------------------------------------------------------------------- 1 | use pinwheel::prelude::*; 2 | 3 | mod page; 4 | 5 | pub fn init() -> sunfish::Route { 6 | sunfish::Route::new_static(|_| html(self::page::Page)) 7 | } 8 | -------------------------------------------------------------------------------- /crates/www/static/blog/introducing_tangram/architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modelfoxdotdev/modelfox/ec5d86b0a0557859231fd0a2cf98fa5550828f22/crates/www/static/blog/introducing_tangram/architecture.png -------------------------------------------------------------------------------- /crates/www/static/blog/introducing_tangram/model_types.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modelfoxdotdev/modelfox/ec5d86b0a0557859231fd0a2cf98fa5550828f22/crates/www/static/blog/introducing_tangram/model_types.png -------------------------------------------------------------------------------- /crates/www/static/blog/introducing_tangram/steps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modelfoxdotdev/modelfox/ec5d86b0a0557859231fd0a2cf98fa5550828f22/crates/www/static/blog/introducing_tangram/steps.png -------------------------------------------------------------------------------- /crates/www/static/blog/introducing_tangram/today.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modelfoxdotdev/modelfox/ec5d86b0a0557859231fd0a2cf98fa5550828f22/crates/www/static/blog/introducing_tangram/today.png -------------------------------------------------------------------------------- /crates/www/static/blog/what_machine_learning_can_learn_from_ruby_on_rails/rails.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modelfoxdotdev/modelfox/ec5d86b0a0557859231fd0a2cf98fa5550828f22/crates/www/static/blog/what_machine_learning_can_learn_from_ruby_on_rails/rails.png -------------------------------------------------------------------------------- /crates/www/static/blog/writing_the_fastest_gbdt_library_in_rust/cache_hierarchy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modelfoxdotdev/modelfox/ec5d86b0a0557859231fd0a2cf98fa5550828f22/crates/www/static/blog/writing_the_fastest_gbdt_library_in_rust/cache_hierarchy.png -------------------------------------------------------------------------------- /crates/www/static/blog/writing_the_fastest_gbdt_library_in_rust/cores_column_wise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modelfoxdotdev/modelfox/ec5d86b0a0557859231fd0a2cf98fa5550828f22/crates/www/static/blog/writing_the_fastest_gbdt_library_in_rust/cores_column_wise.png -------------------------------------------------------------------------------- /crates/www/static/blog/writing_the_fastest_gbdt_library_in_rust/cores_row_wise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modelfoxdotdev/modelfox/ec5d86b0a0557859231fd0a2cf98fa5550828f22/crates/www/static/blog/writing_the_fastest_gbdt_library_in_rust/cores_row_wise.png -------------------------------------------------------------------------------- /crates/www/static/blog/writing_the_fastest_gbdt_library_in_rust/features_matrix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modelfoxdotdev/modelfox/ec5d86b0a0557859231fd0a2cf98fa5550828f22/crates/www/static/blog/writing_the_fastest_gbdt_library_in_rust/features_matrix.png -------------------------------------------------------------------------------- /crates/www/static/blog/writing_the_fastest_gbdt_library_in_rust/features_matrix_column_wise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modelfoxdotdev/modelfox/ec5d86b0a0557859231fd0a2cf98fa5550828f22/crates/www/static/blog/writing_the_fastest_gbdt_library_in_rust/features_matrix_column_wise.png -------------------------------------------------------------------------------- /crates/www/static/blog/writing_the_fastest_gbdt_library_in_rust/features_matrix_row_wise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modelfoxdotdev/modelfox/ec5d86b0a0557859231fd0a2cf98fa5550828f22/crates/www/static/blog/writing_the_fastest_gbdt_library_in_rust/features_matrix_row_wise.png -------------------------------------------------------------------------------- /crates/www/static/blog/writing_the_fastest_gbdt_library_in_rust/flame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modelfoxdotdev/modelfox/ec5d86b0a0557859231fd0a2cf98fa5550828f22/crates/www/static/blog/writing_the_fastest_gbdt_library_in_rust/flame.png -------------------------------------------------------------------------------- /crates/www/static/blog/writing_the_fastest_gbdt_library_in_rust/flamegraph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modelfoxdotdev/modelfox/ec5d86b0a0557859231fd0a2cf98fa5550828f22/crates/www/static/blog/writing_the_fastest_gbdt_library_in_rust/flamegraph.png -------------------------------------------------------------------------------- /crates/www/static/blog/writing_the_fastest_gbdt_library_in_rust/gbdt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modelfoxdotdev/modelfox/ec5d86b0a0557859231fd0a2cf98fa5550828f22/crates/www/static/blog/writing_the_fastest_gbdt_library_in_rust/gbdt.png -------------------------------------------------------------------------------- /crates/www/static/blog/writing_the_fastest_gbdt_library_in_rust/random_access.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modelfoxdotdev/modelfox/ec5d86b0a0557859231fd0a2cf98fa5550828f22/crates/www/static/blog/writing_the_fastest_gbdt_library_in_rust/random_access.png -------------------------------------------------------------------------------- /crates/www/static/blog/writing_the_fastest_gbdt_library_in_rust/training_time.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modelfoxdotdev/modelfox/ec5d86b0a0557859231fd0a2cf98fa5550828f22/crates/www/static/blog/writing_the_fastest_gbdt_library_in_rust/training_time.png -------------------------------------------------------------------------------- /crates/www/static/blog/writing_the_fastest_gbdt_library_in_rust/tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modelfoxdotdev/modelfox/ec5d86b0a0557859231fd0a2cf98fa5550828f22/crates/www/static/blog/writing_the_fastest_gbdt_library_in_rust/tree.png -------------------------------------------------------------------------------- /crates/www/static/blog/writing_the_fastest_gbdt_library_in_rust/tree_with_path.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modelfoxdotdev/modelfox/ec5d86b0a0557859231fd0a2cf98fa5550828f22/crates/www/static/blog/writing_the_fastest_gbdt_library_in_rust/tree_with_path.png -------------------------------------------------------------------------------- /crates/www/static/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modelfoxdotdev/modelfox/ec5d86b0a0557859231fd0a2cf98fa5550828f22/crates/www/static/favicon.png -------------------------------------------------------------------------------- /crates/www/static/jetbrainsmono.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modelfoxdotdev/modelfox/ec5d86b0a0557859231fd0a2cf98fa5550828f22/crates/www/static/jetbrainsmono.woff2 -------------------------------------------------------------------------------- /crates/www/ui/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_www_ui" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = false 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [lib] 17 | path = "lib.rs" 18 | 19 | [dependencies] 20 | pinwheel = { workspace = true } 21 | 22 | modelfox_ui = { workspace = true } 23 | -------------------------------------------------------------------------------- /crates/www/ui/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod logo; 2 | -------------------------------------------------------------------------------- /crates/zip/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_zip" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = true 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [lib] 17 | path = "lib.rs" 18 | -------------------------------------------------------------------------------- /crates/zip/lib.rs: -------------------------------------------------------------------------------- 1 | mod pzip; 2 | mod zip; 3 | -------------------------------------------------------------------------------- /crates/zip/pzip.rs: -------------------------------------------------------------------------------- 1 | #[macro_export] 2 | macro_rules! pzip { 3 | ($($e:expr),* $(,)*) => { 4 | rayon::iter::IntoParallelIterator::into_par_iter(($($e,)*)) 5 | }; 6 | } 7 | -------------------------------------------------------------------------------- /heart_disease.modelfox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modelfoxdotdev/modelfox/ec5d86b0a0557859231fd0a2cf98fa5550828f22/heart_disease.modelfox -------------------------------------------------------------------------------- /languages/c/.gitignore: -------------------------------------------------------------------------------- 1 | /docs 2 | /modelfox.h 3 | -------------------------------------------------------------------------------- /languages/c/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "libmodelfox" 5 | 6 | authors = { workspace = true } 7 | documentation = { workspace = true } 8 | edition = { workspace = true } 9 | homepage = { workspace = true } 10 | license = { workspace = true } 11 | publish = false 12 | repository = { workspace = true } 13 | version = { workspace = true } 14 | 15 | [lib] 16 | crate-type = ["cdylib", "staticlib"] 17 | name = "modelfox" 18 | path = "lib.rs" 19 | doc = false 20 | 21 | [dependencies] 22 | anyhow = { workspace = true } 23 | libc = { workspace = true } 24 | memmap = { workspace = true } 25 | serde = { workspace = true } 26 | serde_json = { workspace = true } 27 | 28 | modelfox_model = { workspace = true } 29 | modelfox_core = { workspace = true } 30 | -------------------------------------------------------------------------------- /languages/c/Doxyfile: -------------------------------------------------------------------------------- 1 | # EXAMPLE_PATH = examples 2 | # EXAMPLE_RECURSIVE = yes 3 | EXTRACT_ALL = yes 4 | GENERATE_LATEX = no 5 | HTML_OUTPUT = docs 6 | OPTIMIZE_OUTPUT_FOR_C = yes 7 | PROJECT_NAME = "ModelFox" 8 | QUIET = yes 9 | RECURSIVE = yes 10 | SHOW_FILES = yes 11 | USE_MDFILE_AS_MAINPAGE = "README.md" 12 | WARN_AS_ERROR = yes 13 | -------------------------------------------------------------------------------- /languages/c/README.md: -------------------------------------------------------------------------------- 1 | # ModelFox for C 2 | 3 | - [Watch the Video](https://www.modelfox.dev) 4 | - [Read the Docs](https://www.modelfox.dev/docs) 5 | 6 | The ModelFox C library makes it easy to make predictions with your ModelFox machine learning model from C. 7 | 8 | ## Usage 9 | 10 | To use modelfox from C, you need the libmodelfox dynamic or static library and modelfox.h header file, which you can install either with a package manager or manually. 11 | 12 | ### System install 13 | 14 | You can follow the install instructions for the modelfox cli, which will also install the modelfox libraries and headers here: [Install Instructions](https://www.modelfox.dev/docs/install). 15 | 16 | ### Manual install 17 | 18 | Alternatively, you can download the files manually from the modelfox releases on GitHub here: [GitHub releases](https://github.com/modelfoxdotdev/modelfox/releases). 19 | -------------------------------------------------------------------------------- /languages/c/cbindgen.toml: -------------------------------------------------------------------------------- 1 | documentation_style = "c++" 2 | header = "/** This header file defines the C API for libmodelfox, the ModelFox C library. */" 3 | language = "c" 4 | style = "type" 5 | -------------------------------------------------------------------------------- /languages/c/scripts/docs: -------------------------------------------------------------------------------- 1 | doxygen 2 | -------------------------------------------------------------------------------- /languages/c/scripts/release: -------------------------------------------------------------------------------- 1 | cp ../../dist/compile/x86_64-linux-gnu/modelfox.h modelfox.h 2 | -------------------------------------------------------------------------------- /languages/elixir/.formatter.exs: -------------------------------------------------------------------------------- 1 | # Used by "mix format" 2 | [ 3 | inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"] 4 | ] 5 | -------------------------------------------------------------------------------- /languages/elixir/.gitignore: -------------------------------------------------------------------------------- 1 | /_build 2 | /.elixir_ls 3 | /.fetch 4 | /*.ez 5 | /cover 6 | /deps 7 | /doc 8 | /docs 9 | /erl_crash.dump 10 | /priv 11 | /modelfox-*.tar 12 | /tmp 13 | -------------------------------------------------------------------------------- /languages/elixir/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_elixir" 5 | 6 | authors = { workspace = true } 7 | documentation = { workspace = true } 8 | edition = { workspace = true } 9 | homepage = { workspace = true } 10 | license = { workspace = true } 11 | publish = false 12 | repository = { workspace = true } 13 | version = { workspace = true } 14 | 15 | [lib] 16 | crate-type = ["cdylib"] 17 | name = "modelfox_elixir" 18 | path = "lib.rs" 19 | 20 | [dependencies] 21 | anyhow = { workspace = true } 22 | erl_nif = { workspace = true } 23 | memmap = { workspace = true } 24 | once_cell = { workspace = true } 25 | serde = { workspace = true } 26 | 27 | modelfox_core = { workspace = true } 28 | modelfox_model = { workspace = true } -------------------------------------------------------------------------------- /languages/elixir/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap(); 3 | if target_os == "macos" { 4 | println!("cargo:rustc-cdylib-link-arg=-undefined"); 5 | println!("cargo:rustc-cdylib-link-arg=dynamic_lookup"); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /languages/elixir/examples/advanced/.formatter.exs: -------------------------------------------------------------------------------- 1 | # Used by "mix format" 2 | [ 3 | inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"] 4 | ] 5 | -------------------------------------------------------------------------------- /languages/elixir/examples/advanced/.gitignore: -------------------------------------------------------------------------------- 1 | /_build/ 2 | /cover/ 3 | /deps/ 4 | /doc/ 5 | /.fetch 6 | erl_crash.dump 7 | *.ez 8 | basic-*.tar 9 | /tmp/ 10 | -------------------------------------------------------------------------------- /languages/elixir/examples/advanced/README.md: -------------------------------------------------------------------------------- 1 | # Advanced 2 | 3 | This example demonstrates logging predictions and true values to the ModelFox app. Before running the example, run `modelfox app` to start the app running locally, open `http://localhost:8080` in your browser, and upload the file `heart_disease.modelfox` to it. 4 | 5 | To run the example: 6 | 7 | ``` 8 | $ mix deps.get 9 | $ mix run 10 | ``` 11 | 12 | Now if you refresh the production stats or production metrics tabs for the model you uploaded, you should see predictions and true values. 13 | 14 | For more information, [read the docs](https://www.modelfox.dev/docs). 15 | -------------------------------------------------------------------------------- /languages/elixir/examples/advanced/mix.exs: -------------------------------------------------------------------------------- 1 | defmodule Example.MixProject do 2 | use Mix.Project 3 | 4 | def project do 5 | [ 6 | app: :example, 7 | version: "0.1.0", 8 | elixir: "~> 1.12", 9 | start_permanent: Mix.env() == :prod, 10 | deps: [ 11 | {:modelfox, "~> 0.6.1"} 12 | ] 13 | ] 14 | end 15 | 16 | def application do 17 | [ 18 | extra_applications: [:logger], 19 | mod: {Example, []} 20 | ] 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /languages/elixir/examples/basic/.formatter.exs: -------------------------------------------------------------------------------- 1 | # Used by "mix format" 2 | [ 3 | inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"] 4 | ] 5 | -------------------------------------------------------------------------------- /languages/elixir/examples/basic/.gitignore: -------------------------------------------------------------------------------- 1 | /_build/ 2 | /cover/ 3 | /deps/ 4 | /doc/ 5 | /.fetch 6 | erl_crash.dump 7 | *.ez 8 | basic-*.tar 9 | /tmp/ 10 | -------------------------------------------------------------------------------- /languages/elixir/examples/basic/README.md: -------------------------------------------------------------------------------- 1 | # Basic 2 | 3 | This example demonstrates loading a model from a `.modelfox` file and making a prediction. 4 | 5 | To run the example: 6 | 7 | ``` 8 | $ mix deps.get 9 | $ mix run 10 | ``` 11 | -------------------------------------------------------------------------------- /languages/elixir/examples/basic/mix.exs: -------------------------------------------------------------------------------- 1 | defmodule Example.MixProject do 2 | use Mix.Project 3 | 4 | def project do 5 | [ 6 | app: :example, 7 | version: "0.1.0", 8 | elixir: "~> 1.12", 9 | start_permanent: Mix.env() == :prod, 10 | deps: [ 11 | {:modelfox, "~> 0.8.0"} 12 | ] 13 | ] 14 | end 15 | 16 | def application do 17 | [ 18 | extra_applications: [:logger], 19 | mod: {Example, []} 20 | ] 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /languages/elixir/scripts/build: -------------------------------------------------------------------------------- 1 | rm -rf priv/ 2 | install -D ../../dist/compile/x86_64-linux-gnu/libmodelfox_elixir.so priv/x86_64-linux-gnu/libmodelfox_elixir.so 3 | install -D ../../dist/compile/aarch64-linux-gnu/libmodelfox_elixir.so priv/aarch64-linux-gnu/libmodelfox_elixir.so 4 | install -D ../../dist/compile/x86_64-linux-musl/libmodelfox_elixir.so priv/x86_64-linux-musl/libmodelfox_elixir.so 5 | install -D ../../dist/compile/aarch64-linux-musl/libmodelfox_elixir.so priv/aarch64-linux-musl/libmodelfox_elixir.so 6 | install -D ../../dist/compile/x86_64-macos/libmodelfox_elixir.dylib priv/x86_64-macos/libmodelfox_elixir.so 7 | install -D ../../dist/compile/aarch64-macos/libmodelfox_elixir.dylib priv/aarch64-macos/libmodelfox_elixir.so 8 | install -D ../../dist/compile/x86_64-windows-msvc/modelfox_elixir.dll priv/x86_64-windows-msvc/modelfox_elixir.dll 9 | -------------------------------------------------------------------------------- /languages/elixir/scripts/dev: -------------------------------------------------------------------------------- 1 | mix deps.get 2 | cargo build -p modelfox_elixir 3 | rm -rf priv/ 4 | install -D ../../target/debug/libmodelfox_elixir.so priv/x86_64-linux-gnu/libmodelfox_elixir.so 5 | -------------------------------------------------------------------------------- /languages/elixir/scripts/docs: -------------------------------------------------------------------------------- 1 | scripts/dev 2 | mix docs -o docs 3 | -------------------------------------------------------------------------------- /languages/elixir/scripts/fmt: -------------------------------------------------------------------------------- 1 | mix format 2 | -------------------------------------------------------------------------------- /languages/elixir/scripts/release: -------------------------------------------------------------------------------- 1 | mix hex.publish 2 | -------------------------------------------------------------------------------- /languages/elixir/test/test_helper.exs: -------------------------------------------------------------------------------- 1 | ExUnit.start() 2 | -------------------------------------------------------------------------------- /languages/go/.gitignore: -------------------------------------------------------------------------------- 1 | /dist 2 | /docs 3 | /libmodelfox 4 | -------------------------------------------------------------------------------- /languages/go/examples/advanced/README.md: -------------------------------------------------------------------------------- 1 | # Advanced 2 | 3 | This example demonstrates logging predictions and true values to the ModelFox app. Before running the example, run `modelfox app` to start the app running locally, open `http://localhost:8080` in your browser, and upload the file `heart_disease.modelfox` to it. 4 | 5 | To run the example: 6 | 7 | ``` 8 | $ MODELFOX_URL=http://localhost:8080 go run main.go 9 | ``` 10 | 11 | Now if you refresh the production stats or production metrics tabs for the model you uploaded, you should see predictions and true values. 12 | 13 | For more information, [read the docs](https://www.modelfox.dev/docs). 14 | -------------------------------------------------------------------------------- /languages/go/examples/advanced/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/modelfoxdotdev/modelfox-go/examples/advanced 2 | 3 | go 1.16 4 | 5 | require github.com/modelfoxdotdev/modelfox-go v0.6.1 6 | -------------------------------------------------------------------------------- /languages/go/examples/basic/README.md: -------------------------------------------------------------------------------- 1 | # Basic 2 | 3 | This example demonstrates loading a model from a `.modelfox` file and making a prediction. 4 | 5 | ``` 6 | $ go run main.go 7 | ``` 8 | -------------------------------------------------------------------------------- /languages/go/examples/basic/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/modelfoxdotdev/modelfox-go/examples/basic 2 | 3 | go 1.16 4 | 5 | require github.com/modelfoxdotdev/modelfox-go v0.7.0 6 | -------------------------------------------------------------------------------- /languages/go/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/modelfoxdotdev/modelfox-go 2 | 3 | go 1.16 4 | 5 | require golang.org/x/tools v0.1.0 // indirect 6 | -------------------------------------------------------------------------------- /languages/go/scripts/dev: -------------------------------------------------------------------------------- 1 | cargo build -p libmodelfox 2 | rm -rf libmodelfox/ 3 | install -D ../../target/debug/libmodelfox.a libmodelfox/x86_64-linux-musl/libmodelfox.a 4 | cbindgen ../c > libmodelfox/x86_64-linux-musl/modelfox.h 5 | -------------------------------------------------------------------------------- /languages/go/scripts/docs: -------------------------------------------------------------------------------- 1 | pushd /tmp 2 | go get golang.org/x/tools/cmd/godoc 3 | go get code.rocketnine.space/tslocum/godoc-static 4 | popd 5 | mkdir docs 6 | PATH=~/go/bin:$PATH godoc-static -destination=docs . 7 | rm docs/docs.zip 8 | echo '' > docs/index.html 9 | -------------------------------------------------------------------------------- /languages/go/scripts/fmt: -------------------------------------------------------------------------------- 1 | go fmt 2 | -------------------------------------------------------------------------------- /languages/go/scripts/release: -------------------------------------------------------------------------------- 1 | if [ ! -e dist ]; then 2 | git clone git@github.com:modelfoxdotdev/modelfox-go dist 3 | fi 4 | rsync --archive --delete --exclude .git --exclude .gitignore --exclude dist --exclude docs --exclude scripts . dist 5 | git -C dist add --all 6 | git -C dist commit 7 | git -C dist push 8 | git -C dist tag v$VERSION 9 | git -C dist push origin v$VERSION 10 | -------------------------------------------------------------------------------- /languages/javascript/.gitignore: -------------------------------------------------------------------------------- 1 | /dist 2 | /docs 3 | /node_modules 4 | -------------------------------------------------------------------------------- /languages/javascript/.npmignore: -------------------------------------------------------------------------------- 1 | /docs 2 | /examples 3 | /node_modules 4 | -------------------------------------------------------------------------------- /languages/javascript/entrypoints/bundler.js: -------------------------------------------------------------------------------- 1 | import { setNative } from "./common.js" 2 | 3 | export * from "./common.js" 4 | 5 | setNative(await import("./modelfox_wasm.js")) 6 | -------------------------------------------------------------------------------- /languages/javascript/entrypoints/deno.ts: -------------------------------------------------------------------------------- 1 | import { setNative } from "./common.ts" 2 | 3 | export * from "./common.ts" 4 | 5 | setNative(await import("./modelfox_wasm.js")) 6 | -------------------------------------------------------------------------------- /languages/javascript/entrypoints/web.js: -------------------------------------------------------------------------------- 1 | import { setNative } from "./common.js" 2 | import init, * as native from "./modelfox_wasm.js" 3 | 4 | export * from "./common.js" 5 | 6 | await init() 7 | setNative(native) 8 | -------------------------------------------------------------------------------- /languages/javascript/examples/bundler/webpack/.gitignore: -------------------------------------------------------------------------------- 1 | /dist 2 | -------------------------------------------------------------------------------- /languages/javascript/examples/bundler/webpack/README.md: -------------------------------------------------------------------------------- 1 | # Webpack 2 | 3 | This example demonstrates loading a model from a `.modelfox` file and making a prediction in an application bundled with Webpack. 4 | 5 | To run the example: 6 | 7 | ``` 8 | $ npm install 9 | $ npm start 10 | ``` 11 | -------------------------------------------------------------------------------- /languages/javascript/examples/bundler/webpack/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /languages/javascript/examples/bundler/webpack/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "ModelFox", 3 | "devDependencies": { 4 | "@modelfoxdotdev/modelfox": "*", 5 | "webpack": "^5.41.1", 6 | "webpack-cli": "^4.7.2", 7 | "webpack-dev-server": "^4.7.2" 8 | }, 9 | "license": "MIT", 10 | "main": "index.js", 11 | "name": "@modelfoxdotdev/modelfox-example-bundler-webpack", 12 | "scripts": { 13 | "start": "webpack serve" 14 | }, 15 | "version": "0.0.0" 16 | } -------------------------------------------------------------------------------- /languages/javascript/examples/bundler/webpack/webpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | mode: "production", 3 | entry: "./index.js", 4 | experiments: { 5 | asyncWebAssembly: true, 6 | topLevelAwait: true, 7 | }, 8 | module: { 9 | rules: [ 10 | { 11 | test: /\.modelfox$/, 12 | type: "asset/resource", 13 | }, 14 | ], 15 | }, 16 | } 17 | -------------------------------------------------------------------------------- /languages/javascript/examples/deno/basic/README.md: -------------------------------------------------------------------------------- 1 | # Basic 2 | 3 | This example demonstrates loading a model from a `.modelfox` file and making a prediction. 4 | 5 | To run the example: 6 | 7 | ``` 8 | $ deno run --allow-read main.ts 9 | ``` 10 | -------------------------------------------------------------------------------- /languages/javascript/examples/deno/basic/dev.json: -------------------------------------------------------------------------------- 1 | { 2 | "imports": { 3 | "https://js.modelfox.dev/deno": "../../../dist/deno/mod.ts" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /languages/javascript/examples/node/advanced/README.md: -------------------------------------------------------------------------------- 1 | # Advanced 2 | 3 | This example demonstrates logging predictions and true values to the ModelFox app. Before running the example, run `modelfox app` to start the app running locally, open `http://localhost:8080` in your browser, and upload the file `heart_disease.modelfox` to it. 4 | 5 | To run the example: 6 | 7 | ``` 8 | $ npm install 9 | $ MODELFOX_URL=http://localhost:8080 npm start 10 | ``` 11 | 12 | Now if you refresh the production stats or production metrics tabs for the model you uploaded, you should see predictions and true values. 13 | 14 | For more information, [read the docs](https://www.modelfox.dev/docs). 15 | -------------------------------------------------------------------------------- /languages/javascript/examples/node/advanced/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "ModelFox", 3 | "dependencies": { 4 | "@modelfoxdotdev/modelfox": "*" 5 | }, 6 | "license": "MIT", 7 | "main": "main.js", 8 | "name": "@modelfoxdotdev/modelfox-example-node-advanced", 9 | "scripts": { 10 | "start": "node main.js" 11 | }, 12 | "type": "module", 13 | "version": "0.0.0" 14 | } -------------------------------------------------------------------------------- /languages/javascript/examples/node/basic/README.md: -------------------------------------------------------------------------------- 1 | # Basic 2 | 3 | This example demonstrates loading a model from a `.modelfox` file and making a prediction. 4 | 5 | To run the example: 6 | 7 | ``` 8 | $ npm install 9 | $ npm start 10 | ``` 11 | -------------------------------------------------------------------------------- /languages/javascript/examples/node/basic/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "ModelFox", 3 | "dependencies": { 4 | "@modelfoxdotdev/modelfox": "*" 5 | }, 6 | "license": "MIT", 7 | "main": "main.js", 8 | "name": "@modelfoxdotdev/modelfox-example-node-basic", 9 | "scripts": { 10 | "start": "node main.js" 11 | }, 12 | "type": "module", 13 | "version": "0.0.0" 14 | } -------------------------------------------------------------------------------- /languages/javascript/examples/node/commonjs/README.md: -------------------------------------------------------------------------------- 1 | # commonjs 2 | 3 | This example demonstrates loading a model from a `.modelfox` file and making a prediction in an npm package that uses commonjs modules. 4 | 5 | To run the example: 6 | 7 | ``` 8 | $ npm install 9 | $ npm start 10 | ``` 11 | -------------------------------------------------------------------------------- /languages/javascript/examples/node/commonjs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "ModelFox", 3 | "dependencies": { 4 | "@modelfoxdotdev/modelfox": "*" 5 | }, 6 | "license": "MIT", 7 | "main": "main.js", 8 | "name": "@modelfoxdotdev/modelfox-example-node-commonjs", 9 | "scripts": { 10 | "start": "node main.js" 11 | }, 12 | "version": "0.0.0" 13 | } -------------------------------------------------------------------------------- /languages/javascript/examples/node/typescript/.gitignore: -------------------------------------------------------------------------------- 1 | /main.js 2 | -------------------------------------------------------------------------------- /languages/javascript/examples/node/typescript/README.md: -------------------------------------------------------------------------------- 1 | # Typescript 2 | 3 | This example shows how to make predictions with your ModelFox machine learning model in an app written in [TypeScript](https://www.typescriptlang.org). It demonstrates how to provide types for the input and output of a model. 4 | 5 | To build and run the example: 6 | 7 | ``` 8 | $ npm install 9 | $ npm run build 10 | $ npm start 11 | ``` 12 | -------------------------------------------------------------------------------- /languages/javascript/examples/node/typescript/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "ModelFox", 3 | "dependencies": { 4 | "@modelfoxdotdev/modelfox": "*" 5 | }, 6 | "devDependencies": { 7 | "@types/node": "^17.0.7", 8 | "typescript": "^4.3.5" 9 | }, 10 | "license": "MIT", 11 | "main": "main.js", 12 | "name": "@modelfoxdotdev/modelfox-example-node-typescript", 13 | "scripts": { 14 | "build": "tsc", 15 | "start": "node main.js" 16 | }, 17 | "type": "module", 18 | "version": "0.0.0" 19 | } -------------------------------------------------------------------------------- /languages/javascript/examples/node/typescript/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "esnext", 4 | "target": "esnext", 5 | "moduleResolution": "node" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /languages/javascript/examples/web/basic/README.md: -------------------------------------------------------------------------------- 1 | # Basic 2 | 3 | This example demonstrates loading a model from a `.modelfox` file and making a prediction. 4 | 5 | To run the example: 6 | 7 | ``` 8 | $ npx light-server -s . -p 8080 9 | ``` 10 | -------------------------------------------------------------------------------- /languages/javascript/examples/web/basic/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /languages/javascript/node/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_node" 5 | 6 | authors = { workspace = true } 7 | documentation = { workspace = true } 8 | edition = { workspace = true } 9 | homepage = { workspace = true } 10 | license = { workspace = true } 11 | publish = false 12 | repository = { workspace = true } 13 | version = { workspace = true } 14 | 15 | [lib] 16 | crate-type = ["cdylib"] 17 | name = "modelfox_node" 18 | path = "lib.rs" 19 | 20 | [build-dependencies] 21 | reqwest = { workspace = true } 22 | 23 | [dependencies] 24 | anyhow = { workspace = true } 25 | memmap = { workspace = true } 26 | node_api = { workspace = true } 27 | serde = { workspace = true } 28 | 29 | modelfox_core = { workspace = true } 30 | modelfox_model = { workspace = true } 31 | -------------------------------------------------------------------------------- /languages/javascript/scripts/docs: -------------------------------------------------------------------------------- 1 | npx typedoc common.ts 2 | -------------------------------------------------------------------------------- /languages/javascript/scripts/fmt: -------------------------------------------------------------------------------- 1 | npx prettier --write src 2 | -------------------------------------------------------------------------------- /languages/javascript/scripts/release: -------------------------------------------------------------------------------- 1 | # publish npm package 2 | npm publish --access public 3 | -------------------------------------------------------------------------------- /languages/javascript/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "declaration": true, 4 | "lib": ["esnext", "dom"], 5 | "module": "esnext", 6 | "moduleResolution": "node", 7 | "skipLibCheck": true, 8 | "sourceMap": true, 9 | "strict": true, 10 | "target": "esnext" 11 | }, 12 | "include": ["common.ts"] 13 | } 14 | -------------------------------------------------------------------------------- /languages/javascript/wasm/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_wasm" 5 | 6 | authors = { workspace = true } 7 | documentation = { workspace = true } 8 | edition = { workspace = true } 9 | homepage = { workspace = true } 10 | license = { workspace = true } 11 | publish = false 12 | repository = { workspace = true } 13 | version = { workspace = true } 14 | 15 | [lib] 16 | crate-type = ["cdylib"] 17 | name = "modelfox_wasm" 18 | path = "lib.rs" 19 | 20 | [dependencies] 21 | anyhow = { workspace = true } 22 | serde = { workspace = true } 23 | serde_bytes = { workspace = true } 24 | serde-wasm-bindgen = { workspace = true } 25 | wasm-bindgen = { workspace = true, features = ["serde-serialize"] } 26 | 27 | modelfox_core = { workspace = true } 28 | modelfox_model = { workspace = true } -------------------------------------------------------------------------------- /languages/php/.gitignore: -------------------------------------------------------------------------------- 1 | /.phpdoc/ 2 | /composer.phar 3 | /dist/ 4 | /docs/ 5 | /src/libmodelfox 6 | /vendor/ 7 | -------------------------------------------------------------------------------- /languages/php/.php_cs-fixer.dist.php: -------------------------------------------------------------------------------- 1 | setRiskyAllowed(true) 5 | ->setRules([ 6 | // Rulesets 7 | '@PSR2' => true, 8 | '@PhpCsFixer' => true, 9 | '@PhpCsFixer:risky' => true, 10 | '@PHP56Migration:risky' => true, 11 | '@PHPUnit57Migration:risky' => true, 12 | 13 | // Additional rules 14 | 'fopen_flags' => true, 15 | 'linebreak_after_opening_tag' => true, 16 | 'native_constant_invocation' => true, 17 | 'native_function_invocation' => true, 18 | ]); 19 | -------------------------------------------------------------------------------- /languages/php/examples/advanced/.gitignore: -------------------------------------------------------------------------------- 1 | /composer.phar 2 | /vendor/ 3 | -------------------------------------------------------------------------------- /languages/php/examples/advanced/README.md: -------------------------------------------------------------------------------- 1 | # Advanced 2 | 3 | This example demonstrates logging predictions and true values to the ModelFox app. Before running the example, run `modelfox app` to start the app running locally, open `http://localhost:8080` in your browser, and upload the file `heart_disease.modelfox` to it. 4 | 5 | To run the example: 6 | 7 | ``` 8 | $ composer install 9 | $ MODELFOX_URL=http://localhost:8080 php src/main.php 10 | ``` 11 | 12 | Now if you refresh the production stats or production metrics tabs for the model you uploaded, you should see predictions and true values. 13 | 14 | For more information, [read the docs](https://www.modelfox.dev/docs). 15 | -------------------------------------------------------------------------------- /languages/php/examples/advanced/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "modelfox/advanced-example", 3 | "description": "Advanced usage example ", 4 | "type": "project", 5 | "require": { 6 | "modelfox/modelfox": "0.8.0" 7 | }, 8 | "license": "MIT", 9 | "autoload": { 10 | "psr-4": { 11 | "ModelFox\\AdvancedExample\\": "src/" 12 | } 13 | }, 14 | "authors": [ 15 | { 16 | "name": "ModelFox", 17 | "email": "root@modelfox.dev" 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /languages/php/examples/basic/.gitignore: -------------------------------------------------------------------------------- 1 | /composer.phar 2 | /vendor/ 3 | -------------------------------------------------------------------------------- /languages/php/examples/basic/README.md: -------------------------------------------------------------------------------- 1 | # Basic 2 | 3 | This example demonstrates loading a model from a `.modelfox` file and making a prediction. 4 | 5 | To run the example: 6 | 7 | ``` 8 | $ composer install 9 | $ php src/main.php 10 | ``` 11 | -------------------------------------------------------------------------------- /languages/php/examples/basic/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "modelfox/basic-example", 3 | "description": "This example demonstrates loading a model from a `.modelfox` file and making a prediction.", 4 | "type": "project", 5 | "require": { 6 | "modelfox/modelfox": "0.8.0" 7 | }, 8 | "license": "MIT", 9 | "autoload": { 10 | "psr-4": { 11 | "ModelFox\\BasicExample\\": "src/" 12 | } 13 | }, 14 | "authors": [ 15 | { 16 | "name": "ModelFox", 17 | "email": "root@modelfox.dev" 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /languages/php/scripts/dev: -------------------------------------------------------------------------------- 1 | composer install 2 | cargo build -p libmodelfox 3 | rm -rf src/libmodelfox/ 4 | install -D ../../target/debug/libmodelfox.so src/libmodelfox/x86_64-linux-gnu/libmodelfox.so 5 | cbindgen ../c > src/libmodelfox/x86_64-linux-gnu/modelfox.h 6 | -------------------------------------------------------------------------------- /languages/php/scripts/docs: -------------------------------------------------------------------------------- 1 | composer install 2 | curl -sfL https://github.com/phpDocumentor/phpDocumentor/releases/download/v3.1.2/phpDocumentor.phar -o vendor/bin/phpdoc 3 | chmod +x vendor/bin/phpdoc 4 | vendor/bin/phpdoc 5 | -------------------------------------------------------------------------------- /languages/php/scripts/fmt: -------------------------------------------------------------------------------- 1 | composer install 2 | vendor/bin/php-cs-fixer fix -v --using-cache=no . 3 | -------------------------------------------------------------------------------- /languages/php/scripts/release: -------------------------------------------------------------------------------- 1 | if [ ! -e dist ]; then 2 | git clone git@github.com:modelfoxdotdev/modelfox-php dist 3 | fi 4 | rsync --archive --delete --exclude .git --exclude .gitignore --exclude dist --exclude docs --exclude .phpdoc --exclude scripts --exclude vendor . dist 5 | git -C dist add --all 6 | git -C dist commit 7 | git -C dist push 8 | git -C dist tag v$VERSION 9 | git -C dist push origin v$VERSION 10 | -------------------------------------------------------------------------------- /languages/php/src/Bigram.php: -------------------------------------------------------------------------------- 1 | token_a = $token_a; 26 | $this->token_b = $token_b; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /languages/php/src/LoadModelOptions.php: -------------------------------------------------------------------------------- 1 | modelfox_url = $modelfox_url; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /languages/php/src/Ngram.php: -------------------------------------------------------------------------------- 1 | token = $token; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /languages/python/.gitignore: -------------------------------------------------------------------------------- 1 | /.mypy_cache 2 | /.venv 3 | /dist 4 | /docs 5 | /modelfox.egg-info 6 | /modelfox/modelfox_python.pyd 7 | /modelfox/modelfox_python.so 8 | __pycache__ 9 | -------------------------------------------------------------------------------- /languages/python/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_python" 5 | 6 | authors = { workspace = true } 7 | edition = { workspace = true } 8 | homepage = { workspace = true } 9 | publish = false 10 | repository = { workspace = true } 11 | version = { workspace = true } 12 | 13 | [lib] 14 | crate-type = ["cdylib"] 15 | name = "modelfox_python" 16 | path = "lib.rs" 17 | 18 | [dependencies] 19 | anyhow = { workspace = true } 20 | chrono = { workspace = true } 21 | memmap = { workspace = true } 22 | pyo3 = { workspace = true } 23 | reqwest = { workspace = true } 24 | serde = { workspace = true } 25 | serde_json = { workspace = true } 26 | url = { workspace = true } 27 | 28 | modelfox_core = { workspace = true } 29 | modelfox_model = { workspace = true } -------------------------------------------------------------------------------- /languages/python/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include Cargo.toml lib.rs 2 | -------------------------------------------------------------------------------- /languages/python/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap(); 3 | if target_os == "macos" { 4 | println!("cargo:rustc-cdylib-link-arg=-undefined"); 5 | println!("cargo:rustc-cdylib-link-arg=dynamic_lookup"); 6 | } 7 | if target_os == "windows" { 8 | println!( 9 | "cargo:rustc-link-search=native={}", 10 | std::env::var("CARGO_MANIFEST_DIR").unwrap() 11 | ); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /languages/python/examples/advanced/.gitignore: -------------------------------------------------------------------------------- 1 | /.venv 2 | -------------------------------------------------------------------------------- /languages/python/examples/advanced/README.md: -------------------------------------------------------------------------------- 1 | # Advanced 2 | 3 | This example demonstrates logging predictions and true values to the ModelFox app. Before running the example, run `modelfox app` to start the app running locally, open `http://localhost:8080` in your browser, and upload the file `heart_disease.modelfox` to it. 4 | 5 | To run the example: 6 | 7 | ``` 8 | $ pip install -r requirements.txt 9 | $ MODELFOX_URL=http://localhost:8080 python main.py 10 | ``` 11 | 12 | Now if you refresh the production stats or production metrics tabs for the model you uploaded, you should see predictions and true values. 13 | 14 | For more information, [read the docs](https://www.modelfox.dev/docs). 15 | -------------------------------------------------------------------------------- /languages/python/examples/advanced/requirements.txt: -------------------------------------------------------------------------------- 1 | modelfox 2 | -------------------------------------------------------------------------------- /languages/python/examples/basic/.gitignore: -------------------------------------------------------------------------------- 1 | /.mypy_cache 2 | /.venv 3 | -------------------------------------------------------------------------------- /languages/python/examples/basic/README.md: -------------------------------------------------------------------------------- 1 | # Basic 2 | 3 | This example demonstrates loading a model from a `.modelfox` file and making a prediction. 4 | 5 | To run the example: 6 | 7 | ``` 8 | $ pip install -r requirements.txt 9 | $ python main.py 10 | ``` 11 | -------------------------------------------------------------------------------- /languages/python/examples/basic/requirements.txt: -------------------------------------------------------------------------------- 1 | modelfox 2 | -------------------------------------------------------------------------------- /languages/python/metadata.toml: -------------------------------------------------------------------------------- 1 | author = "ModelFox" 2 | author_email = "root@modelfox.dev" 3 | classifiers = [ 4 | "License :: OSI Approved :: MIT License", 5 | "Operating System :: OS Independent", 6 | "Programming Language :: Python", 7 | ] 8 | description = "README.md" 9 | description_content_type = "text/markdown" 10 | license = "LICENSE" 11 | name = "modelfox" 12 | summary = "ModelFox for Python" 13 | version = "0.8.0" 14 | 15 | [project_url] 16 | homepage = "https://modelfox.dev" 17 | -------------------------------------------------------------------------------- /languages/python/modelfox/__init__.py: -------------------------------------------------------------------------------- 1 | from .modelfox_python import * 2 | -------------------------------------------------------------------------------- /languages/python/modelfox/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modelfoxdotdev/modelfox/ec5d86b0a0557859231fd0a2cf98fa5550828f22/languages/python/modelfox/py.typed -------------------------------------------------------------------------------- /languages/python/modelfox/tangram_python.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modelfoxdotdev/modelfox/ec5d86b0a0557859231fd0a2cf98fa5550828f22/languages/python/modelfox/tangram_python.so -------------------------------------------------------------------------------- /languages/python/module.html.jinja2: -------------------------------------------------------------------------------- 1 | {% extends "default/module.html.jinja2" %} 2 | {% block nav_title %} 3 | 4 | {% endblock %} 5 | -------------------------------------------------------------------------------- /languages/python/python3.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modelfoxdotdev/modelfox/ec5d86b0a0557859231fd0a2cf98fa5550828f22/languages/python/python3.lib -------------------------------------------------------------------------------- /languages/python/scripts/check: -------------------------------------------------------------------------------- 1 | mypy --strict examples 2 | -------------------------------------------------------------------------------- /languages/python/scripts/dev: -------------------------------------------------------------------------------- 1 | python -m venv .venv 2 | source .venv/bin/activate 3 | cargo build -p modelfox_python 4 | cp ../../target/debug/libmodelfox_python.so modelfox/modelfox_python.so 5 | pip install -e . 6 | deactivate 7 | -------------------------------------------------------------------------------- /languages/python/scripts/docs: -------------------------------------------------------------------------------- 1 | python -m venv .venv 2 | source .venv/bin/activate 3 | pip install -r requirements.txt 4 | python setup.py develop --user 5 | rm -rf modelfox.egg-info 6 | pdoc -d google -t . -o docs modelfox 7 | cp ../../modelfox.svg docs/modelfox.svg 8 | echo '' > docs/index.html 9 | deactivate 10 | -------------------------------------------------------------------------------- /languages/python/scripts/fmt: -------------------------------------------------------------------------------- 1 | black modelfox.pyi examples 2 | -------------------------------------------------------------------------------- /languages/python/scripts/release: -------------------------------------------------------------------------------- 1 | twine upload dist/*.whl 2 | -------------------------------------------------------------------------------- /languages/python/setup.py: -------------------------------------------------------------------------------- 1 | import setuptools 2 | 3 | setuptools.setup( 4 | name="modelfox", 5 | package_data={"modelfox": ["py.typed", "__init__.pyi"]}, 6 | packages=["modelfox"], 7 | ) 8 | -------------------------------------------------------------------------------- /languages/ruby/.gitignore: -------------------------------------------------------------------------------- 1 | /.yardoc 2 | /dist 3 | /docs 4 | /lib/modelfox/libmodelfox 5 | -------------------------------------------------------------------------------- /languages/ruby/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | gem 'redcarpet' 3 | gem 'yard' 4 | -------------------------------------------------------------------------------- /languages/ruby/Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | redcarpet (3.5.1) 5 | yard (0.9.26) 6 | 7 | PLATFORMS 8 | ruby 9 | 10 | DEPENDENCIES 11 | redcarpet 12 | yard 13 | 14 | BUNDLED WITH 15 | 2.1.4 16 | -------------------------------------------------------------------------------- /languages/ruby/examples/advanced/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | gem 'modelfox' 3 | -------------------------------------------------------------------------------- /languages/ruby/examples/advanced/README.md: -------------------------------------------------------------------------------- 1 | # Advanced 2 | 3 | This example demonstrates logging predictions and true values to the ModelFox app. Before running the example, run `modelfox app` to start the app running locally, open `http://localhost:8080` in your browser, and upload the file `heart_disease.modelfox` to it. 4 | 5 | To run the example: 6 | 7 | ``` 8 | $ bundle 9 | $ MODELFOX_URL=http://localhost:8080 ruby main.rb 10 | ``` 11 | 12 | Now if you refresh the production stats or production metrics tabs for the model you uploaded, you should see predictions and true values. 13 | 14 | For more information, [read the docs](https://www.modelfox.dev/docs). 15 | -------------------------------------------------------------------------------- /languages/ruby/examples/basic/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | gem 'modelfox' 3 | -------------------------------------------------------------------------------- /languages/ruby/examples/basic/README.md: -------------------------------------------------------------------------------- 1 | # Basic 2 | 3 | This example demonstrates loading a model from a `.modelfox` file and making a prediction. 4 | 5 | To run the example: 6 | 7 | ``` 8 | $ bundle 9 | $ ruby main.rb 10 | ``` 11 | -------------------------------------------------------------------------------- /languages/ruby/lib/modelfox.rb: -------------------------------------------------------------------------------- 1 | require 'modelfox/modelfox' 2 | -------------------------------------------------------------------------------- /languages/ruby/modelfox.gemspec: -------------------------------------------------------------------------------- 1 | Gem::Specification.new do |s| 2 | s.name = "modelfox" 3 | s.version = "0.8.0" 4 | s.summary = "ModelFox for Ruby" 5 | s.description = "Make predictions with a ModelFox model from your Ruby app. Learn more at https://www.modelfox.dev/." 6 | s.authors = ["ModelFox"] 7 | s.email = "help@modelfox.dev" 8 | s.files = Dir["**/**"].grep_v(/^modelfox.gem$/).grep_v(/^examples/) 9 | s.homepage = "https://www.modelfox.dev/" 10 | s.metadata = { 11 | "source_code_uri" => "https://github.com/modelfoxdotdev/modelfox/tree/main/languages/ruby" 12 | } 13 | s.license = "MIT" 14 | s.add_dependency "ffi", "~> 1" 15 | end 16 | -------------------------------------------------------------------------------- /languages/ruby/scripts/dev: -------------------------------------------------------------------------------- 1 | bundle 2 | rm -rf lib/modelfox/libmodelfox/ 3 | cargo build -p libmodelfox 4 | install -D ../../target/debug/libmodelfox.so lib/modelfox/libmodelfox/x86_64-linux-gnu/libmodelfox.so 5 | gem build -o modelfox.gem modelfox.gemspec 6 | gem install modelfox.gem 7 | -------------------------------------------------------------------------------- /languages/ruby/scripts/docs: -------------------------------------------------------------------------------- 1 | bundle 2 | bundle exec yard -m markdown -o docs 3 | -------------------------------------------------------------------------------- /languages/ruby/scripts/fmt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modelfoxdotdev/modelfox/ec5d86b0a0557859231fd0a2cf98fa5550828f22/languages/ruby/scripts/fmt -------------------------------------------------------------------------------- /languages/ruby/scripts/release: -------------------------------------------------------------------------------- 1 | gem push dist/modelfox.gem 2 | -------------------------------------------------------------------------------- /languages/rust/.gitignore: -------------------------------------------------------------------------------- 1 | /docs 2 | /target_docs 3 | -------------------------------------------------------------------------------- /languages/rust/examples/advanced/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_example_advanced" 5 | 6 | edition = { workspace = true } 7 | license = { workspace = true } 8 | publish = false 9 | version = { workspace = true } 10 | 11 | [[bin]] 12 | name = "modelfox_example_advanced" 13 | path = "main.rs" 14 | 15 | [dependencies] 16 | anyhow = { workspace = true } 17 | modelfox = { workspace = true } 18 | -------------------------------------------------------------------------------- /languages/rust/examples/advanced/README.md: -------------------------------------------------------------------------------- 1 | # Advanced 2 | 3 | This example demonstrates logging predictions and true values to the ModelFox app. Before running the example, run `modelfox app` to start the app running locally, open `http://localhost:8080` in your browser, and upload the file `heart_disease.modelfox` to it. 4 | 5 | To run the example: 6 | 7 | ``` 8 | $ MODELFOX_URL=http://localhost:8080 cargo run 9 | ``` 10 | 11 | Now if you refresh the production stats or production metrics tabs for the model you uploaded, you should see predictions and true values. 12 | 13 | For more information, [read the docs](https://www.modelfox.dev/docs). 14 | -------------------------------------------------------------------------------- /languages/rust/examples/basic/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_example_basic" 5 | 6 | edition = { workspace = true } 7 | license = { workspace = true } 8 | publish = false 9 | version = { workspace = true } 10 | 11 | [[bin]] 12 | name = "modelfox_example_basic" 13 | path = "main.rs" 14 | 15 | [dependencies] 16 | modelfox = { workspace = true } 17 | -------------------------------------------------------------------------------- /languages/rust/examples/basic/README.md: -------------------------------------------------------------------------------- 1 | # Basic 2 | 3 | This example demonstrates loading a model from a `.modelfox` file and making a prediction. 4 | 5 | To run the example: 6 | 7 | ``` 8 | $ cargo run 9 | ``` 10 | -------------------------------------------------------------------------------- /languages/rust/macro/Cargo.toml: -------------------------------------------------------------------------------- 1 | cargo-features = ["workspace-inheritance"] 2 | 3 | [package] 4 | name = "modelfox_macro" 5 | 6 | authors = { workspace = true } 7 | description = { workspace = true } 8 | documentation = { workspace = true } 9 | edition = { workspace = true } 10 | homepage = { workspace = true } 11 | license = { workspace = true } 12 | publish = true 13 | repository = { workspace = true } 14 | version = { workspace = true } 15 | 16 | [lib] 17 | path = "lib.rs" 18 | proc-macro = true 19 | 20 | [dependencies] 21 | proc-macro2 = { workspace = true } 22 | quote = { workspace = true } 23 | syn = { workspace = true } 24 | -------------------------------------------------------------------------------- /languages/rust/scripts/build: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modelfoxdotdev/modelfox/ec5d86b0a0557859231fd0a2cf98fa5550828f22/languages/rust/scripts/build -------------------------------------------------------------------------------- /languages/rust/scripts/docs: -------------------------------------------------------------------------------- 1 | cargo doc -p modelfox --no-deps --target-dir target_docs 2 | cp -r target_docs/doc docs 3 | echo '' > docs/index.html 4 | -------------------------------------------------------------------------------- /languages/rust/scripts/release: -------------------------------------------------------------------------------- 1 | set -e 2 | cargo publish --manifest-path macro/Cargo.toml 3 | cargo publish 4 | -------------------------------------------------------------------------------- /modelfox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modelfoxdotdev/modelfox/ec5d86b0a0557859231fd0a2cf98fa5550828f22/modelfox.png -------------------------------------------------------------------------------- /modelfox.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /readme/drift.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modelfoxdotdev/modelfox/ec5d86b0a0557859231fd0a2cf98fa5550828f22/readme/drift.png -------------------------------------------------------------------------------- /readme/metrics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modelfoxdotdev/modelfox/ec5d86b0a0557859231fd0a2cf98fa5550828f22/readme/metrics.png -------------------------------------------------------------------------------- /readme/predictions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modelfoxdotdev/modelfox/ec5d86b0a0557859231fd0a2cf98fa5550828f22/readme/predictions.png -------------------------------------------------------------------------------- /readme/report.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modelfoxdotdev/modelfox/ec5d86b0a0557859231fd0a2cf98fa5550828f22/readme/report.png -------------------------------------------------------------------------------- /readme/tune.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modelfoxdotdev/modelfox/ec5d86b0a0557859231fd0a2cf98fa5550828f22/readme/tune.png -------------------------------------------------------------------------------- /rust-toolchain.toml: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | channel = "nightly-2022-05-13" 3 | components = [ "clippy", "rustfmt" ] 4 | targets = [ 5 | "aarch64-unknown-linux-gnu", 6 | "aarch64-unknown-linux-musl", 7 | "aarch64-apple-darwin", 8 | "wasm32-unknown-unknown", 9 | "x86_64-unknown-linux-gnu", 10 | "x86_64-unknown-linux-musl", 11 | "x86_64-apple-darwin", 12 | "x86_64-pc-windows-gnu", 13 | "x86_64-pc-windows-msvc", 14 | ] 15 | -------------------------------------------------------------------------------- /rustfmt.toml: -------------------------------------------------------------------------------- 1 | hard_tabs = true 2 | use_field_init_shorthand = true 3 | -------------------------------------------------------------------------------- /scripts/app/dev: -------------------------------------------------------------------------------- 1 | cargo run -p modelfox_dev -- \ 2 | --watch . \ 3 | --ignore languages \ 4 | --command "cargo run -p modelfox_cli -- app" 5 | -------------------------------------------------------------------------------- /scripts/app/seed: -------------------------------------------------------------------------------- 1 | cargo run --bin modelfox_app_seed -- $@ 2 | -------------------------------------------------------------------------------- /scripts/build: -------------------------------------------------------------------------------- 1 | cargo run -p modelfox_build -- $@ 2 | -------------------------------------------------------------------------------- /scripts/license: -------------------------------------------------------------------------------- 1 | cargo run --release -p modelfox_license -- $@ 2 | -------------------------------------------------------------------------------- /scripts/release: -------------------------------------------------------------------------------- 1 | # push to crates.io 2 | set -e 3 | for path in id zip progress_counter kill_chip finite table metrics text features model linear tree core 4 | do 5 | cargo publish --manifest-path crates/$path/Cargo.toml 6 | sleep 15 7 | done 8 | -------------------------------------------------------------------------------- /scripts/www/dev: -------------------------------------------------------------------------------- 1 | cargo run -p modelfox_dev -- \ 2 | --watch . \ 3 | --ignore languages \ 4 | --command "cargo run -p modelfox_www -- serve" 5 | -------------------------------------------------------------------------------- /scripts/www/docs: -------------------------------------------------------------------------------- 1 | set -e 2 | for LANG in c elixir go javascript php python ruby rust; do 3 | pushd languages/$LANG 4 | scripts/docs 5 | popd 6 | ssh root@router-us-east-1.modelfox.dev mkdir -p /srv/www/docs/languages/$LANG 7 | cp -r languages/$LANG/docs/ dist/www/docs/$LANG/ 8 | done 9 | --------------------------------------------------------------------------------