Skip to content

Evovest/NeuroTabModels.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NeuroTabModels.jl

Differentiable models for tabular data.

Documentation CI Status DOI

Installation

] add NeuroTabModels

⚠ Compatible with Julia >= v1.9.

Configuring a model

A model configuration is defined with on of the constructor:

using NeuroTabModels, DataFrames
using NeuroTabModels.Models

arch = NeuroTreeConfig(depth=4, ntrees=16);
config = NeuroTabRegressor(
    arch;
    loss = :mse,
    nrounds = 10,
    depth = 5,
)

# alternative kwarg-only syntax
config = NeuroTabRegressor(;
    arch_name = "NeuroTreeConfig",
    arch_config = Dict(:depth => 4, :ntrees => 16),
    loss = :mse,
    nrounds = 10,
)

Training

Building and training a model according to the above config is done with NeuroTabModels.fit. See the docs for additional features, notably early stopping support through the tracking of an evaluation metric.

nobs, nfeats = 1_000, 5
dtrain = DataFrame(randn(nobs, nfeats), :auto)
dtrain.y = rand(nobs)
feature_names, target_name = names(dtrain, r"x"), "y"

m = NeuroTabModels.fit(config, dtrain; feature_names, target_name)

Inference

p = m(dtrain)

MLJ

NeuroTabModels.jl supports the MLJ Interface.

using MLJBase, NeuroTabModels
m = NeuroTabRegressor(depth=4, nrounds=10)
X, y = @load_boston
mach = machine(m, X, y) |> fit!
p = predict(mach, X)

Benchmarks

Benchmarking against prominent ML libraries for tabular is performed at MLBenchmarks.jl.

About

Differentiable models for tabular data

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages