Learners
Similar to SKPreprocessor
, most of the Learners
in AMLP for its initial release are based on Scikitlearn libraries.
For more information and specific details of arguments to pass and learner's behaviour, please consult the Scikitlearn documentation.
SKLearner Structure
SKLearner(Dict(
:name => "sklearner",
:output => :class,
:learner => "LinearSVC",
:impl_args => Dict()
)
)
Helper Function:
SKLearner(learner::String,args::Dict=Dict())
SKLearner maintains a dictionary of learners which can be listed by invoking the function: sklearners()
The :impl_args
is a dictionary of paramters to be passed as arguments to the Scikitlearn learner.
Let's try loading some learners with some arguments based on Scikitlearn documentation:
julia> using AutoMLPipeline
julia> iris = getiris();
julia> X = iris[:,1:4];
julia> Y = iris[:,end] |> Vector;
julia> rf = SKLearner("RandomForestClassifier",Dict(:n_estimators=>30,:random_state=>0));
julia> crossvalidate(rf,X,Y,"accuracy_score",3)
fold: 1, 0.94
fold: 2, 0.92
fold: 3, 0.96
errors: 0
(mean = 0.94, std = 0.019999999999999962, folds = 3, errors = 0)
julia> ada = SKLearner("AdaBoostClassifier",Dict(:n_estimators=>20,:random_state=>0));
julia> crossvalidate(ada,X,Y,"accuracy_score",3)
fold: 1, 0.92
fold: 2, 0.94
fold: 3, 0.98
errors: 0
(mean = 0.9466666666666667, std = 0.030550504633038912, folds = 3, errors = 0)
julia> svc = SKLearner("SVC",Dict(:kernel=>"rbf",:random_state=>0,:gamma=>"auto"));
julia> crossvalidate(svc,X,Y,"accuracy_score",3)
fold: 1, 0.94
fold: 2, 0.96
fold: 3, 0.94
errors: 0
(mean = 0.9466666666666667, std = 0.011547005383792525, folds = 3, errors = 0)