{"id":15165893,"url":"https://github.com/mlr-org/mlr3fda","last_synced_at":"2025-06-29T15:02:12.683Z","repository":{"id":69839370,"uuid":"157852418","full_name":"mlr-org/mlr3fda","owner":"mlr-org","description":"Functional Data Analysis for mlr3","archived":false,"fork":false,"pushed_at":"2025-06-23T19:26:38.000Z","size":14813,"stargazers_count":5,"open_issues_count":10,"forks_count":3,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-06-23T20:26:12.870Z","etag":null,"topics":["data-analysis","data-analysis-in-r","data-science","functional-data","machine-learning","mlr3","r","r-package"],"latest_commit_sha":null,"homepage":"https://mlr3fda.mlr-org.com/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mlr-org.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"mlr-org"}},"created_at":"2018-11-16T10:33:56.000Z","updated_at":"2025-06-23T19:22:21.000Z","dependencies_parsed_at":"2024-01-26T13:04:34.137Z","dependency_job_id":"cb5bf3ca-b155-44ae-9723-f0332aa657c7","html_url":"https://github.com/mlr-org/mlr3fda","commit_stats":{"total_commits":165,"total_committers":6,"mean_commits":27.5,"dds":0.4606060606060606,"last_synced_commit":"8995b8fb636d4effc544b1327a4ab88603cabcdb"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/mlr-org/mlr3fda","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlr-org%2Fmlr3fda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlr-org%2Fmlr3fda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlr-org%2Fmlr3fda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlr-org%2Fmlr3fda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mlr-org","download_url":"https://codeload.github.com/mlr-org/mlr3fda/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlr-org%2Fmlr3fda/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261553463,"owners_count":23176365,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-analysis","data-analysis-in-r","data-science","functional-data","machine-learning","mlr3","r","r-package"],"created_at":"2024-09-27T04:05:51.653Z","updated_at":"2025-06-29T15:02:12.639Z","avatar_url":"https://github.com/mlr-org.png","language":"R","funding_links":["https://github.com/sponsors/mlr-org"],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n\nlgr::get_logger(\"mlr3\")$set_threshold(\"warn\")\nset.seed(1L)\noptions(datatable.print.class = FALSE, datatable.print.keys = FALSE)\nlibrary(mlr3fda)\nlibrary(mlr3misc)\n```\n\n\n# mlr3fda\n\nPackage website: [release](https://mlr3fda.mlr-org.com/) \\| [dev](https://mlr3fda.mlr-org.com/dev/)\n\nExtending mlr3 to functional data.\n\n\u003c!-- badges: start --\u003e\n[![RCMD Check](https://github.com/mlr-org/mlr3fda/actions/workflows/rcmdcheck.yaml/badge.svg)](https://github.com/mlr-org/mlr3fda/actions/workflows/rcmdcheck.yaml)\n[![CRAN status](https://www.r-pkg.org/badges/version/mlr3fda)](https://CRAN.R-project.org/package=mlr3fda)\n[![StackOverflow](https://img.shields.io/badge/stackoverflow-mlr3-orange.svg)](https://stackoverflow.com/questions/tagged/mlr3)\n[![Mattermost](https://img.shields.io/badge/chat-mattermost-orange.svg)](https://lmmisld-lmu-stats-slds.srv.mwn.de/mlr_invite/)\n\u003c!-- badges: end --\u003e\n\n## Installation\n\nInstall the last release from [CRAN](https://CRAN.R-project.org):\n\n```{r, eval = FALSE}\ninstall.packages(\"mlr3fda\")\n```\n\nInstall the development version from [GitHub](https://github.com/):\n\n```{r, eval = FALSE}\n# install.packages(\"pak\")\npak::pak(\"mlr-org/mlr3fda\")\n```\n\n## What is mlr3fda?\n\nThe goal of `mlr3fda` is to extend `mlr3` to [functional data](https://en.wikipedia.org/wiki/Functional_data_analysis).\nThis is achieved by adding support for functional feature types and providing preprocessing `PipeOp`s that operates on functional columns.\nFor representing functional data, the `tfd_reg` and `tfd_irreg` datatypes from the [tf](https://github.com/tidyfun/tf) package are used and are available after loading `mlr3fda`:\n\n```{r task_feature_types}\nlibrary(mlr3fda)\nmlr_reflections$task_feature_types[c(\"tfr\", \"tfi\")]\n```\n\nThese datatypes can be used to represent regular and irregular functional data respectively.\nCurrently, `Learner`s that directly operate on functional data are not available, so it is necessary to first extract scalar features from the functional columns.\n\n# Quickstart\n\nHere we will start with the predefined `dti` (Diffusion Tensor Imaging) task, see `tsk(\"dti\")$help()` for more details.\nBesides scalar columns, this task also contains two functional columns `cca` and `rcst`.\n\n```{r data, dpi = 300}\ntask = tsk(\"dti\")\ntask\n```\n\nTo train a model on this task we first need to extract scalar features from the functions.\nWe illustrate this below by extracting the mean value.\n\n```{r fda.extract, fig.width = 5, fig.height = 3}\npo_fmean = po(\"fda.extract\", features = \"mean\")\n\ntask_fmean = po_fmean$train(list(task))[[1L]]\ntask_fmean$head()\n```\n\nThis can be combined with a `Lerner` into a `GraphLearner` that first extracts features and then trains a model.\n\n```{r graph}\n# split data into train and test set\nids = partition(task)\n\n# define a Graph and convert it to a GraphLearner\ngraph = po(\"fda.extract\", features = \"mean\", drop = TRUE) %\u003e\u003e%\n  po(\"learner\", learner = lrn(\"regr.rpart\"))\n\nglrn = as_learner(graph)\n\n# train the graph learner on the train set\nglrn$train(task, row_ids = ids$train)\n\n# make predictions on the test set\nglrn$predict(task, row_ids = ids$test)\n```\n\n## Implemented PipeOps\n\n```{r, echo = FALSE}\ncontent = as.data.table(mlr_pipeops, objects = TRUE)\ncontent = content[map_lgl(tags, function(t) \"fda\" %in% t), .(key, label, packages, tags)]\ncontent[, packages := map(packages, function(x) setdiff(x, c(\"mlr3pipelines\", \"mlr3fda\")))]\ncontent[, `:=`(\n  key = sprintf(\"[%1$s](https://mlr3fda.mlr-org.com/reference/mlr_pipeops_%1$s)\", key),\n  packages = map_chr(packages, function(pkg) {\n    toString(ifelse(\n      pkg %in% c(\"stats\", \"graphics\", \"datasets\"), pkg, sprintf(\"[%1$s](https://cran.r-project.org/package=%1$s)\", pkg)\n    ))\n  }),\n  tags = map_chr(tags, toString)\n)]\nknitr::kable(content, format = \"markdown\", col.names = tools::toTitleCase(names(content)))\n```\n\n\n## Bugs, Questions, Feedback\n\n*mlr3fda* is a free and open source software project that\nencourages participation and feedback. If you have any issues,\nquestions, suggestions or feedback, please do not hesitate to open an\n“issue” about it on the GitHub page\\!\n\nIn case of problems / bugs, it is often helpful if you provide a\n“minimum working example” that showcases the behaviour (but don’t\nworry about this if the bug is obvious).\n\nPlease understand that the resources of the project are limited:\nresponse may sometimes be delayed by a few days, and some feature\nsuggestions may be rejected if they are deemed too tangential to the\nvision behind the project.\n\n## Acknowledgements\n\nThe development of this R-package was supported by Roche Diagonstics R\u0026D.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlr-org%2Fmlr3fda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmlr-org%2Fmlr3fda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlr-org%2Fmlr3fda/lists"}