Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Radial Basis Function Networks

RBF Regressors

NB. create values X in range -1,1
NB. create values Y = sin(10*X)
X=: 100 1 $100%~ i: 100
Y=: 1 o. 10 * X
NB. Create RBF regressor with 5 centroids.
rbfr=: (X;Y;5;10.5) conew 'RBFRegressor'
fit__rbfr ''

NB. plot and compare Y with predicted values.
plot (|:Y),(|:predict__rbfr X)

rbfreg

RBF Classifiers

We can use RBF networks as classifiers.

Example with iris data

data=: 4 readCSV_jLearnUtil_ '/path/to/iris.csv'
'X Y Z W' =: splitDataset_jLearnUtil_ data,(0.5;1)
rbfc=: (X;Y;6;5) conew 'RBFClassifier'
fit__rbfc ''

NB. test the model. 
NB. Show the precision, recall and f-score of the model on the test data 
prf_jLearnScorer_ W ;( (=>./)"1 predict__rbfc Z) ; 1
┌────────────┬───────────────────┬─────────────────────────┐
│1 0.925926 10.965517 1 0.9523810.982456 0.961538 0.97561│
└────────────┴───────────────────┴─────────────────────────┘