
sdball
Machine Learning in Elixir: accuracy on the test data
Title: Machine Learning in Elixir: Chapter 1
Example: Flower classification - final accuracy on the test data is inconsistent.
When completing chapter 1 and evaluating our trained model on the test data I find the results can be inconsistent based on the shuffle of the original dataset. My first pass got 0% accuracy on the test data, but 96% accuracy when I evaluated using the training data. My second attempt (after re-running the Livebook cell that shuffled the training set) my model got 40% accuracy on the test data. I’ve tried various iterations of set sizes, iterations, epochs, etc but I cannot get a trained model to be more than 40% accurate on the test data. Is there some way to make the results more consistent?
Most Liked

jakesgordon
… also just noticed a similar forum post that has a potential answer from Sean (I haven’t tried it yet)

jakesgordon
Yes, having now tried it I can confirm Sean’s answer in the other forum post DOES resolve the issue for me and I now consistently get > 96% accuracy in test evaluation no matter the splits.
Thanks Sean!

sdball
Oh excellent! Thanks for pointing me to that other post.
Popular Pragmatic topics










Other popular topics









Latest in PragProg
Latest (all)
Categories:
Popular Portals
- /elixir
- /rust
- /wasm
- /ruby
- /erlang
- /phoenix
- /keyboards
- /js
- /rails
- /python
- /security
- /go
- /swift
- /vim
- /clojure
- /java
- /haskell
- /emacs
- /svelte
- /onivim
- /typescript
- /crystal
- /c-plus-plus
- /tailwind
- /kotlin
- /gleam
- /react
- /flutter
- /elm
- /ocaml
- /vscode
- /opensuse
- /ash
- /centos
- /php
- /deepseek
- /zig
- /scala
- /html
- /debian
- /nixos
- /lisp
- /agda
- /textmate
- /react-native
- /sublime-text
- /kubuntu
- /arch-linux
- /ubuntu
- /revery
- /manjaro
- /django
- /spring
- /diversity
- /nodejs
- /lua
- /julia
- /c
- /slackware
- /neovim