[SciPy-user] PLS from chemometrics.py (PyChem)

oliver.tomic at matforsk.no oliver.tomic at matforsk.no
Wed Jan 31 08:54:30 CST 2007


Hi list,

this might be a bit off-topic, but I hope someone might have an answer to
this.

I wondered whether anyone on this list has experience using PLS (Partial
least squares regression) from the chemometrics-module of PyChem (it is
SciPy-based)?  https://sourceforge.net/projects/pychem/

What I would like to do is to build a fully cross-validated PLS-model based
on two multivariate data matrices. I have the following questions:

1. Is it possible to build a fully cross-validated PLS-model? (I am not
sure if this is possible from what I can see from the code)
2. Also, I get the following error message when I try to run this code:

from scipy import *
from numpy import *
from scipy.io import *
from chemometrics import *

fluorescense = read_array('OST_flu.txt')
sensory = read_array('OST_sens.txt')

rows = fluorescense.shape[0]

mask = zeros((rows, 1), float)
for i in range(7,14):
    mask[i] = 1

print mask

results = PLS(fluorescense,sensory,mask,7,None)


I get this error:
============

Traceback (most recent call last):
  File "C:\Work\PanelCheck\Methods\Weighing\testPLS\testPLS_IDLE.py", line
22, in ?
    results = PLS(fluorescense,sensory,mask,7,None)
  File "chemometrics.py", line 462, in PLS
    x1,x2,x3,y1,y2,y3,dummy1,dummy2,dummy3 = __split__(xdata,ydata,mask) #
raw data
ValueError: need more than 6 values to unpack


Any help appreciated
regards

Oliver
(See attached file: chemometrics.py)(See attached file: process.py)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: chemometrics.py
Type: application/octet-stream
Size: 26437 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/scipy-user/attachments/20070131/9d70d07d/attachment-0002.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: process.py
Type: application/octet-stream
Size: 9515 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/scipy-user/attachments/20070131/9d70d07d/attachment-0003.obj 


More information about the SciPy-user mailing list