A GNU Octave project that brings together three small data analysis and machine learning exercises: anomaly detection, kernel regression, and stochastic text generation. The project focuses on implementing the numerical methods directly, without hiding the main logic behind external libraries.
It was built as a practical introduction to working with matrices, linear systems, probability models, and simple supervised learning techniques.
The first module detects outliers in a dataset using a multivariate Gaussian model. It estimates the mean vector and covariance matrix, computes the probability of each data point, and selects the best threshold based on precision, recall, and the F1 score.
The second module implements kernel regression for prediction tasks. It supports linear, polynomial, and Gaussian kernels, builds the kernel matrix, and computes the model parameters using both Cholesky-based solving and the Conjugate Gradient method.
The third module uses Markov chains to generate text. It tokenizes an input file, builds k-sequences from the text, creates a stochastic transition matrix, and samples new words based on the learned probabilities.
anomaly_detection/- functions for Gaussian estimation, probability calculation, and threshold selection;kernel_regression/- kernel functions, matrix construction, numerical solvers, and prediction logic;stochastic_text_generation/- tokenization, Markov-chain modeling, and text sampling;README.md- project documentation.
The code is written for GNU Octave and should be run in a Linux environment.
Example:
tema1_scriptThe exact script or function call depends on the module being tested. Each folder contains functions that can be called separately or through the provided test scripts.
The main purpose of the project is to better understand how numerical methods can be applied to real data problems. The implementation keeps the steps explicit, so the behavior of each method is easier to follow and debug.
Most of the work is done with matrices, vectors, dictionaries, and probability distributions, making the project a good starting point for more advanced machine learning and numerical computing topics.