Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scikit-learn
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ian Johnson
scikit-learn
Commits
7fa40ad5
Commit
7fa40ad5
authored
14 years ago
by
Fabian Pedregosa
Browse files
Options
Downloads
Patches
Plain Diff
Remain compatible with numpy 1.2
parent
8a195624
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
scikits/learn/linear_model/tests/test_least_angle.py
+2
-2
2 additions, 2 deletions
scikits/learn/linear_model/tests/test_least_angle.py
scikits/learn/tests/test_neighbors.py
+4
-5
4 additions, 5 deletions
scikits/learn/tests/test_neighbors.py
with
6 additions
and
7 deletions
scikits/learn/linear_model/tests/test_least_angle.py
+
2
−
2
View file @
7fa40ad5
import
numpy
as
np
import
numpy
as
np
from
numpy.testing
import
assert_
,
assert_array_almost_equal
from
numpy.testing
import
assert_array_almost_equal
from
scikits.learn
import
linear_model
,
datasets
from
scikits.learn
import
linear_model
,
datasets
...
@@ -84,7 +84,7 @@ def test_collinearity():
...
@@ -84,7 +84,7 @@ def test_collinearity():
y
=
np
.
array
([
1.
,
0.
,
0
])
y
=
np
.
array
([
1.
,
0.
,
0
])
_
,
_
,
coef_path_
=
linear_model
.
lars_path
(
X
,
y
)
_
,
_
,
coef_path_
=
linear_model
.
lars_path
(
X
,
y
)
assert
_
(
not
np
.
isnan
(
coef_path_
).
any
())
assert
(
not
np
.
isnan
(
coef_path_
).
any
())
assert_array_almost_equal
(
np
.
dot
(
X
,
coef_path_
[:,
-
1
]),
y
)
assert_array_almost_equal
(
np
.
dot
(
X
,
coef_path_
[:,
-
1
]),
y
)
...
...
This diff is collapsed.
Click to expand it.
scikits/learn/tests/test_neighbors.py
+
4
−
5
View file @
7fa40ad5
import
numpy
as
np
import
numpy
as
np
from
numpy.testing
import
assert_array_almost_equal
,
assert_array_equal
,
\
from
numpy.testing
import
assert_array_almost_equal
,
assert_array_equal
assert_
from
scikits.learn
import
neighbors
,
datasets
from
scikits.learn
import
neighbors
,
datasets
...
@@ -58,13 +57,13 @@ def test_neighbors_iris():
...
@@ -58,13 +57,13 @@ def test_neighbors_iris():
assert_array_equal
(
clf
.
predict
(
iris
.
data
),
iris
.
target
)
assert_array_equal
(
clf
.
predict
(
iris
.
data
),
iris
.
target
)
clf
.
fit
(
iris
.
data
,
iris
.
target
,
n_neighbors
=
9
,
algorithm
=
s
)
clf
.
fit
(
iris
.
data
,
iris
.
target
,
n_neighbors
=
9
,
algorithm
=
s
)
assert
_
(
np
.
mean
(
clf
.
predict
(
iris
.
data
)
==
iris
.
target
)
>
0.95
)
assert
np
.
mean
(
clf
.
predict
(
iris
.
data
)
==
iris
.
target
)
>
0.95
for
m
in
(
'
barycenter
'
,
'
mean
'
):
for
m
in
(
'
barycenter
'
,
'
mean
'
):
rgs
=
neighbors
.
NeighborsRegressor
()
rgs
=
neighbors
.
NeighborsRegressor
()
rgs
.
fit
(
iris
.
data
,
iris
.
target
,
mode
=
m
,
algorithm
=
s
)
rgs
.
fit
(
iris
.
data
,
iris
.
target
,
mode
=
m
,
algorithm
=
s
)
assert
_
(
np
.
mean
(
assert
np
.
mean
(
rgs
.
predict
(
iris
.
data
).
round
()
==
iris
.
target
)
>
0.95
)
rgs
.
predict
(
iris
.
data
).
round
()
==
iris
.
target
)
>
0.95
def
test_kneighbors_graph
():
def
test_kneighbors_graph
():
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment