Skip to content

Commit

Permalink
Updated constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
ulises-jeremias committed Oct 17, 2023
1 parent 965b51e commit 740dfed
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions examples/ml_kmeans_plot/main.v
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
module main

import vsl.ml
import vsl.ml { Data, Kmeans }
import internal.dataset

// data
mut data := ml.Data.from_raw_x(dataset.raw_dataset.map([it[0], it[1]]))!
x := dataset.raw_dataset.map([it[0], it[1]])
mut data := Data.from_raw_x(x)!

// model
nb_classes := 3
mut model := ml.Kmeans.new(mut data, nb_classes, 'kmeans')
mut model := Kmeans.new(mut data, nb_classes, 'kmeans')
model.set_centroids([
// class 0
[3.0, 3],
Expand Down

0 comments on commit 740dfed

Please sign in to comment.