KNNClassifier / Regressor review
parent
b2338ed9d9
commit
d96dbb8791
@ -1,30 +1,29 @@
|
|||||||
FluidKNNClassifier : FluidManipulationClient {
|
FluidKNNClassifier : FluidManipulationClient {
|
||||||
|
|
||||||
*new {|server|
|
*new {|server|
|
||||||
var uid = UniqueID.next;
|
var uid = UniqueID.next;
|
||||||
^super.new(server,uid)!?{|inst|inst.init(uid);inst}
|
^super.new(server,uid)!?{|inst|inst.init(uid);inst}
|
||||||
}
|
}
|
||||||
|
|
||||||
init {|uid|
|
init {|uid|
|
||||||
id = uid;
|
id = uid;
|
||||||
}
|
}
|
||||||
|
|
||||||
fit{|dataset, labelset, action|
|
fit{|dataset, labelset, action|
|
||||||
this.prSendMsg(\fit,[dataset.asSymbol, labelset.asSymbol], action);
|
this.prSendMsg(\fit,[dataset.asSymbol, labelset.asSymbol], action);
|
||||||
}
|
}
|
||||||
|
|
||||||
predict{ |dataset, labelset, k, uniform = 0, action|
|
predict{|dataset, labelset, k, uniform = 0, action|
|
||||||
this.prSendMsg(\predict,
|
this.prSendMsg(\predict,
|
||||||
[dataset.asSymbol, labelset.asSymbol, k, uniform],
|
[dataset.asSymbol, labelset.asSymbol, k, uniform],
|
||||||
action);
|
action);
|
||||||
}
|
}
|
||||||
|
|
||||||
predictPoint { |buffer, k, uniform = 0, action|
|
predictPoint {|buffer, k, uniform = 0, action|
|
||||||
this.prSendMsg(\predictPoint,
|
this.prSendMsg(\predictPoint,
|
||||||
[buffer.asUGenInput, k,uniform], action,
|
[buffer.asUGenInput, k, uniform], action,
|
||||||
[string(FluidMessageResponse,_,_)]
|
[string(FluidMessageResponse,_,_)]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,29 +1,29 @@
|
|||||||
FluidKNNRegressor : FluidManipulationClient {
|
FluidKNNRegressor : FluidManipulationClient {
|
||||||
|
|
||||||
*new {|server|
|
*new {|server|
|
||||||
var uid = UniqueID.next;
|
var uid = UniqueID.next;
|
||||||
^super.new(server,uid)!?{|inst|inst.init(uid);inst}
|
^super.new(server,uid)!?{|inst|inst.init(uid);inst}
|
||||||
}
|
}
|
||||||
|
|
||||||
init {|uid|
|
init {|uid|
|
||||||
id = uid;
|
id = uid;
|
||||||
}
|
}
|
||||||
|
|
||||||
fit{|sourceDataset, targetDataset, action|
|
fit{|sourceDataset, targetDataset, action|
|
||||||
this.prSendMsg(\fit,
|
this.prSendMsg(\fit,
|
||||||
[sourceDataset.asSymbol, targetDataset.asSymbol],
|
[sourceDataset.asSymbol, targetDataset.asSymbol],
|
||||||
action
|
action
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
predict{ |sourceDataset, targetDataset, k, uniform = 0, action|
|
predict{ |sourceDataset, targetDataset, k, uniform = 0, action|
|
||||||
this.prSendMsg(\predict,
|
this.prSendMsg(\predict,
|
||||||
[sourceDataset.asSymbol, targetDataset.asSymbol, k, uniform],
|
[sourceDataset.asSymbol, targetDataset.asSymbol, k, uniform],
|
||||||
action);
|
action);
|
||||||
}
|
}
|
||||||
|
|
||||||
predictPoint { |buffer, k, uniform = 0, action|
|
predictPoint { |buffer, k, uniform = 0, action|
|
||||||
this.prSendMsg(\predictPoint, [buffer.asUGenInput, k,uniform], action,
|
this.prSendMsg(\predictPoint, [buffer.asUGenInput, k, uniform], action,
|
||||||
[number(FluidMessageResponse,_,_)]);
|
[number(FluidMessageResponse,_,_)]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue