Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.pipelines
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
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
bob
bob.pipelines
Commits
21565698
Commit
21565698
authored
5 years ago
by
Amir MOHAMMADI
Browse files
Options
Downloads
Patches
Plain Diff
Fix dask_it, mix_me_up, and CheckpointMixin.load
parent
a758bb0e
No related branches found
No related tags found
1 merge request
!15
Fix dask_it, mix_me_up, and CheckpointMixin.load
Pipeline
#38397
failed
5 years ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/pipelines/mixins.py
+3
-5
3 additions, 5 deletions
bob/pipelines/mixins.py
with
3 additions
and
5 deletions
bob/pipelines/mixins.py
+
3
−
5
View file @
21565698
...
@@ -18,7 +18,6 @@ def estimator_dask_it(
...
@@ -18,7 +18,6 @@ def estimator_dask_it(
fit_tag
=
None
,
fit_tag
=
None
,
transform_tag
=
None
,
transform_tag
=
None
,
npartitions
=
None
,
npartitions
=
None
,
mix_for_each_step_in_pipelines
=
True
,
):
):
"""
"""
Mix up any :py:class:`sklearn.pipeline.Pipeline` or :py:class:`sklearn.estimator.Base` with
Mix up any :py:class:`sklearn.pipeline.Pipeline` or :py:class:`sklearn.estimator.Base` with
...
@@ -89,7 +88,6 @@ def estimator_dask_it(
...
@@ -89,7 +88,6 @@ def estimator_dask_it(
dasked
=
mix_me_up
(
dasked
=
mix_me_up
(
[
DaskEstimatorMixin
],
[
DaskEstimatorMixin
],
o
,
o
,
mix_for_each_step_in_pipelines
=
mix_for_each_step_in_pipelines
,
)
)
# Tagging each element in a pipeline
# Tagging each element in a pipeline
...
@@ -111,7 +109,7 @@ def estimator_dask_it(
...
@@ -111,7 +109,7 @@ def estimator_dask_it(
estimator
[
1
].
transform_tag
=
transform_tag
estimator
[
1
].
transform_tag
=
transform_tag
for
estimator
in
o
.
steps
:
for
estimator
in
o
.
steps
:
estimator
.
resource_tags
=
dict
()
estimator
[
1
]
.
resource_tags
=
dict
()
else
:
else
:
dasked
.
fit_tag
=
fit_tag
dasked
.
fit_tag
=
fit_tag
dasked
.
transform_tag
=
transform_tag
dasked
.
transform_tag
=
transform_tag
...
@@ -123,7 +121,7 @@ def estimator_dask_it(
...
@@ -123,7 +121,7 @@ def estimator_dask_it(
return
dasked
return
dasked
def
mix_me_up
(
bases
,
o
,
mix_for_each_step_in_pipelines
=
True
):
def
mix_me_up
(
bases
,
o
):
"""
"""
Dynamically creates a new class from :any:`object` or :any:`class`.
Dynamically creates a new class from :any:`object` or :any:`class`.
For instance, mix_me_up((A,B), class_c) is equal to `class ABC(A,B,C) pass:`
For instance, mix_me_up((A,B), class_c) is equal to `class ABC(A,B,C) pass:`
...
@@ -178,7 +176,7 @@ def mix_me_up(bases, o, mix_for_each_step_in_pipelines=True):
...
@@ -178,7 +176,7 @@ def mix_me_up(bases, o, mix_for_each_step_in_pipelines=True):
# If it is a scikit pipeline, mixIN everything inside of
# If it is a scikit pipeline, mixIN everything inside of
# Pipeline.steps
# Pipeline.steps
if
isinstance
(
o
,
Pipeline
)
and
mix_for_each_step_in_pipelines
:
if
isinstance
(
o
,
Pipeline
):
# mixing all pipelines
# mixing all pipelines
for
i
in
range
(
len
(
o
.
steps
)):
for
i
in
range
(
len
(
o
.
steps
)):
# checking if it's not the bag transformer
# checking if it's not the bag transformer
...
...
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