Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tabfm

The goal of tabfm is to run TabFM, a tabular foundation model.

Installation

You can install the development version of tabfm like so:

pak::pak('frankiethull/tabfm')

Example

library(tabfm)
library(rsample)

corn_data <- maize::corn_data

corn_splits <- initial_validation_split(corn_data)
train <- training(corn_splits)
validate <- validation(corn_splits)
test <- testing(corn_splits)

Classification

fit_cls <- tabfm_fit(
  train |> dplyr::select(-type),
  train$type
)

class_preds <- tabfm_predict(fit_cls, test |> dplyr::select(-type))

class_preds |> head()
#> [1] "Sweet" "Sweet" "Sweet" "Sweet" "Sweet" "Sweet"
class_probs <- tabfm_predict(
  fit_cls,
  test |> dplyr::select(-type),
  type = "proba"
)

class_probs |> head()
#>              [,1]         [,2]      [,3]
#> [1,] 4.717414e-05 0.1708070785 0.8291458
#> [2,] 1.179814e-06 0.0043090940 0.9956897
#> [3,] 1.176569e-06 0.0070481412 0.9929507
#> [4,] 2.135778e-05 0.2080314010 0.7919472
#> [5,] 5.090896e-05 0.3103068769 0.6896423
#> [6,] 1.493892e-05 0.0004187601 0.9995663

About

Introducing TabFM: A zero-shot foundation model for tabular data with R

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages