Pertemuan 2 (2)
Pertemuan 2 (2)
https://medium.com/@simranjeetsingh1497/the-ultimate-guide-to-machine-learning-machine-learning-
algorithms-part-4-597fbf8bd5dd
EVALUASI MODEL REGRESI
• Forecast Error
• Mean Absolute Error
• Mean Squared Error
• Root Mean Squared Error
• R-squared
Sumber Pustaka:
1. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8279135/pdf/peerj-cs-07-623.pdf
2. Brownlee, J. 2018. Introduction to Time Series Forecasting with Python.
FORECAST ERROR
• The forecast error is calculated as the expected value minus the predicted value.
forecast error = expected value - predicted value
• The example below demonstrates how the forecast error can be calculated for a series of 5
predictions compared to 5 expected values.
Running the example calculates the forecast error for each of the 5 predictions:
Example:
Output:
A mean absolute error of zero indicates no error.
MEAN SQUARED ERROR (MSE)
MSE is calculated as the average of the squared forecast error values. Squaring the forecast
error values forces them to be positive.
mean_squared_error = mean(forecast_error²)
Example:
Output:
A mean squared error of zero indicates perfect skill, or no error.
(RMSE)
The MSE is transformed back into the original units of the predictions by taking the square root of the
mean squared error score. This is called the RMSE.
𝑟𝑚𝑠𝑒 = 𝑚𝑒𝑎𝑛_𝑠𝑞𝑢𝑎𝑟𝑒𝑑_𝑒𝑟𝑟𝑜𝑟
Example:
Output:
The coefficient of determination (Wright, 1921) can be interpreted as the proportion of the
variance in the dependent variable that is predictable from the independent variables.
(worst value = −∞; best value = +1)
TUGAS KELOMPOK (1)
1. Gunakan dataset IceCreamData.csv untuk membuat model prediksi Tingkat penjualan
ice cream pada kondisi temperatur suhu lingkungan tertentu.
2. Gunakan data latih: 70% dan data uji: 30%.
3. Gunakan model prediksi Simple Linear Regression, Decision Trees Regression, Random
Forest Regression, dan Support Vector Regression (SVR) untuk memprediksi
“Revenue.” Gunakan kernel SVR: ‘linear’, ‘poly’, ‘rbf’ dalam eksperimen. Berdasarkan
metrik evaluasi Mean Squared Error, R-squared, Mean Absolute Percentage Error, dan
RMSE; Jelaskan model regresi mana yang terbaik dari eksperimen untuk keempat
model regresi tersebut!
TUGAS KELOMPOK (2)
Jelaskan metode evaluasi untuk model klasifikasi menggunakan:
Confusion Matrix
Precision
Recall
F-measure/F1-score
Accuracy
ROC (receiver operator characteristic) curves
AUC (area under the curve)
Hamming Loss
PENGUMPULAN TUGAS KELOMPOK
1. Pengumpulan tugas dalam bentuk softcopy: (1) Laporan Project; (2) File Source Code. Laporan
“Pertemuan 10.”
4. Pada pertemuan minggu depan, perwakilan kelas yang ditunjuk mendemonstrasikan dan