diff --git a/README.md b/README.md index e98e063..3ff2e65 100644 --- a/README.md +++ b/README.md @@ -20,18 +20,19 @@ The demo below shows how SVMs work: ```julia # To show how SVMs work, we'll use Fisher's iris data set -using SVM +# Temporally, following order is required using RDatasets +using SVM # We'll learn to separate setosa from other species -iris = data("datasets", "iris") +iris = dataset("datasets", "iris") # SVM format expects observations in columns and features in rows X = array(iris[:, 1:4])' p, n = size(X) # SVM format expects positive and negative examples to +1/-1 -Y = [species == "setosa" ? 1.0 : -1.0 for species in iris[:, "Species"]] +Y = [species == :setosa ? 1.0 : -1.0 for species in iris[:, "Species"]] # Select a subset of the data for training, test on the rest. train = randbool(n) @@ -40,7 +41,7 @@ train = randbool(n) model = svm(X[:,train], Y[train]) # And now evaluate that model on the testset -accuracy = nnz(predict(model, X[:,~train]) .== Y[~train])/nnz(~train) +accuracy = countnz(predict(model, X[:,~train]) .== Y[~train])/countnz(~train) ``` You may specify non-default values for the various parameters: