Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
K
klaus_wendelin
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Eteri
klaus_wendelin
Commits
fecb8e7e
Commit
fecb8e7e
authored
Jul 13, 2020
by
Eteri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_wendelin: add test for importing sklearn
parent
8aa70355
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
bt5/erp5_wendelin/TestTemplateItem/portal_components/test.erp5.testWendelin.py
...tTemplateItem/portal_components/test.erp5.testWendelin.py
+17
-1
No files found.
bt5/erp5_wendelin/TestTemplateItem/portal_components/test.erp5.testWendelin.py
View file @
fecb8e7e
...
...
@@ -325,4 +325,20 @@ class Test(ERP5TypeTestCase):
self
.
assertSameSet
(
data_stream_2
.
getRecursivePredecessorValueList
(),
\
[
data_stream_1
])
self
.
assertSameSet
(
data_stream_5
.
getRecursivePredecessorValueList
(),
\
[
data_stream_4
,
data_stream_3
,
data_stream_2
,
data_stream_1
])
\ No newline at end of file
[
data_stream_4
,
data_stream_3
,
data_stream_2
,
data_stream_1
])
def
test_08_ImportSklearn
(
self
):
"""
Test import of Scikit-learn and minimal example of usage.
"""
from
sklearn.linear_model
import
LinearRegression
X
=
np
.
array
([[
1
,
1
],
[
1
,
2
],
[
2
,
2
],
[
2
,
3
]])
# y = 1 * x_0 + 2 * x_1 + 3
y
=
np
.
dot
(
X
,
np
.
array
([
1
,
2
]))
+
3
reg
=
LinearRegression
().
fit
(
X
,
y
)
predicted
=
reg
.
predict
(
np
.
array
([[
4
,
10
]]))
self
.
assertEqual
(
predicted
.
all
(),
np
.
array
([
27.
]).
all
())
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment