|
1 | 1 | # StatsLearnModels.jl
|
2 | 2 |
|
3 |
| -[](https://github.com/JuliaML/StatsLearnModels.jl/actions/workflows/CI.yml?query=branch%3Amain) |
4 |
| -[](https://codecov.io/gh/JuliaML/StatsLearnModels.jl) |
| 3 | +[![][build-img]][build-url] [![][codecov-img]][codecov-url] |
5 | 4 |
|
6 |
| -Statistical learning models for tabular data. |
| 5 | +Statistical learning models for [Tables.jl](https://github.com/JuliaData/Tables.jl) tables. |
| 6 | + |
| 7 | +## Installation |
| 8 | + |
| 9 | +Get the latest stable release with Julia's package manager: |
| 10 | + |
| 11 | +``` |
| 12 | +] add StatsLearnModels |
| 13 | +``` |
| 14 | + |
| 15 | +## Usage |
| 16 | + |
| 17 | +This package provides a `Learn` transform that implements the |
| 18 | +[TableTransforms.jl](https://github.com/JuliaML/TableTransforms.jl) |
| 19 | +interface. |
| 20 | + |
| 21 | +Given two [Tables.jl](https://github.com/JuliaData/Tables.jl) |
| 22 | +tables with training and test data: |
| 23 | + |
| 24 | +```julia |
| 25 | +train = (feature1=rand(100), feature2=rand(100), target=rand(1:2, 100)) |
| 26 | +test = (feature1=rand(20), feature2=rand(20)) |
| 27 | +``` |
| 28 | + |
| 29 | +One can train a learning `model` (e.g. `RandomForestClassifier`) with |
| 30 | +the `train` table: |
| 31 | + |
| 32 | +```julia |
| 33 | +model = RandomForestClassifier() |
| 34 | + |
| 35 | +learn = Learn(train, model, ["feature1","feature2"] => "target") |
| 36 | +``` |
| 37 | + |
| 38 | +and apply the trained `model` to the `test` table: |
| 39 | + |
| 40 | +```julia |
| 41 | +pred = learn(test) |
| 42 | +``` |
| 43 | + |
| 44 | +The package exports native Julia models from various packages |
| 45 | +in the ecosystem. It is also possible to use models from the |
| 46 | +[MLJ.jl](https://github.com/JuliaAI/MLJ.jl) stack. |
| 47 | + |
| 48 | +The combination of TableTransforms.jl with StatsLearnModels.jl |
| 49 | +can be thought of as a powerful alternative to MLJ.jl. |
| 50 | + |
| 51 | +[build-img]: https://img.shields.io/github/actions/workflow/status/JuliaML/StatsLearnModels.jl/CI.yml?branch=master&style=flat-square |
| 52 | +[build-url]: https://github.com/JuliaML/StatsLearnModels.jl/actions |
| 53 | + |
| 54 | +[codecov-img]: https://img.shields.io/codecov/c/github/JuliaML/StatsLearnModels.jl?style=flat-square |
| 55 | +[codecov-url]: https://codecov.io/gh/JuliaML/StatsLearnModels.jl |
0 commit comments