You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
611 B
Python
30 lines
611 B
Python
FluidKNNClassifier : FluidManipulationClient {
|
|
|
|
*new {|server|
|
|
var uid = UniqueID.next;
|
|
^super.new(server,uid)!?{|inst|inst.init(uid);inst}
|
|
}
|
|
|
|
init {|uid|
|
|
id = uid;
|
|
}
|
|
|
|
fit{|dataset, labelset, action|
|
|
this.prSendMsg(\fit,[dataset.asSymbol, labelset.asSymbol], action);
|
|
}
|
|
|
|
predict{|dataset, labelset, k, uniform = 0, action|
|
|
this.prSendMsg(\predict,
|
|
[dataset.asSymbol, labelset.asSymbol, k, uniform],
|
|
action);
|
|
}
|
|
|
|
predictPoint {|buffer, k, uniform = 0, action|
|
|
this.prSendMsg(\predictPoint,
|
|
[buffer.asUGenInput, k, uniform], action,
|
|
[string(FluidMessageResponse,_,_)]
|
|
);
|
|
}
|
|
|
|
}
|