Student data analysis
Problem description
Exploring the factors related to a student's final grade (study hours, attendance, previous grade, sleep) and building a regression model that predicts it. The data is synthetic.
Objectives
- Computing and reading correlations
- Handling missing values
- Building and evaluating a regression model
Problem type
Regression
Dataset
Tools used
Algorithms
Implementation steps
- In KNIME: File → Import KNIME Workflow… and choose student-performance.knwf, then Execute all.
- Open student-performance.ows in Orange.
- Review Column Statistics to find the missing values (24 values).
- Use Correlations to rank the features by their correlation with final_score.
- Impute, then Test and Score with Linear Regression and Random Forest.
- Avoid using the result column as a feature, because it is derived from the target (data leakage).
Workflow diagram
Orange
DataVisualizeEvaluateModel
↔ Drag the diagram sideways to see all of it.
Connections as text (9)
- File → Data Table (Data)
- File → Column Statistics (Data)
- File → Scatter Plot (Data)
- File → Correlations (Data)
- File → Distributions (Data)
- File → Impute (Data)
- Impute → Test and Score (Data)
- Linear Regression → Test and Score (Learner)
- Random Forest → Test and Score (Learner)
KNIME
SourceManipulatorLearnerPredictorOtherData portModel port
↔ Drag the diagram sideways to see all of it.
Connections as text (8)
- CSV Reader → Column Filter
- Column Filter → Missing Value
- Missing Value → Partitioning
- Partitioning → Linear Regression Learner
- Linear Regression Learner → Regression Predictor
- Regression Predictor → Numeric Scorer
- Partitioning → Regression Predictor
- Missing Value → Linear Correlation
Project files
- CSV datasetCSV11.1 KB
- WEKA ARFF fileWEKA ARFF12.3 KB
- Orange workflow (.ows)Orange7.5 KB
- Data in Orange format (.tab) for the workflowOrange TAB11.2 KB
- Computed reference results (CSV)Results82.0 B
- KNIME workflow (.knwf): ran successfully in the KNIME 5.12 engine (not opened in the interface)KNIME62.0 KB
- Step-by-step implementation guide (PDF)PDF582.8 KB
- Full project package (ZIP)ZIP583.9 KB
The KNIME file (.knwf) was built on KNIME 5.12 and all its nodes ran successfully in the KNIME engine without opening the interface; open it from File → Import KNIME Workflow.
Results
Actual results computed on the attached files
scikit-learn 1.9.1 reference, 10-fold CV, shuffle, random_state=42:
• Linear Regression: MAE 4.86 points, RMSE 6.05 points, R² 0.735
• Random Forest: MAE 5.52 points, RMSE 6.88 points, R² 0.657
Evaluation metrics
- Pearson correlation
- MAE, RMSE and R²
Interpreting the results
Study hours are the most strongly related to the grade. Linear regression beat the random forest here because the generated relationship is mostly linear; the more complex model is not always the best.
Discussion questions
- What is the difference between correlation and causation in this data?
- Why is using the result column data leakage?
- How do the results change if we remove the incomplete rows instead of imputing them?
