# Regression in Flux.jl

**URL:** <https://discourse.julialang.org/t/regression-in-flux-jl/38733>\
**Category:** Machine Learning\
**Tags:** question, flux\
**Created:** [May 4, 2020, 11:18am UTC](https://discourse.julialang.org/t/regression-in-flux-jl/38733 "2020-05-04T11:18:44Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Albert\_Zevelev](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albert_zevelev/32/11844_2.png) [@Albert\_Zevelev](https://discourse.julialang.org/u/Albert_Zevelev)\
**Post date:** [May 4, 2020, 5:01pm UTC](https://discourse.julialang.org/t/regression-in-flux-jl/38733/5 "2020-05-04T17:01:09Z")

</div>

I do something similar here:

> [@Generic Function to train NN w/ Flux](https://discourse.julialang.org/t/generic-function-to-train-nn-w-flux/37208):
>
> Updated: I would like to write a generic function to train a model in Flux. An ordinary linear regression w/ intercept is a special case of a neural network. If the optimizers work well I should get the same result (esp from such a simple model). Unfortunately I don’t. First: prepare Boston housing data using MLJ: @load\_boston, partition using Flux, Statistics X, y = @load\_boston; X = hcat(X...); train, test = partition(eachindex(y), .7, rng=333); # Xm = hcat(X, size(X,1) |\> ones ); #add …

---

_[View the full topic](https://discourse.julialang.org/t/regression-in-flux-jl/38733)._
