Skip to content

Commit

Permalink
decisiontree bug about running functions when loading
Browse files Browse the repository at this point in the history
  • Loading branch information
ppalmes committed Aug 8, 2019
1 parent ff27250 commit b0b6e31
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions src/decisiontree.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,18 +104,6 @@ function transform!(tree::PrunedTree, features::T) where {T<:Union{Vector,Matrix
return DT.apply_tree(tree.model, instances)
end

function ptreerun()
Random.seed!(125)
data = getiris()
features = data[:,1:4]
sp = data.Species |> Vector
pt = PrunedTree()
fit!(pt,features,sp)
res=transform!(pt,features)
sum(sp .== res)/length(sp)
end
ptreerun()


# Random forest (CART).

Expand Down Expand Up @@ -207,18 +195,6 @@ function transform!(forest::RandomForest, features::T) where {T<:Union{Vector,Ma
return DT.apply_forest(forest.model, instances)
end

function rfrun()
Random.seed!(123)
data = getiris()
features = data[:,1:4]
sp = data.Species |> Vector
rf = RandomForest()
fit!(rf,features,sp)
res=transform!(rf,features)
sum(sp .== res)/length(sp)
end
rfrun()


# Adaboosted decision stumps.

Expand Down Expand Up @@ -295,17 +271,5 @@ function transform!(adaboost::Adaboost, features::T) where {T<:Union{Vector,Matr
)
end

function adarun()
Random.seed!(123)
data = getiris()
features = data[:,1:4]
sp = data.Species |> Vector
ada = Adaboost()
fit!(ada,features,sp)
res=transform!(ada,features)
sum(sp .== res)/length(sp)
end
adarun()


end # module

0 comments on commit b0b6e31

Please sign in to comment.