JuliaAI / JuliaAI/MLJDecisionTreeInterface.jl

Should predict be robust to changes in column order?

Open
#59 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
9
Forks
3
PR merge metrics
No merged PRs in 30d

Description

A quick test seemed to show that the predict method is not robust to reordering the column order, which was a bit surprising.

using DataFrames
using MLJ
import MLJDecisionTreeInterface.DecisionTreeClassifier as Tree

iris = DataFrame(load_iris());
y, X = unpack(iris, ==(:target); rng=123)

tree = Tree()
mach = machine(tree, X, y)
train, test = partition(eachindex(y), 0.7)
fit!(mach, rows=train)

# Returns false
predict(mach, X[test,[3,2,1,4]]) == predict(mach, X[test,[1,2,3,4]])

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No implementation file or test is named. Start by running the Julia example to reproduce the differing predictions, then inspect the predict and fit! entry points to determine how reordered columns are handled; done means the expected behavior is established and verified for the shown column-order case.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.