Skip to content

Commit

Permalink
edit selection(#4661)
Browse files Browse the repository at this point in the history
Signed-off-by: Yu Wu <yolandawu131@gmail.com>
  • Loading branch information
nemirorox authored and sagewe committed Jul 21, 2023
1 parent dcbcf4a commit 249521c
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 23 deletions.
65 changes: 42 additions & 23 deletions examples/pipeline/test_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,46 @@
# limitations under the License.
from fate_client.pipeline import FateFlowPipeline

pipeline = FateFlowPipeline()
pipeline.upload(file="${abs_path_of_data_guest}",
# file="/data/projects/fate/examples/data/breast_hetero_guest.csv",
head=1,
partitions=4,
namespace="experiment",
name="breast_hetero_guest",
meta={
"label_name": "y",
"label_type": "float32",
"dtype": "float32"
})
pipeline = FateFlowPipeline().set_roles(
local="0")
pipeline.set_site_role("local")
pipeline.set_site_party_id("0")
meta = {'delimiter': ',',
'dtype': 'float32',
'input_format': 'dense',
'label_type': 'int32',
'label_name': 'y',
'match_id_name': 'id',
'match_id_range': 0,
'sample_id_name': 'id',
'tag_value_delimiter': ':',
'tag_with_value': False,
'weight_type': 'float32'}

pipeline = FateFlowPipeline()
pipeline.upload(file="${abs_path_of_data_host}",
# file="/data/projects/fate/examples/data/breast_hetero_host.csv",
head=1,
partitions=4,
namespace="experiment",
name="breast_hetero_host",
meta={
"label_name": None,
"dtype": "float32"
})
pipeline.transform_local_file_to_dataframe( # file="${abs_path_of_data_guest}",
file="/Users/yuwu/PycharmProjects/FATE/examples/data/breast_hetero_guest.csv",
meta=meta, head=True,
namespace="experiment",
name="breast_hetero_guest")

meta = {'delimiter': ',',
'dtype': 'float32',
'input_format': 'dense',
'label_type': 'int',
'match_id_name': 'id',
'match_id_range': 0,
'sample_id_name': 'id',
'tag_value_delimiter': ':',
'tag_with_value': False,
'weight_type': 'float32'}

pipeline = FateFlowPipeline().set_roles(
local="0")
pipeline.set_site_role("local")
pipeline.set_site_party_id("0")

pipeline.transform_local_file_to_dataframe( # file="${abs_path_of_data_host}",
file="/Users/yuwu/PycharmProjects/FATE/examples/data/breast_hetero_host.csv",
meta=meta, head=True,
namespace="experiment",
name="breast_hetero_host")
6 changes: 6 additions & 0 deletions python/fate/components/components/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ def statistics(self):

return statistics

@_lazy_cpn
def hetero_feature_selection(self):
from .hetero_feature_selection import hetero_feature_selection

return hetero_feature_selection

@_lazy_cpn
def toy_example(self):
from .toy_example import toy_example
Expand Down

0 comments on commit 249521c

Please sign in to comment.