Thanks Gregory, that "y ~ ." syntax solves my problems. and allows my to
pull out the PLSR data I wanted, but leads me to my next problem.
I generate PLSR model as follows
mod=r.plsr(r("V83 ~ ."),ncomp=10,data=dataPLS,validation="CV")
and test it by ploting ...
r.plot(mod,ncomp=10 )
This works....
I then generate a numerical matrix, accFAS, using a custom python
function, generateACC
accFAS=generateACC(sequeFAS)
printing this confirms that it only contains numerical data.
I then try to use my model to predict the value of the matrix accFAS
predicted=r.predict(r(mod), type='response', ncomp = 10, newdata = accFAS )
But this gives me...
Traceback (most recent call last):
File "C:\Documents and Settings\Administrator\Desktop\pls.py", line
182, in <module>
predicted=r.predict(r(mod), type='response', ncomp = 10, newdata =
accFAS )
File "C:\Python25\Lib\site-packages\rpy.py", line 322, in __call__
return self.eval(self.parse(text=s))
RPy_RException: Error in function (file = "", n = NULL, text = NULL,
prompt = "?", srcfile = NULL, :
unexpected symbol in:
"0.192149741284537, 0.212853642861587, 0.125771297078345,
0.0997013717387267, 0.0828133779757881, 0.101594355133454,
0.0676197309472983, 0.0464180488919544, 0.0438123140694563,
0.0514109154579986)
c"
Now I guess this is coming from r(mod); the numbers don't match accFAS.
I also have
rpy.set_default_mode(rpy.NO_CONVERSION)
Anyone got any ideas whats happening here?
Chris
> You may find the forumula syntax
>
> y ~ .
>
> helpful. If data= is supplied to the modeling command, the single
> period means 'all variables in the data frame that are not otherwised
> mentioned.
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
rpy-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rpy-list