Skip to content

Commit a228a5e

Browse files
committed
ENH: Added the fundamental code for building OnPLS models.
1 parent e0b3616 commit a228a5e

File tree

8 files changed

+1623
-0
lines changed

8 files changed

+1623
-0
lines changed

LICENSE

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
The BSD 3-Clause License
2+
3+
Copyright (c) 2013-2014, CEA/DSV/I2BM/Neurospin
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
1. Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
2. Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
3. Neither the name of the CEA/DSV/I2BM/Neurospin nor the names of its
17+
contributors may be used to endorse or promote products derived from this
18+
software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

OnPLS/__init__.py

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
The :mod:`OnPLS` module includes several different machine learning methods
4+
for linear projection-based latent variable methods.
5+
6+
Created on Sun Aug 21 12:42:11 2016
7+
8+
Copyright (c) 2016, Tommy Löfstedt. All rights reserved.
9+
10+
@author: Tommy Löfstedt
11+
12+
@license: BSD 3-clause.
13+
"""
14+
from OnPLS import consts
15+
from OnPLS import estimators
16+
from OnPLS import utils
17+
18+
__version__ = "0.0.1"
19+
20+
__all__ = ["consts", "estimators", "utils"]

OnPLS/consts.py

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
The :mod:`OnPLS.consts` module contains constants used in the package.
4+
5+
Created on Fri Jul 22 21:55:44 2016
6+
7+
Copyright (c) 2016, Tommy Löfstedt. All rights reserved.
8+
9+
@author: Tommy Löfstedt
10+
11+
@license: BSD 3-clause.
12+
"""
13+
import numpy as np
14+
15+
__all__ = ["TOLERANCE", "MAX_ITER", "FLOAT_EPSILON", "FLOAT_INF",
16+
"LIMIT_R2"]
17+
18+
# Settings
19+
TOLERANCE = 5e-8
20+
21+
# TODO: MAX_ITER is heavily algorithm-dependent, so we have to think about if
22+
# we should include a package-wide maximum at all.
23+
MAX_ITER = 1000
24+
25+
FLOAT_EPSILON = np.finfo(float).eps
26+
27+
FLOAT_INF = np.inf
28+
29+
LIMIT_R2 = 0.01

0 commit comments

Comments
 (0)