IBM / AutoMLPipeline.jl

A package that makes it trivial to create and evaluate machine learning pipeline architectures.
MIT License
355 stars 29 forks source link

Huge amount of boiler plate #98

Closed xiaodaigh closed 3 years ago

xiaodaigh commented 3 years ago

Can it be export from a moduel like

using AutoMLPipeline.Abbreviations

then all of the below will be exported?

Also,

using AutoMLPipeline
const amp = AutoMLPipeline

amp.@abbr (numf |> pca)

So the @abbr can convert these operators to the proper implementation.


using AutoMLPipeline

#### Decomposition
pca = skoperator("PCA")
fa  = skoperator("FactorAnalysis")
ica = skoperator("FastICA")

#### Scaler 
rb   = skoperator("RobustScaler")
pt   = skoperator("PowerTransformer")
norm = skoperator("Normalizer")
mx   = skoperator("MinMaxScaler")
std  = skoperator("StandardScaler")

#### categorical preprocessing
ohe = OneHotEncoder()

#### Column selector
catf = CatFeatureSelector()
numf = NumFeatureSelector()
disc = CatNumDiscriminator()

#### Learners
rf       = skoperator("RandomForestClassifier")
gb       = skoperator("GradientBoostingClassifier")
lsvc     = skoperator("LinearSVC")
svc      = skoperator("SVC")
mlp      = skoperator("MLPClassifier")
ada      = skoperator("AdaBoostClassifier")
sgd      = skoperator("SGDClassifier")
skrf_reg = skoperator("RandomForestRegressor")
skgb_reg = skoperator("GradientBoostingRegressor")
jrf      = RandomForest()
tree     = PrunedTree()
vote     = VoteEnsemble()
stack    = StackEnsemble()
best     = BestLearner()
ppalmes commented 3 years ago

you can check the example code in: https://github.com/IBM/AutoMLPipeline.jl/blob/master/examples/discourse_zevelev.jl

as much as it makes things convenient, i don’t want to introduce things that are unnecessary in the global namespace. there a lot of models and you don’t need all of them in many cases. it is not good to export them without knowing them or explicitly exporting these structures. you can always create a wrapper or function to load all of them but i want the api to be as basic as possible. the @pipeline expression is necessary because those expressions are macros. but you can create a PR and we can check how it goes with your suggestion.