FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
docker-python/tests/test_implicit.py at main · LumaKernel/docker-python · GitHub
LumaKernel
/
docker-python
Public
forked from
Kaggle/docker-python
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
docker-python
/
tests
/
test_implicit.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
32 lines (26 loc) · 1.41 KB
Breadcrumbs
docker-python
/
tests
/
test_implicit.py
Copy path
File metadata and controls
32 lines (26 loc) · 1.41 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import
unittest
import
numpy
as
np
from
implicit
.
als
import
AlternatingLeastSquares
from
scipy
.
sparse
import
csr_matrix
class
TestImplicit
(
unittest
.
TestCase
):
def
test_model
(
self
):
raw
=
[
[
0.0
,
2.0
,
1.5
,
1.33333333
,
1.25
,
1.2
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
],
[
0.0
,
0.0
,
2.0
,
1.5
,
1.33333333
,
1.25
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
],
[
0.0
,
0.0
,
0.0
,
2.0
,
1.5
,
1.33333333
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
],
[
0.0
,
0.0
,
0.0
,
0.0
,
2.0
,
1.5
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
],
[
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
2.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
],
[
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
],
[
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
2.0
,
1.5
,
1.33333333
,
1.25
,
1.2
],
[
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
2.0
,
1.5
,
1.33333333
,
1.25
],
[
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
2.0
,
1.5
,
1.33333333
],
[
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
2.0
,
1.5
],
[
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
2.0
],
[
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
],
]
counts
=
csr_matrix
(
raw
,
dtype
=
np
.
float64
)
model
=
AlternatingLeastSquares
(
factors
=
3
)
model
.
fit
(
counts
,
show_progress
=
False
)
rows
,
cols
=
model
.
item_factors
,
model
.
user_factors
assert
not
np
.
isnan
(
np
.
sum
(
cols
))
assert
not
np
.
isnan
(
np
.
sum
(
rows
))
Back
|
FazBrowse Home
|
New Git URL