Skip to main content
Version: 1.0.0

ML Models

TwinEdge's AutoML platform enables you to build, train, and deploy machine learning models for anomaly detection, predictive maintenance, and forecasting without writing code.

Overview

ML Capabilities

CapabilityDescriptionUse Cases
Anomaly DetectionDetect unusual patternsEquipment faults, process deviations
ClassificationCategorize data pointsFault classification, quality control
RegressionPredict continuous valuesEnergy consumption, yield prediction
Time Series ForecastingPredict future valuesDemand forecasting, capacity planning
RUL PredictionRemaining useful lifePredictive maintenance scheduling

Supported Algorithms

Anomaly Detection:

  • Isolation Forest
  • Autoencoder Neural Network
  • One-Class SVM

Classification & Regression:

  • XGBoost
  • Random Forest
  • Gradient Boosting

Time Series:

  • Prophet (Facebook)
  • ARIMA
  • LSTM Neural Network

RUL Prediction:

  • XGBoost with survival analysis
  • Weibull distribution fitting

Dataset Management

Before training models, you need to prepare your data.

Creating a Dataset

  1. Go to MLDatasetsNew Dataset
  2. Choose data source:
    • From Telemetry: Query historical data
    • File Upload: CSV or Parquet files
    • Manual Entry: Direct input

From Telemetry

Query your existing sensor data:

SELECT timestamp, vibration_x, vibration_y, temperature, current
FROM telemetry
WHERE asset_id = 'Pump_001'
AND timestamp >= NOW() - INTERVAL '30 days'

File Upload

Supported formats:

  • CSV (comma or tab separated)
  • Parquet (recommended for large datasets)

Requirements:

  • Header row with column names
  • Timestamp column (if time-series)
  • Numeric columns for features

Data Profiling

After upload, TwinEdge automatically profiles your data:

  • Row count: Total records
  • Column types: Numeric, categorical, datetime
  • Missing values: Percentage per column
  • Statistics: Min, max, mean, std dev
  • Distributions: Histograms for each column

Data Labeling

For supervised learning, label your data:

Manual Labeling

  1. Open dataset → Labels tab
  2. Select rows to label
  3. Apply label (e.g., "Normal", "Fault", "Bearing Failure")

Rule-Based Labeling

Create automatic labeling rules:

IF vibration_x > 7 THEN label = "High Vibration"
IF temperature > 90 AND current > 30 THEN label = "Overload"

Import Labels

Upload a CSV with row IDs and labels.

Training Models

Starting a Training Job

  1. Go to MLTrainingNew Training Job
  2. Complete the wizard:

Step 1: Select Dataset

  • Choose a prepared dataset
  • Review data summary

Step 2: Choose Algorithm

  • Select model type (anomaly detection, classification, etc.)
  • Pick specific algorithm

Step 3: Configure Hyperparameters

  • Use defaults (recommended for beginners)
  • Or customize:
    • n_estimators: Number of trees (50-500)
    • max_depth: Tree depth (3-20)
    • contamination: Expected anomaly rate (0.01-0.1)

Step 4: Review & Launch

  • Confirm settings
  • Name your model
  • Click Start Training

Hyperparameter Optimization

Enable Auto-Optimize to automatically find the best hyperparameters:

  • Uses Bayesian optimization
  • Runs multiple training iterations
  • Selects best performing configuration

Training Progress

Monitor training in real-time:

  • Progress percentage
  • Current epoch/iteration
  • Training loss curve
  • Validation metrics

Training Logs

View detailed logs:

[2026-01-06 10:00:01] Loading dataset: pump_data_30d
[2026-01-06 10:00:05] Dataset loaded: 50,000 rows, 15 columns
[2026-01-06 10:00:06] Starting feature preprocessing
[2026-01-06 10:00:10] Training Isolation Forest model
[2026-01-06 10:05:22] Training complete - Accuracy: 94.2%
[2026-01-06 10:05:25] Model exported to ONNX format

Model Evaluation

Performance Metrics

After training, review model performance:

Classification/Anomaly Detection:

  • Accuracy: Overall correct predictions
  • Precision: True positives / (True + False positives)
  • Recall: True positives / (True + False negatives)
  • F1 Score: Harmonic mean of precision and recall

Regression:

  • MAE: Mean Absolute Error
  • RMSE: Root Mean Square Error
  • : Coefficient of determination

Confusion Matrix

Visual breakdown of predictions:

                Predicted
Normal Anomaly
Actual Normal 450 50
Anomaly 30 470

Feature Importance

See which features most influence predictions:

vibration_x: ████████████████ 45%
vibration_y: ██████████░░░░░░ 35%
temperature: ██████░░░░░░░░░░ 20%

Testing Models

Test with sample data before deployment:

  1. Go to model details → Test Model
  2. Enter sample values:
    {
    "vibration_x": 2.5,
    "vibration_y": 2.1,
    "temperature": 65.0,
    "current": 12.5
    }
  3. View prediction and confidence score

Model Deployment

Deploying to Cloud

Deploy models to run on incoming telemetry:

  1. Go to model details
  2. Click DeployCloud
  3. Configure:
    • Data sources: Which assets to monitor
    • Inference interval: How often to run (1s - 1h)
    • Threshold: Anomaly score threshold (0.0-1.0)
  4. Click Deploy

Deploying to Edge

Deploy models to edge devices for local inference:

  1. Go to model details
  2. Click DeployEdge
  3. Select target devices
  4. Click Deploy

The ONNX model is pushed via OTA to edge devices.

Deployment Status

Monitor deployed models:

  • Active: Running on X data sources
  • Inference rate: Predictions per minute
  • Avg latency: Prediction time
  • Alert count: Anomalies detected

Working with Predictions

Viewing Predictions

See model predictions in dashboards:

  1. Add a Prediction Chart widget
  2. Select the deployed model
  3. View predictions over time

Prediction Alerts

Create alerts based on model output:

When anomaly_score > 0.8 for 60 seconds
Trigger Critical alert

Prediction Export

Export predictions for analysis:

  1. MLModels → Select model
  2. Click Export Predictions
  3. Choose date range and format (CSV/JSON)

Model Lifecycle

Version Control

Each training creates a new model version:

  • pump_anomaly_v1.0.0 - Initial model
  • pump_anomaly_v1.1.0 - Retrained with more data
  • pump_anomaly_v2.0.0 - New algorithm

Model Comparison

Compare multiple model versions:

  1. Select models to compare
  2. View side-by-side metrics
  3. A/B test in production

Retiring Models

When a model is no longer needed:

  1. Undeploy from all data sources
  2. Archive or delete the model
  3. Historical predictions are preserved

Best Practices

Data Quality

  • Sufficient data: 1000+ rows minimum
  • Representative: Include normal and anomalous examples
  • Clean: Handle missing values and outliers
  • Balanced: Anomalies should be 1-10% of data

Model Selection

ScenarioRecommended Algorithm
Equipment fault detectionIsolation Forest
Complex pattern recognitionAutoencoder
Fault classificationXGBoost
Time-series forecastingProphet
RUL predictionXGBoost + survival

Retraining Schedule

  • Monthly: For stable processes
  • Weekly: For dynamic environments
  • On-demand: After process changes

Monitoring Performance

  • Track prediction accuracy over time
  • Monitor for model drift
  • Compare predicted vs actual outcomes
  • Set up alerts for degraded performance

API Reference

List Models

GET /api/v1/ml/models
Authorization: Bearer YOUR_API_KEY

Get Prediction

POST /api/v1/ml/models/{id}/predict
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

{
"features": {
"vibration_x": 2.5,
"vibration_y": 2.1,
"temperature": 65.0
}
}

Response:

{
"prediction": "normal",
"confidence": 0.94,
"anomaly_score": 0.12
}

Next Steps