Update Usage authored by Florian Grosse's avatar Florian Grosse
## Package Installation ## Package Installation
Install any packages you want to use. For our example, switch to the package manager with `\]` and run:
Install any packages you want to use. For our example, switch to the package manager with `]` and run:
```julia ```julia
add LowRankModels add LowRankModels
add DecisionTree add DecisionTree
``` ```
## Quickstart ## Quickstart
Congratulations! As an example, run: Congratulations! As an example, run:
```julia ```julia
...@@ -23,6 +26,7 @@ Z = Vector{String}() ...@@ -23,6 +26,7 @@ Z = Vector{String}()
data = Vector{Vector{Float64}}() data = Vector{Vector{Float64}}()
# separate data from metadata columns # separate data from metadata columns
# change this as appropriate for your data or generate some dummy data
for rline in readlines(toy) for rline in readlines(toy)
line = split(rline,',') line = split(rline,',')
push!(T, parse(Int,line[353])) push!(T, parse(Int,line[353]))
...@@ -36,21 +40,42 @@ block = ConML.VMS{Float64}(T, Sigma, Z, data) ...@@ -36,21 +40,42 @@ block = ConML.VMS{Float64}(T, Sigma, Z, data)
# set parameters # set parameters
# we have to specify values for which no defaults exist # we have to specify values for which no defaults exist
par = ConML.ParametersConML(LearnBlockMinimum = 1, maxCategories = 10, MinCategorySize = 20, maxFilterFeatures = 1000, maxFilterSamples = 2000) par = ConML.ParametersConML(LearnBlockMinimum = 1, MinCategorySize = 20, maxFilterFeatures = 1000, maxFilterSamples = 2000)
# create empty knowledge base # create empty knowledge base
kb = ConML.KnowledgeBase{Int}(ConML.VMS{Int}(),Vector{ConML.MachineModel}()) kb = ConML.KnowledgeBase()
# create steps for the algorithm # create steps for the algorithm
myConstruction = ConML.Construct([LowRankModels.KMeans(k=2), LowRankModels.KMeans(k=3), LowRankModels.KMeans(k=4)]) myConstruction = ConML.Construct([LowRankModels.KMeans(k=k) for k in 2:4])
myReconstruction = ConML.Reconstruct([DecisionTree.DecisionTreeClassifier(max_depth=2), DecisionTree.AdaBoostStumpClassifier(n_iterations=10)]) myReconstruction = ConML.Reconstruct([DecisionTree.DecisionTreeClassifier(max_depth=2), DecisionTree.AdaBoostStumpClassifier(n_iterations=10)])
featureSelection = ConML.FeatureSelector() # Skip feature selection for now, see ConMLDefaults for default feature selectors
featureSelection = nothing
# make a pipeline # make a pipeline
learn = ConML.LearnerConML(kb, par, [ConML.searchLearnBlocks, myConstruction, featureSelection, myReconstruction]) learn = ConML.LearnerConML(kb, par, myConstruction, featureSelection, myReconstruction; skipLearnblockSearch = false)
# feed it! # feed it!
learn(block) learn(block)
``` ```
## Update ## Update
Navigate to the project folder and run `git pull`. Afterwards, go to the julia package manager (`\]`) and run `update`.
\ No newline at end of file Navigate to the project folder and run `git pull`. Afterwards, go to the julia package manager (`]`) and run `update`.
## Help
To see how something works, enter help mode with `?` and type the name of the object you want to know about, e.g.:
```julia
help?> Reconstruct
Reconstruct(estimators, names; winnerselection = select_best_or_none)
Reconstruct(pairs(estimator, name))
Reconstruct(pairs(name, estimator))
Reconstruct(dictionary(estimator,name))
Reconstruct(dictionary(name, estimator))
Create a callable object for Reconstruction. Estimators must be subtypes of scikit-learn BaseEstimator and implement the scikit-learn API for supervised methods (namely, fit!(method, Xs, Ys) and predict(method, Xs) are expected).
...
```
If something is still lacking in documentation, take a look at the source code or send us an email.
\ No newline at end of file