Target Extraction

The target extraction process is handled by the extract_targets method, which prepares the target variables for training.


Target Type Identification

The method identifies each target as either numeric or categorical.


Ethereum Address Handling

Ethereum addresses are treated as categorical variables.


Numeric Target Scaling

For numeric targets:

scaler = StandardScaler()
y_scaled = scaler.fit_transform(y_values)

Categorical Target Encoding

For categorical targets:

encoder = OneHotEncoder(sparse=False, handle_unknown='ignore')
one_hot_values = encoder.fit_transform(np.array(string_values).reshape(-1, 1))

Multi-target Handling

The method can handle multiple targets, combining them into a single 2D numpy array.


Usage

Both methods are called during the model training process:

X, feature_types, feature_encoders, n_features = self.feature_engineering(data, features, mode='train')
y, target_types, target_encoders = self.extract_targets(data, targets)

Advantages

  • Handles various data types automatically

  • Applies appropriate transformations for each data type

  • Supports multi-target scenarios

  • Preserves information about feature and target transformations for consistent prediction

Last updated