cluster.preprocess package¶
Submodules¶
cluster.preprocess.pre_node module¶
cluster.preprocess.pre_node_feed module¶
-
class
cluster.preprocess.pre_node_feed.
PreNodeFeed
[source]¶ Bases:
cluster.preprocess.pre_node.PreProcessNode
Error check rule add : Dataconf Add
cluster.preprocess.pre_node_feed_fr2attn module¶
cluster.preprocess.pre_node_feed_fr2auto module¶
cluster.preprocess.pre_node_feed_fr2cnn module¶
cluster.preprocess.pre_node_feed_fr2seq module¶
cluster.preprocess.pre_node_feed_fr2wcnn module¶
cluster.preprocess.pre_node_feed_fr2wdnn module¶
-
class
cluster.preprocess.pre_node_feed_fr2wdnn.
PreNodeFeedFr2Wdnn
[source]¶ Bases:
cluster.preprocess.pre_node_feed.PreNodeFeed
-
add_none_keys_cate_conti_list
(conti_list, cate_list)[source]¶ Example 을 위한 Continuous 랑 Categorical을 구분하기 위한 list
-
create_feature_columns
(dataconf=None)[source]¶ Get feature columns for tfrecord reader TFRecord에서 feature를 추출
-
input_fn2
(mode, data_file, df, dataconf)[source]¶ Wide & Deep Network input tensor maker V1.0 16.11.04 Initial
:param df : dataframe from hbase :param df, nnid :return: tensor sparse, constraint
-
cluster.preprocess.pre_node_feed_fr2wv module¶
cluster.preprocess.pre_node_feed_img2auto module¶
cluster.preprocess.pre_node_feed_img2cnn module¶
cluster.preprocess.pre_node_feed_img2renet module¶
cluster.preprocess.pre_node_feed_iob2bilstmcrf module¶
cluster.preprocess.pre_node_feed_keras2frame module¶
-
class
cluster.preprocess.pre_node_feed_keras2frame.
PreNodeFeedKerasFrame
[source]¶ Bases:
cluster.preprocess.pre_node_feed.PreNodeFeed
pre_feed_keras2frame
-
class
LabelEncoder
¶ Bases:
sklearn.base.BaseEstimator
,sklearn.base.TransformerMixin
Encode labels with value between 0 and n_classes-1.
Read more in the User Guide.
- classes_ : array of shape (n_class,)
- Holds the label for each class.
LabelEncoder can be used to normalize labels.
>>> from sklearn import preprocessing >>> le = preprocessing.LabelEncoder() >>> le.fit([1, 2, 2, 6]) LabelEncoder() >>> le.classes_ array([1, 2, 6]) >>> le.transform([1, 1, 2, 6]) array([0, 0, 1, 2]...) >>> le.inverse_transform([0, 0, 1, 2]) array([1, 1, 2, 6])
It can also be used to transform non-numerical labels (as long as they are hashable and comparable) to numerical labels.
>>> le = preprocessing.LabelEncoder() >>> le.fit(["paris", "paris", "tokyo", "amsterdam"]) LabelEncoder() >>> list(le.classes_) ['amsterdam', 'paris', 'tokyo'] >>> le.transform(["tokyo", "tokyo", "paris"]) array([2, 2, 1]...) >>> list(le.inverse_transform([2, 2, 1])) ['tokyo', 'tokyo', 'paris']
- sklearn.preprocessing.OneHotEncoder : encode categorical integer features
- using a one-hot aka one-of-K scheme.
-
fit
(y)¶ Fit label encoder
- y : array-like of shape (n_samples,)
- Target values.
self : returns an instance of self.
-
fit_transform
(y)¶ Fit label encoder and return encoded labels
- y : array-like of shape [n_samples]
- Target values.
y : array-like of shape [n_samples]
-
inverse_transform
(y)¶ Transform labels back to original encoding.
- y : numpy array of shape [n_samples]
- Target values.
y : numpy array of shape [n_samples]
-
transform
(y)¶ Transform labels to normalized encoding.
- y : array-like of shape [n_samples]
- Target values.
y : array-like of shape [n_samples]
-
PreNodeFeedKerasFrame.
add_none_keys_cate_conti_list
(conti_list, cate_list)[source]¶ Example 을 위한 Continuous 랑 Categorical을 구분하기 위한 list
-
PreNodeFeedKerasFrame.
create_feature_columns
(dataconf=None)[source]¶ Get feature columns for tfrecord reader TFRecord에서 feature를 추출
-
PreNodeFeedKerasFrame.
input_fn2
(mode, data_file, df, dataconf)[source]¶ Wide & Deep Network input tensor maker V1.0 16.11.04 Initial
:param df : dataframe from hbase :param df, nnid :return: tensor sparse, constraint
-
PreNodeFeedKerasFrame.
input_fn3
(data_file, df, dataconf)[source]¶ Wide & Deep Network input tensor maker V1.0 16.11.04 Initial
:param df : dataframe from hbase :param df, nnid :return: tensor sparse, constraint
-
class