代码拉取完成,页面将自动刷新
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
@File : base.py
@Author : Braylon1002
@Version : 1.0
@Contact : S.Braylon1002@gmail.com
Desc : None
"""
from abc import ABC, abstractmethod
from transformers import Column
from transformers.columnFlow import ColumnFlow
class BaseFeature(ABC):
"""
base class for feature column classes
"""
@abstractmethod
def __init__(self, name, column_flow=None):
"""
__init__
:param name: str
name of the feature
:param column_flow: ColumnFlow or list of col transformers
transform the data
"""
self.name = name
self.column_flow = None
if column_flow:
if isinstance(column_flow, ColumnFlow):
self.column_flow = column_flow
elif isinstance(column_flow, list):
self.column_flow = ColumnFlow(column_flow)
elif isinstance(column_flow, Column):
self.column_flow = ColumnFlow([column_flow])
else:
raise NotImplementedError(
"wrong input type with ColumnFlow"
)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。