In analysis, the hard part is not the math but what to choose and how to read it
Skari connects this whole process into one flow.
ANALYSIS FLOW
One analysis,
carried from setup to report
Discriminant analysis
Finds the boundary that best separates groups from a combination of variables (the discriminant function).
01 · CHOOSE
Which analysis to use, guided
by your data and research goal
Analysis Recommendation
Analysis Assistant
Dataset overview
Your dataset contains 150 rows and 5 variables (4 numeric, 1 categorical). Tell me about your research question — I'll recommend the best methods strictly from the catalog.
I want to know how well the four flower measurements can tell the species (Species) apart.
With a categorical outcome (3 species), 4 numeric predictors and 150 observations, I recommend:
I. Recommended
- • Discriminant Analysis (LDA) — estimates the discriminant functions that best separate the species from the measurements
- • Multinomial Logistic Regression — compares classification performance without normality or covariance assumptions
II. Explore first
- • Descriptive Statistics — mean and spread of each measurement by species
- • Correlation Analysis — checks correlations between measurements (multicollinearity)
- • One-Way ANOVA — differences in mean Petal.Length by species
III. Also useful
- • PCA — summarizes the 4 measurements on 2–3 axes to show the distribution
02 · SET UP · CHECK
See why each setting matters,
and validate data and assumptions before you analyze
Analysis setup
Every option comes with a plain-language explanation, so you always know what it does and why it matters.
Detailed settings
Settings: LDA parameters
Solver
Shrinkage
n_components (max: 4)
Leave empty to set automatically (= min(n_features, n_classes − 1))
Test size20%
CV folds5
LDA assumes every class shares the same covariance matrix. Use shrinkage for high-dimensional data.
What does each setting mean?
Solver
The mathematical algorithm used to compute the LDA solution.
- SVD
- Default. Numerically stable for most cases
- Least Squares
- Auto-selected when shrinkage is enabled
- Eigenvalue
- Best for small datasets; slowest option
Note — In most cases, leave this as SVD (default).
Shrinkage
A regularization technique that prevents the model from overfitting to the training data.
- None
- No regularization. Use when samples are plentiful
- Auto (Ledoit-Wolf)
- Automatically applies optimal regularization
Note — Choose Auto when the number of features is close to or exceeds the number of samples.
Test size
The share of data held back as a test set to evaluate the trained model; the rest is used for training.
- 0.20 (20%)
- Standard recommended value
- 0.30 (30%)
- More stable evaluation, but less training data
Note — For datasets under 200 samples, keep this at 0.20 and increase CV Folds instead.
CV Folds
The number of folds in k-fold cross-validation. More folds give more reliable estimates but take longer to compute.
- 5-fold
- Standard default for most datasets
- 10-fold
- Recommended for smaller datasets; more reliable results
Note — CV scores are always more reliable than a single train/test split.
Data validation
Before running, Skari validates your data — target, features, sample size, and missing values — to catch problems early.
Data validation
Checking requirements
Target selected
Species
Features selected
4 features selected
Sample size (n >= 50)
n = 150
Training samples
~120 training samples
No missing values in selected columns
None found
Training configuration
Method: LDA
Solver: svd
Shrinkage: None
n_components: Auto
Features: 4
Train/test: 80% / 20%
CV folds: 5
Training samples: ~120
Test samples: ~30
LDA will identify linear decision boundaries that maximize separation between classes, assuming equal covariance across groups.
03 · SUMMARY · INTERPRETATION
Instead of listing result tables,
the verdict and its evidence, together
Result summary
Summary — verdict, effect size, key numbers
Result Summary
Discriminant analysis (LDA) · Species ← 4 features · n = 150
Key findings
- • Model performance: Test accuracy = 100.0% — strong performance on the 30-sample holdout.
- • Cross-validation: 97.5% ± 3.3% — moderate stability across folds.
- • Overfitting check: Train−test gap = −2.5%p — test accuracy is higher, so no sign of overfitting.
- • Most discriminating feature: Petal.Length (standardized discriminant coefficient share 54.5%) — contributes most to separating the classes.
- • Class balance: Macro F1 = 100.0% — weights every class equally, so it exposes per-class gaps.
- • Covariance homogeneity: Box's M p < .001 — covariances differ — LDA assumes equal class covariance matrices; QDA does not.
Assumption check (automatic)
Covariance homogeneity (Box's M): χ²(20) = 118.474, p < .001 — covariance heterogeneity detected.
The class covariance matrices differ — QDA, which fits a separate covariance per class, is recommended, but the LDA result above is reported as is. Note that Box's M is sensitive to non-normality and large samples.
Model selection path
Interpreting the result
Reasoning — assumption checks, decision logic
Interpreting the result
What drove the LDA model’s performance
1How is the analysis done?
- • Purpose — Classify cases into groups that are already defined, and find the combination of variables that best separates them
- • Method — Find discriminant axes that maximise between-class differences and minimise within-class differences, then assign new data to the nearest class
- • Discriminant function test — Wilks' Λ tests the class mean differences; a p-value below 0.05 means the groups differ significantly
- • LDA vs QDA — LDA assumes a shared covariance and draws linear boundaries; QDA uses a covariance per class and draws more flexible, non-linear boundaries
- • Model limits — LDA can only draw linear boundaries, so performance is limited when the class structure is complex or overlapping
2What are the main results?
- • Model setup — An LDA model with 150 samples, 4 features and 3 classes
- • Data split — Split into 120 training and 30 test cases
- • Test accuracy — 100.0%, against a training accuracy of 97.5% — a train−test gap of −2.5%p (test is higher)
- • Cross-validation — Mean 5-fold accuracy is 97.5%, with a spread of ±3.3%p
- • Classification — Macro precision and recall are both 100.0%, and AUC is 1.000
- • Key features — Standardized discriminant coefficient shares: Petal.Length 54.5%, Petal.Width 26.6%, Sepal.Length 10.2%, Sepal.Width 8.6%
- • Wilks' Λ test — Λ = 0.0227, p < 0.001 — the classes differ significantly
- • First discriminant function — Explains 99.0% of the total separation, with a canonical correlation of 0.985
- • Samples per feature — About 37.5 samples were used per variable
3What does this result mean?
- • Conclusion — The LDA model classifies every case in the test data correctly and generalises well
- • Against the baseline — About 66.7%p better than a baseline that always predicts the largest class
- • Stability — The cross-validation spread (±3.3%p) is moderate. Fold accuracy ranges from 91.7% to 100%, so performance can shift somewhat with the split
- • Overfitting — Test accuracy is higher than training accuracy, so there is no sign of over-fitting the training data
Quality Dimensions
Each factor graded Good / Moderate / Weak, so strengths and weak spots show at a glance.
Model selection path
Quality dimensions
There is a problem with covariance homogeneity.
Diagnostic guide & alternatives
Plain thresholds for every metric, plus when a different method fits better — the reasoning behind the grade, not just the number. Every analysis gets its own.
Learn more: diagnostic guide & alternatives
Test accuracy
≥ 0.90 excellent
0.80–0.89 good
0.70–0.79 acceptable
< 0.70 needs improvement
Train−test gap
< 3% negligible
3–8% minor, acceptable
> 8% notable — shrinkage / more data
Wilks' Λ (group separation)
< 0.30 strong separation
0.30–0.60 moderate
> 0.60 limited
LDA vs QDA
LDA: equal covariance, linear boundary, stable
QDA: unequal covariance, curved, needs ≥50/class
Small sample → prefer LDA or add shrinkage
When to consider an alternative
Compare without the normality assumption: Logistic regression
Linearity in doubt: Random forest
Estimate accuracy on held-out data: Cross-validation
Non-linear decision boundary: SVM
Correlated predictors: PCA
Pairwise relations between predictors: Correlation analysis
04 · REPORT TEXT
Sentences for your paper or report,
written from your own data
Interpretation
The LDA discriminant classifier reached 100.0% test accuracy and a macro F1 of 1.000 on the task of classifying iris species.
Results Summary
- •All 30 test observations were classified correctly, and precision, recall and F1 are 1.000 for each of the three species (setosa, versicolor, virginica).
- •Test accuracy (100.0%) is higher than training accuracy (97.5%), so there is no sign of overfitting. iris separates its species clearly, so a perfect score is not unusual — but with only 30 test cases a single miss moves accuracy by 3.3%p, so report the cross-validation result (97.5% ± 3.3%p) alongside it.
- •Petal.Length and Petal.Width are the key discriminating variables. Their permutation importances are also the highest (0.573 and 0.307), so petal measurements drive the species separation.
- •Sepal.Length and Sepal.Width contribute relatively little (standardized discriminant coefficient shares 10.2% and 8.6%). Sepal.Width’s permutation importance in particular is 0.017, so dropping it barely changes classification performance.
- •Wilks’ lambda is 0.0227 and significant (p < 0.001), showing the three species are clearly separated in the linear discriminant space.
Recommendations
- •With only 30 test cases, report the mean and standard deviation of repeated stratified cross-validation (e.g. 5 folds × 10 repeats) as the main performance measure instead of a single-split score.
- •When applying it to new data, check that the measurement quality and distribution of Petal.Length and Petal.Width match the current data. Performance will drop most if these two shift.
- •Compare LDA with QDA and other classifiers to check that a linear boundary holds, choosing the model on mean CV accuracy and its variability.
- •In production, monitor the per-class confusion matrix and predicted probabilities, not just accuracy, to catch new observations that fall outside the three existing species.
05 · VISUALS · SIMULATION
Don't stop at the tables —
move things and watch the results change
Depending on the analysis, Skari offers 2D and 3D views, simulation and a prediction profiler, so you can see for yourself under which conditions the results change.
3D Scatter Plot
The 150 rows are placed on the three most discriminating variables (Petal.Length · Petal.Width · Sepal.Length). The discriminant space for three species (LD1·LD2) has only two dimensions, so the 3D view uses the original measurements. Distances on screen change with the camera angle, so read positions by axis values rather than by the gaps between points.
X Petal.Length (1.0 ~ 6.9 cm)Y Petal.Width (0.1 ~ 2.5 cm)Z Sepal.Length (4.3 ~ 7.9 cm)150 points
Colour by
Species
Click a group to hide it. Drag the plot to rotate.
Display
Discriminant boundary simulation
Change the conditions and see how the boundary and accuracy shift.
· This simulation is an illustration; results on real data may differ.
06 · USE THE RESULTS
Take your results straight into
reports, tables and R/Python code
Discriminant analysis results
Table 1. Per-class metrics
| Class | Prec. | Rec. | F1 |
|---|---|---|---|
| setosa | 1.00 | 1.00 | 1.00 |
| versicolor | 1.00 | 1.00 | 1.00 |
| virginica | 1.00 | 1.00 | 1.00 |
Word
.docx
Research-ready report with APA tables and charts
Excel
.xlsx
Every result table in one workbook — one sheet per table
# 2. Settings: LDA fit <- MASS::lda(Species ~ ., data = train) pred <- predict(fit, test) table(pred$class, test$Species)
R
.R
A script that reproduces the result with the packages that analysis needs
# 2. Settings from sklearn.discriminant_analysis import LinearDiscriminantAnalysis lda = LinearDiscriminantAnalysis() lda.fit(Xtr, ytr)
Python
.py
Code that reproduces the result with the libraries that analysis needs
Reproducible code
Every analysis comes with the R or Python code actually used for the calculation. The variables and settings you picked on screen carry straight into the code, and the code is commented along the six-step flow so you can follow which function and option each setting becomes.
# 1. Variables: the outcome (Species) and four features from sklearn.datasets import load_iris iris = load_iris(as_frame=True) X, y = iris.data, iris.target # 2. Settings: LDA · SVD solver · no shrinkage from sklearn.discriminant_analysis import LinearDiscriminantAnalysis from sklearn.preprocessing import StandardScaler from sklearn.model_selection import train_test_split # 3. Validation: 20% test set, stratified split (120 train · 30 test) Xtr, Xte, ytr, yte = train_test_split(X, y, test_size=0.2, random_state=42, stratify=y) scaler = StandardScaler().fit(Xtr) # 4. Summary: fit, then test and train accuracy lda = LinearDiscriminantAnalysis(solver="svd").fit(scaler.transform(Xtr), ytr) print("test:", lda.score(scaler.transform(Xte), yte), " train:", lda.score(scaler.transform(Xtr), ytr)) # 5. Interpretation: variance explained by each discriminant function print("LD1·LD2:", lda.explained_variance_ratio_.round(3))
Output print output
test: 1.0 train: 0.975 LD1·LD2: [0.99 0.01]
✓ Matches the on-screen resultIt produces the same 100.0% test accuracy, 97.5% training accuracy and 99.0% for the first discriminant function as the results above.
07 · ANALYSIS HELP
Where you get stuck mid-analysis,
you can check it right there
Analysis Chat
Answers your questions based on your current results.
Analysis Help
onlineBox's M came out p < .001 — can I still use the LDA result?
It means the three species do not share one covariance matrix, so QDA is the recommended check. But Box’s M is sensitive to non-normality and large samples, and here LDA reached 100.0% test and 97.5% ± 3.3%p CV accuracy— high enough that the LDA result is still reported.
What would change if I re-ran it as QDA?
QDA draws a curved boundary from each species’ own covariance. Re-run that way it reaches 100.0% test and 96.7% ± 3.1%p CV accuracy — almost the same as LDA, so reporting the simpler LDA is enough.
Method Guides
Explains when to use each analysis, with examples.
Discriminant Analysis Guide
When should you use it?
A model that combines variables so cases are alike within a group and as far apart as possible between groups — for example, telling iris species apart from petal length and width.
Requirements
- Target: categorical (2+ classes)
- Features: continuous / numeric
- Sample size: 50+ observations
Reading the results
- LDA projection: visualises separation
- CV score: model stability
- Metrics: accuracy, F1, AUC
LDA or QDA?
Start with LDA — it is simpler, more interpretable and more robust to small samples. If LDA accuracy is noticeably lower and you have ≥ 50 observations per class, try QDA.
Glossary
Explains statistical terms like p-value and effect size in plain words.
Discriminant Analysis Glossary
Key terms and concepts used in this analysis
F1 Score
The harmonic mean of precision and recall, providing a balanced measure of both metrics.
CV Mean
The mean accuracy across all cross-validation folds — a more reliable estimate than a single train/test split.
QDA
Quadratic Discriminant Analysis allows each class to have its own covariance matrix, creating curved decision boundaries.
Shrinkage
A regularization technique that shrinks the covariance estimate, useful for high-dimensional data.
Insight at the bottom of every card
Every result card notes what the numbers mean and what to watch for.
A few top variables usually carry most of the discriminating power; low-importance variables can often be dropped without much effect on model performance.
08 · COVERAGE
From basic statistics to advanced analysis,
110+ analyses in 9 categories
ALSO IN YOUR DATA LAB
More analysis tools.
Every lab is purpose-built for a different type of analysis — same interface, different lens.
Start analyzing in 30 seconds.
Upload your data and go from results to report quickly, in one flow.