tomlof / onpls Goto Github PK
View Code? Open in Web Editor NEWOnPLS: Orthogonal Projections to Latent Structures in Multiblock and Path Model Data Analysis
License: BSD 3-Clause "New" or "Revised" License
OnPLS: Orthogonal Projections to Latent Structures in Multiblock and Path Model Data Analysis
License: BSD 3-Clause "New" or "Revised" License
Hi, Tommy,
(1) I used the example in resampling.grid_search() by Python 3.5.2:
np.random.seed(42)
n, p_1, p_2, p_3 = 4, 3, 4, 5
t = np.sort(np.random.randn(n, 1), axis=0)
p1 = np.sort(np.random.randn(p_1, 1), axis=0)
p2 = np.sort(np.random.randn(p_2, 1), axis=0)
p3 = np.sort(np.random.randn(p_3, 1), axis=0)
X1 = np.dot(t, p1.T) + 0.1 * np.random.randn(n, p_1)
X2 = np.dot(t, p2.T) + 0.1 * np.random.randn(n, p_2)
X3 = np.dot(t, p3.T) + 0.1 * np.random.randn(n, p_3)
X = [X1, X2, X3]
predComp = [[0, 1, 1], [1, 0, 1], [1, 1, 0]]
orthComp = [1, 1, 1]
onpls = OnPLS.estimators.OnPLS(predComp, orthComp)
params_grid = OnPLS.utils.list_product([0, 0, 0], [3, 3, 3])
OnPLS.resampling.grid_search(onpls, X,{"orthComp": params_grid})
it gave the following error:
Traceback (most recent call last):
File "<ipython-input-12-6849f3f121c7>", line 17, in <module>
OnPLS.resampling.grid_search(onpls, X,{"orthComp": params_grid})
File "E:/Hai Windows/work/softwares/python_package/OnPLS-master\OnPLS\resampling.py", line 181, in grid_search
name = names[i]
TypeError: 'dict_keys' object does not support indexing
(2) The same example in (1) works by Python 2.7.11, it gave the result below:
(<OnPLS.estimators.OnPLS at 0xa489128>, 0.88410078722573182, {'orthComp': [2, 2, 1]})
I was wondering how to tuning predComp and orthComp together by resampling.grid_search() ?
Thanks.
I download the package and run the test. it reports
FAIL: test_comparison_to_nPLS (tests.test_OnPLS.TestOnPLS)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/bioguo/Desktop/OnPLS/tests/test_OnPLS.py", line 86, in test_comparison_to_nPLS
assert(np.linalg.norm(Xhat[0] - np.dot(t, p3.T)) < 5e-14)
AssertionError
I've been running your script and it seems that it runs without problems with my data. My question is: How can I get global, local and unique variance from the OnPLS model? (so far I'm including 3 tables but the idea is to use 7 - my main aim is to estimate the local variance between 1 table and the rest - I guess this can reduce the computing time, isn't it?)
Dear Prof.Tommy,
I was so excited to read your OnPLS paper and methods and I really want to use your package to do data analysis because this methods is very suitable for my data and study. But I have a question, if you have new version package for the methods, because it is hard to use python 3.4.3 for me. Thanks very much.
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.