Skip to content
SmartStudy

Machine Learning and Artificial Intelligence

Technology

Machine Learning and Artificial Intelligence

Syllabus tag: KASNEB CPA | Advanced Level | CA34S1 Business Data Analytics

1. Artificial intelligence and machine learning defined

Artificial Intelligence (AI): the simulation of human intelligence processes by computer systems — reasoning, learning, problem-solving, perception, and language understanding.

Machine learning (ML): a subset of AI where systems learn from data and improve their performance without being explicitly programmed for each task. The algorithm discovers patterns in training data and uses them to make predictions or decisions on new data.

Deep learning: a subset of ML using neural networks with many layers (deep neural networks). Excels at unstructured data — images, speech, text.

2. Types of machine learning

Supervised learning: the model is trained on labelled data (inputs with known correct outputs). The model learns to map inputs to outputs. Examples: regression (predicting a continuous outcome — house prices, revenue), classification (predicting a category — credit default yes/no, fraud detection).

Unsupervised learning: the model finds patterns in unlabelled data without known outputs. Examples: clustering (K-means — grouping customers by behaviour), dimensionality reduction (PCA — compressing high-dimensional data), association rules (market basket analysis — "customers who bought X also bought Y").

Reinforcement learning: an agent learns by interacting with an environment, receiving rewards for desirable actions and penalties for undesirable ones. Used in game-playing AI and robotics.

3. Key ML algorithms

Linear regression: predicts a continuous output as a linear function of inputs. Logistic regression: classifies into binary categories using a sigmoid function (probability of membership in a class). Decision trees: hierarchical, tree-like structure of if-then rules — interpretable but prone to overfitting. Random forests: ensemble of many decision trees; reduces overfitting and improves accuracy. Gradient boosting (XGBoost): sequential ensemble of weak learners — typically best performance on tabular data. Neural networks: interconnected layers of nodes inspired by the human brain — excel at complex pattern recognition.

4. Model evaluation

Confusion matrix (for classification):

                  Predicted Positive  Predicted Negative
Actual Positive   True Positive (TP)  False Negative (FN)
Actual Negative   False Positive (FP) True Negative (TN)

Key metrics: Accuracy = (TP+TN)/(TP+TN+FP+FN); Precision = TP/(TP+FP) — what fraction of positive predictions are correct; Recall (Sensitivity) = TP/(TP+FN) — what fraction of actual positives are detected; F1 score = harmonic mean of precision and recall.

For regression: Root Mean Squared Error (RMSE), Mean Absolute Error (MAE), R² (coefficient of determination).

5. Overfitting and underfitting

Overfitting: model performs well on training data but poorly on new data — it has memorised noise rather than learned patterns. Remedies: more training data, regularisation, simpler model, cross-validation.

Underfitting: model is too simple — fails to capture the underlying patterns even in training data. Remedies: more features, more complex model, more training iterations.

Cross-validation: split data into training, validation, and test sets. k-fold cross-validation: data is split into k subsets; model trained on k-1 subsets and evaluated on the remaining subset, repeated k times.

6. AI in accounting and finance

Accounts payable automation: invoice extraction, matching, and approval using OCR and NLP. Fraud detection: real-time classification of transactions as fraudulent or legitimate. Credit scoring: replacing manual assessment with ML-based scoring. Audit analytics: anomaly detection in journal entries, identification of unusual transactions. Forecasting: ML models for revenue and expense forecasting, outperforming traditional time series in many cases.

Next in Business Data AnalyticsAnalytics Tools — Excel, SQL and Business Intelligence →