Skip to content

Commit 907dcef

Browse files
author
M.Notter
committed
Remove ordered list indicator
1 parent 0c80986 commit 907dcef

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

_posts/2023-10-23-01_scikit_simple.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ plt.close()
462462

463463
Before wrapping up, let's discuss some important pitfalls to avoid when working on classification tasks:
464464

465-
1. **Data Leakage**: Always split your data before any preprocessing or feature engineering
465+
**Data Leakage**: Always split your data before any preprocessing or feature engineering
466466

467467
```python
468468
# Wrong: Preprocessing before split
@@ -475,7 +475,7 @@ X_tr_scaled = preprocessing.scale(X_tr)
475475
X_te_scaled = preprocessing.scale(X_te)
476476
```
477477

478-
2. **Class Imbalance**: Always check your class distribution
478+
**Class Imbalance**: Always check your class distribution
479479

480480
```python
481481
# Using pandas for better visualization
@@ -493,7 +493,7 @@ plt.xlabel('Class')
493493
plt.ylabel('Frequency (%)')
494494
```
495495

496-
3. **Overfitting**: Monitor these warning signs
496+
**Overfitting**: Monitor these warning signs
497497
- Large gap between training and validation scores
498498
- Perfect training accuracy (like we saw with RandomForest)
499499
- Poor generalization to new data
@@ -507,7 +507,7 @@ print(f"CV Scores: {scores}")
507507
print(f"Mean: {scores.mean():.3f}{scores.std()*2:.3f})")
508508
```
509509

510-
4. **Memory Management**: For large datasets, consider these approaches
510+
**Memory Management**: For large datasets, consider these approaches
511511

512512
```python
513513
# Use n_jobs parameter for parallel processing
@@ -517,7 +517,7 @@ rf = RandomForestClassifier(n_jobs=-1) # Use all available cores
517517
rf = RandomForestClassifier(max_samples=0.8) # Use 80% of samples per tree
518518
```
519519

520-
5. **Feature Scaling**: Different algorithms have different scaling requirements
520+
**Feature Scaling**: Different algorithms have different scaling requirements
521521

522522
```python
523523
# SVM requires scaling, Random Forests don't
@@ -532,7 +532,7 @@ X_te_scaled = scaler.transform(X_te)
532532
rf.fit(X_tr, y_tr) # No scaling needed
533533
```
534534

535-
6. **Model Selection Bias**: Don't use test set for model selection
535+
**Model Selection Bias**: Don't use test set for model selection
536536

537537
```python
538538
# Wrong: Using test set for parameter tuning
@@ -546,7 +546,7 @@ grid.fit(X_tr, y_tr)
546546
# Only use test set for final evaluation
547547
```
548548

549-
7. **Model Troubleshooting Tips**
549+
**Model Troubleshooting Tips**
550550

551551
```python
552552
# Check for data issues first
@@ -564,7 +564,7 @@ if np.any(y_prob > 1.0) or np.any(y_prob < 0.0):
564564
print("Warning: Invalid probability predictions!")
565565
```
566566

567-
8. **Common Error Messages and Solutions**
567+
**Common Error Messages and Solutions**
568568
- `ValueError: Input contains NaN`: Clean your data before training
569569
- `MemoryError`: Reduce batch size or use data generators
570570

_posts/2023-10-23-02_tensorflow_simple.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ plt.show()
365365
### Common Deep Learning Pitfalls
366366
When starting with TensorFlow and neural networks, watch out for these common issues:
367367

368-
1. **Data Preparation**
368+
**Data Preparation**
369369
- (Almost) always scale input data (like we did with `/255.0`)
370370
- Check for missing or invalid values
371371
- Ensure consistent data types
@@ -376,7 +376,7 @@ x_train = x_train.astype('float32') / 255.0
376376
x_test = x_test.astype('float32') / 255.0
377377
```
378378

379-
2. **Model Architecture**
379+
**Model Architecture**
380380
- Start simple, add complexity only if needed
381381
- Match output layer to your task (softmax for classification)
382382
- Use appropriate layer sizes
@@ -391,7 +391,7 @@ model = keras.Sequential([
391391
])
392392
```
393393

394-
3. **Training Issues**
394+
**Training Issues**
395395
- Monitor training metrics (loss not decreasing)
396396
- Watch for overfitting (validation loss increasing)
397397
- Use appropriate batch sizes
@@ -406,7 +406,7 @@ history = model.fit(
406406
)
407407
```
408408

409-
4. **Memory Management**
409+
**Memory Management**
410410
- Clear unnecessary variables
411411
- Use appropriate data types
412412
- Watch batch sizes on limited hardware

_posts/2023-10-23-04_tensorflow_advanced.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ plot_history(history_file=history_file, title="Training overview of best model")
677677

678678
When working with complex neural networks and regression tasks, be aware of these advanced challenges:
679679

680-
1. **Gradient Issues**
680+
**Gradient Issues**
681681
- Vanishing/exploding gradients in deep networks
682682
- Unstable training with certain architectures
683683

@@ -694,7 +694,7 @@ x = layers.BatchNormalization()(x)
694694
x = layers.ReLU()(x)
695695
```
696696

697-
2. **Learning Rate Dynamics**
697+
**Learning Rate Dynamics**
698698
- Static learning rates often suboptimal
699699
- Different layers may need different rates
700700

@@ -720,7 +720,7 @@ def warmup_cosine_decay(step):
720720
return tf.where(step < warmup_steps, warmup_rate, cosine_rate)
721721
```
722722

723-
3. **Complex Loss Functions**
723+
**Complex Loss Functions**
724724
- Multiple objectives need careful weighting
725725
- Custom losses require gradient consideration
726726
- Handle edge cases and numerical stability
@@ -739,7 +739,7 @@ class WeightedMSE(keras.losses.Loss):
739739
return tf.reduce_mean(weighted_errors, axis=-1)
740740
```
741741

742-
4. **Data Pipeline Bottlenecks**
742+
**Data Pipeline Bottlenecks**
743743
- I/O can become training bottleneck
744744
- Memory constraints with large datasets
745745

@@ -757,7 +757,7 @@ def data_generator():
757757
yield x_tr[i:i+batch_size], y_tr[i:i+batch_size]
758758
```
759759

760-
5. **Model Architecture Complexity**
760+
**Model Architecture Complexity**
761761
- Deeper isn't always better
762762
- Skip connections can help with gradient flow
763763

@@ -774,7 +774,7 @@ def residual_block(x, filters):
774774
return layers.ReLU()(x)
775775
```
776776

777-
6. **Regularization Strategy**
777+
**Regularization Strategy**
778778
- Different layers may need different regularization
779779
- Combine multiple regularization techniques
780780

@@ -789,7 +789,7 @@ x = layers.BatchNormalization()(x)
789789
x = layers.Dropout(0.5)(x)
790790
```
791791

792-
7. **Model Debugging**
792+
**Model Debugging**
793793
- Add metrics to monitor internal states
794794
- Use callbacks for detailed inspection
795795
- Clear unused variables and models

0 commit comments

Comments
 (0)