Julia下的混合集成學習包:Orchestra
Orchestra是Julia編程語言的一個異構集成學習包。它由一個統一的機器學習API驅動,是Julia下對Scikit-Learn和Carret的統一。
入門
We will cover how to predict on a dataset using Orchestra.
獲取數據
A tabular dataset will be used to obtain our instances and labels.
This will be split it into a training and test set using holdout method.
import RDatasets
using Orchestra.Util
using Orchestra.Transformers
# Obtain instances and labels
dataset = RDatasets.dataset("datasets", "iris")
instances = array(dataset[:, 1:(end-1)])
labels = array(dataset[:, end])
# Split into training and test sets
(train_ind, test_ind) = holdout(size(instances, 1), 0.3)
Create a Learner
A transformer processes instances in some form. Coincidentally, a learner is a subtype of transformer.
A transformer can be created by instantiating it, taking an options dictionary as an optional argument.
All transformers, including learners are called in the same way.
# Learner with default settings
learner = PrunedTree()
# Learner with some of the default settings overriden
learner = PrunedTree({
:impl_options => {
:purity_threshold => 0.5
}
})
# All learners are called in the same way.
learner = StackEnsemble({
:learners => [
PrunedTree(),
RandomForest(),
DecisionStumpAdaboost()
],
:stacker => RandomForest()
}) 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!