|
1 | 1 | # 🛠️ Custom Preprocessing Pipelines |
2 | 2 |
|
3 | | -> Create specialized preprocessing flows for your features |
| 3 | +<div class="feature-header"> |
| 4 | + <div class="feature-title"> |
| 5 | + <h2>Custom Preprocessing Pipelines</h2> |
| 6 | + <p>Create specialized preprocessing flows for your features with complete control over transformations</p> |
| 7 | + </div> |
| 8 | +</div> |
| 9 | + |
| 10 | +## 📋 Overview |
| 11 | + |
| 12 | +<div class="overview-card"> |
| 13 | + <p>KDP allows you to define custom preprocessing pipelines for your features, giving you complete control over how each feature is processed before being fed into your model. This is particularly useful when the standard preprocessing options don't meet your specific needs.</p> |
| 14 | +</div> |
| 15 | + |
| 16 | +<div class="key-benefits"> |
| 17 | + <div class="benefit-card"> |
| 18 | + <span class="benefit-icon">🔍</span> |
| 19 | + <h3>Specific Transformations</h3> |
| 20 | + <p>Define custom preprocessing steps not covered by built-in options</p> |
| 21 | + </div> |
| 22 | + <div class="benefit-card"> |
| 23 | + <span class="benefit-icon">🔄</span> |
| 24 | + <h3>Combined Techniques</h3> |
| 25 | + <p>Combine multiple preprocessing techniques in a single pipeline</p> |
| 26 | + </div> |
| 27 | + <div class="benefit-card"> |
| 28 | + <span class="benefit-icon">🧪</span> |
| 29 | + <h3>Domain-Specific</h3> |
| 30 | + <p>Handle specialized data with custom preprocessing logic</p> |
| 31 | + </div> |
| 32 | + <div class="benefit-card"> |
| 33 | + <span class="benefit-icon">🔬</span> |
| 34 | + <h3>Novel Approaches</h3> |
| 35 | + <p>Experiment with new preprocessing methods</p> |
| 36 | + </div> |
| 37 | + <div class="benefit-card"> |
| 38 | + <span class="benefit-icon">🧩</span> |
| 39 | + <h3>Legacy Integration</h3> |
| 40 | + <p>Incorporate existing preprocessing logic</p> |
| 41 | + </div> |
| 42 | +</div> |
| 43 | + |
| 44 | +## 🚀 Getting Started |
| 45 | + |
| 46 | +<div class="code-container"> |
4 | 47 |
|
5 | | -## 🌟 Overview |
| 48 | +```python |
| 49 | +from kdp.features import NumericalFeature, FeatureType |
| 50 | +from tensorflow.keras.layers import Normalization, Dense, Activation |
| 51 | + |
| 52 | +# Create a feature with custom preprocessing steps |
| 53 | +log_transform_feature = NumericalFeature( |
| 54 | + name="revenue", |
| 55 | + feature_type=FeatureType.FLOAT_NORMALIZED, |
| 56 | + preprocessors=[ |
| 57 | + "Lambda", # Using a standard Keras layer by name |
| 58 | + "Dense", # Another standard layer |
| 59 | + "ReLU" # Activation function |
| 60 | + ], |
| 61 | + # Parameters for the layers |
| 62 | + function=lambda x: tf.math.log1p(x), # For Lambda layer |
| 63 | + units=16, # For Dense layer |
| 64 | +) |
| 65 | +``` |
6 | 66 |
|
7 | | -KDP allows you to define custom preprocessing pipelines for your features, giving you complete control over how each feature is processed before being fed into your model. This is particularly useful when the standard preprocessing options don't meet your specific needs. |
| 67 | +</div> |
8 | 68 |
|
9 | 69 | ## 🤔 When to Use Custom Preprocessing |
10 | 70 |
|
|
0 commit comments