birg / pyopls Goto Github PK
View Code? Open in Web Editor NEWA Python 3 implementation of orthogonal projection to latent structures
License: MIT License
A Python 3 implementation of orthogonal projection to latent structures
License: MIT License
Hi I have a quick question;I will appreciate if you could explain that;
I see that in OPLS 39 components are used and in pls one component is passed in the code below;
#opls = OPLS(39)
#Z = opls.fit_transform(spectra, target)
#pls = PLSRegression(1)
Q1: What is the reason for using one component in "PLSRegression(1)" and how do you decide the number of OPLS components OPLS(39);
Q2: In Permutation test; what is this argument k=-1 referring to? and where can we access the information about what numbers of components were best for this model after doing permutation test?
#validator = OPLSValidator(k=-1).fit(X, target)
I appreciate you time and response;
Thanks
Amnah
Good afternoon,
When running the example code for Validator I am unable to get the OPLSValidator to fit without throwing the ValueError: Only one class present in y_true. ROC AUC score is not defined in that case.
Not sure if this has something to do with my setup or if others are having this issue as well.
Thanks!
Scott
Setting n_jobs in OPLSValidator.fit() does not change the number of CPUs used. I suspect this is an issue with the joblib commands but if i find a solution i will do a pull request
Hi,
The x and y axes were mislabeled in the score plot, which should be:
plt.ylabel('t_ortho')
plt.xlabel('t')
Dong
Hi, does this repo also work well with multi-class classification instead of binary classification?
Thank you,
The validator scripts are not working on any datasets, seems to be an issue with the fit
method and the subsequent LabelBinarizer call. This is the error when running the example code:
TypeError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_19292/3997691689.py in <module>
10 X = df[[c for c in df.columns if c!='classification']]
11
---> 12 validator = OPLSValidator(k=-1).fit(X, target)
13
14 Z = validator.opls_.transform(X)
C:\devel\anaconda3\lib\site-packages\pyopls\validation.py in fit(self, X, y, n_components, cv, pos_label, random_state, n_jobs, verbose, pre_dispatch)
452
453 X = check_array(X, dtype=float, copy=True)
--> 454 y = self._check_target(y, pos_label)
455
456 if not n_components:
C:\devel\anaconda3\lib\site-packages\pyopls\validation.py in _check_target(self, y, pos_label)
223 'Try binarizing with sklearn.preprocessing.LabelBinarizer.')
224 if self.is_discrimination(y):
--> 225 y = self._process_binary_target(y, pos_label)
226 else:
227 self.binarizer_ = None
C:\devel\anaconda3\lib\site-packages\pyopls\validation.py in _process_binary_target(self, y, pos_label)
211
212 def _process_binary_target(self, y, pos_label=None):
--> 213 self.binarizer_ = LabelBinarizer(-1, 1)
214 self.binarizer_.fit(y)
215 if pos_label is not None and self.binarizer_.transform([pos_label])[0] == -1:
TypeError: __init__() takes 1 positional argument but 3 were give
```n
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.