finished updating the basic files.

nix
Pierre Alexandre Tremblay 6 years ago
parent 7c83690d35
commit 95cce618c5

@ -36,9 +36,9 @@ Routine{
(
Routine{
10.do{|i|
~point.set(0,i * 10);
~point.set(0,i);
s.sync;
~kmeans.predictPoint(~point,{|x| ("Predicted Cluster for point" + (i * 10) ++ ":" + x).postln})
~kmeans.predictPoint(~point,{|x| ("Predicted Cluster for point" + i ++ ":" + x).postln})
}
}.play
)
@ -53,6 +53,7 @@ Routine{
~labels.size({|x|
x.asInteger.do{|i|
~labels.getLabel(i.asString,action: {|l|("Label for" + i ++ ":" + l).postln});
s.sync;
};});
}.play
)

@ -39,9 +39,9 @@ Routine{
(
Routine{
10.do{|i|
~point.set(0,i * 10);
~point.set(0,i);
s.sync;
~kmeans.predictPoint(~point,{|x| ("Predicted Cluster for point" + (i * 10) ++ ":" + x).postln})
~kmeans.predictPoint(~point,{|x| ("Predicted Cluster for point" + i ++ ":" + x).postln})
}
}.play
)
@ -50,12 +50,13 @@ Routine{
~kmeans.predict(~ds,~labels, {|x| ("Size of each cluster" + x).postln})
s(
(
Routine{
var n;
~labels.size({|x|
x.asInteger.do{|i|
~labels.getLabel(i.asString,action: {|l|("Label for" + i ++ ":" + l).postln});
s.sync;
};});
}.play
)

@ -105,6 +105,12 @@ ARGUMENT:: filename
Absolute path for the new file
ARGUMENT:: action
A function to run when the file has been written
METHOD:: dump
(buggy, please use Print for now) Post the content of the dataset in JSON format in the window by default, but you can supply a custom action instead;
METHOD:: print
Post an abbreviated content of the dataset in the window by default, but you can supply a custom action instead;
METHOD:: asString
Responds with the name of the data set as a pretty(ish) string
@ -150,9 +156,11 @@ Routine{
~ds.print //to post window by default, but you can supply a custom action instead
~ds.dump //likewise
//for example
(
~ds.dump{|j|
~dict = j.parseJSON
}
)
//Now we have a Dictionary of our data and IDs
~dict.postcs

Loading…
Cancel
Save