Update Usage authored by Florian Grosse's avatar Florian Grosse
## 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
add LowRankModels
add DecisionTree
```
## Quickstart
Congratulations! As an example, run:
```julia
......@@ -23,6 +26,7 @@ Z = Vector{String}()
data = Vector{Vector{Float64}}()
# separate data from metadata columns
# change this as appropriate for your data or generate some dummy data
for rline in readlines(toy)
line = split(rline,',')
push!(T, parse(Int,line[353]))
......@@ -36,21 +40,42 @@ block = ConML.VMS{Float64}(T, Sigma, Z, data)
# set parameters
# 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
kb = ConML.KnowledgeBase{Int}(ConML.VMS{Int}(),Vector{ConML.MachineModel}())
kb = ConML.KnowledgeBase()
# 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)])
featureSelection = ConML.FeatureSelector()
# Skip feature selection for now, see ConMLDefaults for default feature selectors
featureSelection = nothing
# 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!
learn(block)
```
## 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