Machine Learning in Elixir: Chapter 1 doesn't work with Axon 0.7 (page 26)

Cool! I updated it at the dataframe level since Nx still scares me.

cols = ~w(sepal_width sepal_length petal_length petal_width)

normalized_iris =
  DF.mutate(
    iris,
    for col <- across(^cols) do
      {col.name, Explorer.Series.cast((col - mean(col)) / standard_deviation(col), :f32)}
    end
  )
2 Likes