From 50dfbf002af931a5ca5f68abdc07dd014e9fec36 Mon Sep 17 00:00:00 2001 From: Jose Storopoli Date: Mon, 30 Oct 2023 09:33:01 -0300 Subject: [PATCH] fix(08_ordinal_reg): use `DataFrames.transform!` This is because of `Bijectors.transform!` --- _literate/08_ordinal_reg.jl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/_literate/08_ordinal_reg.jl b/_literate/08_ordinal_reg.jl index 3a5d3f01..0c131c5a 100644 --- a/_literate/08_ordinal_reg.jl +++ b/_literate/08_ordinal_reg.jl @@ -95,7 +95,6 @@ using CairoMakie using AlgebraOfGraphics using Distributions using StatsFuns: logit -using DataFrames: transform! # Here we have a discrete variable `x` with 6 possible ordered values as response. # The values range from 1 to 6 having probability, respectively: @@ -344,7 +343,7 @@ esoph = CSV.read(HTTP.get(url).body, DataFrame) using CategoricalArrays -transform!( +DataFrames.transform!( esoph, :agegp => x -> categorical( @@ -356,7 +355,7 @@ transform!( x -> categorical(x; levels=["0-9g/day", "10-19", "20-29", "30+"], ordered=true); renamecols=false, ) -transform!(esoph, [:agegp, :alcgp, :tobgp] .=> ByRow(levelcode); renamecols=false) +DataFrames.transform!(esoph, [:agegp, :alcgp, :tobgp] .=> ByRow(levelcode); renamecols=false) X = Matrix(select(esoph, [:agegp, :alcgp])) y = esoph[:, :tobgp]