Skip to content

Model Prediction (with Copy-Paste) ​

Once a model is trained, the most valuable thing you can do is use it to predict new data.

The traditional approach is a lot of hassle: organize the data into a file → import → match column names → run the prediction → export again. The StarWay Data Insight platform compresses this whole chain into a single action — Ctrl+V.


🚪 Entry ​

Top toolbar → Model Prediction (prediction icon)

⚠️ Prerequisite: You must have a model that is activated and fitted (Fit) in the model list on the right. When no usable model exists, this button cannot be clicked.


📋 Interface Layout ​

When opened, it is a large dialog divided into three sections from top to bottom:

1. Model information bar ​

Displayed itemDescription
InstanceThe name of the current instance
ModelThe current model name + the model type tag (PCA / PLS / PLS-DA / OPLS / OPLS-DA)
MetricsThe model's core evaluation metrics; hover the mouse to see explanations

What the metrics bar displays depends on the model type:

Model typeDisplayed metrics
PLS / OPLS (regression)R² : … | Q² : …
PLS-DA / OPLS-DA (classification)Acc: … | AUC: … | F1: …
PCAUnsupervised model; no prediction metrics are displayed

💡 Take a look at the metrics before predicting: if Q² is only 0.3, the prediction results themselves are of limited credibility, so don't push your conclusions too far.

2. Data table area ​

  • The first column is the row number index
  • Then come the X columns (the header shows two rows: the upper row is the variable's English name, the lower row is the Chinese name)
  • Then the original Y columns (if you paste the true values along with the data, they can be used for on-the-spot validation)
  • Finally the prediction columns, with a header such as x3 (Predicted)

3. Prediction comparison chart area ​

After you click "Predict", each Y variable automatically generates a prediction comparison chart, with evaluation metrics displayed in real time above the chart:

Model typeChart metrics
RegressionRMSE (root mean square error), R² (coefficient of determination), MAE (mean absolute error)
ClassificationAcc (accuracy), F1 (macro F1 score), Precision (macro precision)

💡 Hover over any metric to see a plain-language explanation. For example, R² = "how well the prediction model fits the real data; the closer to 1, the better".


📥 How to Feed Data In: Copy and Paste ​

This is the only input method for the prediction panel — there is no need to import a file.

Steps ​

  1. In Excel, select the data range you want to predict and copy it with Ctrl+C / Cmd+C
  2. Go back to the prediction dialog and click once inside the dialog area (so that the dialog gets focus)
  3. Paste with Ctrl+V / Cmd+V
  4. When you see the "Successfully pasted N rows of data" message, it is done
  5. Click Predict

⚠️ The single most critical rule: the column order must match ​

The platform reads pasted data by column order, and does not match by column name. Therefore:

Make sure the column order of the pasted data is exactly the same as the order of the X variable list (and the Y variable list).

The figure above gives explicit hints:

  • PCA models: "Please click inside this area, then use Ctrl+V / Cmd+V to paste the X variable data from Excel, making sure the column order matches the X variable list."
  • Other models: "…paste data, making sure the column order matches the X and Y variable lists."

Paste format requirements ​

  • Simply copy directly from Excel (tab-separated); there is no need to save it as CSV
  • Pasting multiple rows at once is supported, for batch prediction
  • The number of columns should correspond to the number of X (+ Y) variables

💡 Recommended practice: rearrange the new data in Excel into the same column order as the prediction panel's header before copying, which avoids order misalignment.


📤 Output Results: Paste Back to Excel in One Click ​

After the prediction is complete, click Copy Results:

  • The results are written to the system clipboard, with the message "Results copied to the clipboard; you can paste them directly into Excel"
  • Go back to Excel and press Ctrl+V to paste the predicted values back into your original table

This forms a closed loop: Excel → paste into the platform → predict → paste back into Excel, with no intermediate files produced at any point.

Other actions ​

ButtonFunction
ClearClears the currently pasted data and prediction results
PredictRuns the prediction on the data in the table

💡 If the pasted data also contains the true Y values, RMSE / R² (or Acc / F1) are calculated and displayed automatically after prediction — effectively an external validation done along the way.


🔄 Reverse Prediction: Working Back from the Target to the Parameters ​

Besides "predicting Y from X", the platform also provides a reverse calculation capability: given the principal component scores of a target, it back-calculates the corresponding raw variable values.

This capability has no separate button; it is integrated into the Explore Mode of Model Exploration:

  • Drag the red dot on the score plot to the target position
  • The X-Space / Y-Space panel below displays the theoretical values of each variable in real time

💡 This is where the answer to "to reach this quality metric, what should the process parameters be set to" comes from. See Model Exploration and Parameter Optimization for details.


🎯 Typical Use Cases ​

Use case 1: Quick judgment of incoming materials

Receive the test data of a new batch of raw materials → copy it in X column order → paste it into the prediction panel → predict → copy the results back

Use case 2: Offline data re-validation

Paste in historical data (including the true Y) → predict → look at R² / RMSE → evaluate the model's actual performance on that batch

Use case 3: Multi-target prediction

When a PLS model has multiple Y columns, each Y gets its own comparison chart and its own set of metrics

Use case 4: Reverse optimization

Model Exploration → Explore Mode → drag the red dot to the target quality region → read X-Space → get the recommended process parameters

⚠️ Notes ​

  • Order-sensitive: a misaligned column order will not raise an error, but it will produce completely wrong prediction results — this is the most common usage accident
  • Do not paste the header row: paste only data rows; column names are not recognized
  • Numeric format: make sure the cells are numbers rather than text (in Excel, left-aligned "numbers" are often text)
  • PCA models can only show structure: an unsupervised model has no Y, so the prediction panel is mainly used to view the projection of samples in the latent space
  • Extrapolation risk: if the value range of the new data clearly exceeds that of the training data, the credibility of the prediction drops — refer to the boundary violations (Violations) hints in Model Exploration

Let data speak, make decisions simpler.