How to perform a Linear Discriminant Analysis using R Learner/R Predictor Nodes


With the purpose of separating active from inactive samples in a High-Throughput screening experiment, I would like to use linear discriminant analysis for separating active from inactive samples. The data input is 27 parameters per sample (coming from an absorption spectrum measurement and subsequent fourier transform), having control samples that are active and inactive.

I managed to use an R Snippet node to perform a linear discriminant analysis on the control samples and to generate their projection value, however, I did not manage to split the code of the R snipped into an R Learner and R Predictor nodes (seem to be problems with data types, but I am not so much into R), could anyone give me hints or an example workflow for linear discriminant analysis with Knime?

I attached a workflow with my R Snippet code and some testdata to clarify where I got stuck.

Best Regards

The R Learner/Predictor construct is a more flexible way of using KNIME for data analysis and mining, as the Decision Tree Learner and Predictor which has been split into two individual nodes. Your script need to be split into a "learner" part which generates the model, this can be any R object generated by the R Learner and the "predictor" part which applies data to the model. The Learner need to create an object R which contains the model, the Predictor can understand this model, called RMODEL, and can apply any data, RDATA, to it. The variable names are important: The R Learner / Snippet reads R and outputs R, the R Predictor reads RMODEL and RDATA and outputs R. Hope this helps.


I have attached a modify workflow to use lda package class for model/predict and a scorer plus a view of the model trained ...

hope that this help you

best regards


This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.