# Displaying (and formatting) optimal regression curve equation

**URL:** https://discourse.julialang.org/t/displaying-and-formatting-optimal-regression-curve-equation/65143
**Category:** Statistics
**Created:** [July 22, 2021, 10:50pm UTC](https://discourse.julialang.org/t/displaying-and-formatting-optimal-regression-curve-equation/65143 "2021-07-22T22:50:45Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![YummyPampers2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yummypampers2/32/27328_2.png) [@YummyPampers2](https://discourse.julialang.org/u/YummyPampers2)
#### Post date: [July 22, 2021, 10:50pm UTC](https://discourse.julialang.org/t/displaying-and-formatting-optimal-regression-curve-equation/65143/1 "2021-07-22T22:50:45Z")

</div>

Hello Everyone:

Is there a way to display and format the  
regression curve equation when plotting?

Step 1:

```julia
using Lathe.preprocess: TrainTestSplit
train, test =TestTrainSplit(MagicalCreatures, .80)

```

Step 2: Informing Linear Model with:

```julia
fm = @formula(MagicalCreatures ~ Headshots + GlitterBombs + CourtCases + Assaults + SpecialAttacks)

linearRegressor = lm(fm, train)

```

From here, is there a way to implement CP’s Malo without  
having to use RCall or do I have to settle for a supervised  
method (i.e. PCA).

Is there a parameter in the StatsPlots.jl (or similar package)  
that could optimize the curve against the entire attribute set  
or the optimal features in the set?

Something like:

```julia
[PlottingPackage].scatter(MagicalCreatures, 
           [optimized feature parameter], 
           regression= true, 
          [regression equation] = true

```

Thank you,
