Sažetak | Na početku rada umjetna inteligencija je smještena u odnosu na organizaciju današnje znanosti te su dane grane umjetne inteligencije s obzirom na njezine podjele u literaturi. Shodno tome, strojno učenje kao grana umjetne inteligencije smješteno je u šire područje struke te su dane njegove definicije. Nakon toga, usvojena je notacija za strukturiranje i prikazivanje podataka te je napravljena podjela algoritama strojnog učenja. U ovom radu su obrađeni algoritmi strojnog učenja linearna regresija s jednom varijablom, linearna regresija s više varijabli, logistička regresija, naivni Bayes i stabla odlučivanja. Svaki algoritam je matematički opisan, odnosno opisano je kako i zašto algoritam radi na „najnižoj“ razini, što je omogućilo komentiranje rezultata pokretanja navedenih algoritama. Prije primjene dan je kratak pregled programskog jezika Python i pregled biblioteke Tensorflow. Navedeni algoritmi, osim naivnog Bayesa, su implementirani u programskom jeziku Python. Za linearnu regresiju s jednom varijablom, linearnu regresiju s više varijabli i logističku regresiju se koristila biblioteka Tensorflow, dok se za stabla odlučivanja koristila biblioteka scikit-learn. Naivni Bayes je implementiran ručno izračunavanjem vjerojatnosti na skupu podataka „Weather“. Rezultati pokretanja svakog algoritma su proučeni te komentirani. Komentari se temelje na matematičkim definicijama algoritama (hipoteza, značajke, izvedene značajke, funkcija koštanja, minimiziranje funkcije koštanja) te su rezultati pokretanja svakog algoritma povezani sa matematičkom podlogom za taj algoritam. |
Sažetak (engleski) | At the beginning of the work, artificial intelligence is located in relation to the organization of today's science, and the branches of artificial intelligence are given with regard to its divisions in the literature. Consequently, machine learning, a branch of artificial intelligence, is located in a wider area of the profession and its definitions are given. After that, a notation for structuring and presenting data was adopted and a division of machine learning algorithms was made. This paper deals with machine learning algorithms linear regression with one variable, linear regression with multiple variables, logistic regression, naive Bayes, and decision trees (more precisely, ID3 algorithm for decision trees). Each algorithm is mathematically described, i.e., it is described how and why the algorithm works at the "lowest" level, which allowed commenting on the results of starting these algorithms on test data sets. Before application, a brief overview of the Python programming language and an overview of the Tensorflow library is given. These algorithms, besides naive Bayes, are implemented in the Python programming language. The Tensorflow library was used for implementing linear regression with one variable, linear regression with multiple variables, and logistic regression, while the scikit-learn library was used for decision trees. Naive Bayes was implemented manually by calculating the probabilities on the test data set "Weather". The results of running each algorithm were studied and commented on. The comments are based on the mathematical basis of the algorithms (hypothesis, features, derived features, cost function, cost function minimization) and the results of running each algorithm are related to the mathematical basis for that algorithm, i.e., the mathematical basis is applied to explain, e.g., the functional form of the resulting hypothesis function which approximates the underlying function, the value of the cost function on the test data set, the flexibility of different hypothesis functions, etc. |