# New Julia machine learning package: NovaML

**URL:** https://discourse.julialang.org/t/new-julia-machine-learning-package-novaml/119038
**Category:** Package Announcements
**Tags:** package, machine-learning
**Created:** [September 4, 2024, 1:47pm UTC](https://discourse.julialang.org/t/new-julia-machine-learning-package-novaml/119038 "2024-09-04T13:47:24Z")
**Posts on this page:** 1
**Showing post:** 17

<div class="post-metadata">

### Author: ![CameronBieganek](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cameronbieganek/32/6915_2.png) [@CameronBieganek](https://discourse.julialang.org/u/CameronBieganek)
#### Post date: [September 6, 2024, 12:38pm UTC](https://discourse.julialang.org/t/new-julia-machine-learning-package-novaml/119038/17 "2024-09-06T12:38:49Z")

</div>

> [@abraemer](#):
>
> So `tree` modifies its first argument `X` right?

No, `tree` is a callable object. It’s actually `tree` that gets mutated.

Sorry, @ilkerarslan, the bikeshedding has begun. It’s hard to avoid with ML libraries because lots of people are interested and have opinions. 🙂

For those who are interested, I already opened an issue regarding the syntax for fitting a model:

> <https://github.com/ilkerarslan/NovaML.jl/issues/17>
>
> I don't want to do too much bikeshedding, but it seems to me that \`model(X, y)\` …and \`model(X)\` do very different things and they deserve a separate syntax. I like \`model(X)\` for prediction, since models are just function approximators. But for fitting I would recommend this syntax:
> 
> \`\`\`julia
> fit!(model, X, y)
> \`\`\`
> 
> This syntax makes it more clear that \`model\` is being mutated during the fitting process, since we are using the standard Julia convention that mutation is indicated by function names with an exclamation point. With the \`model(X, y)\` syntax it's not very obvious that fitting and mutation are occurring.

I tend to agree with @mirkobunse that immutable data structures lead to clearer code. The [LearnAPI.jl Discourse thread](https://discourse.julialang.org/t/ann-learnapi-jl-proposal-for-a-basement-level-machine-learning-api/93048) discussed possible designs extensively. The two main options (as I see it) for a functional, immutable design are:

- Two separate immutable types, one to hold the hyperparameters and one that contains the full fitted object. (The full fitted object would most likely also include the hyperparameters.) So fitting and predicting would look like this:

```julia
params = RandomForestRegressorParams(n_trees=100)
model = fit(params, X, y)
ŷ = predict(model, Xnew) # Or `ŷ = model(Xnew)`, as in NovaML and Flux.

```

- Have a `FittedModel` wrapper type that wraps the hyperparameters and the fitted parameters. StatsLearnModels.jl uses this approach.

---

_[View the full topic](https://discourse.julialang.org/t/new-julia-machine-learning-package-novaml/119038)._
