cover photo

COURSEWORK

Liyana's AI-ML-001 course work. Lv 1

Liyana ZuhurAUTHORACTIVE

Level 1 Project Report

7 / 2 / 2023


Linear and Logistic Regression - HelloWorld for AIML Linear Regression is an ML algorithm that determines the relationship between dependent and independent variables and then goes on to use this relationship to make target predictions.
On the other hand, Logistic Regression is a classification algorithm that models the probability of an event by plotting the logarithmic sigmoid of a linear combination of independent variables. Both of these are implemented using existing libraries such as NumPy, Pandas, Scikit-learn and Matplotlib Task (1a) - Predict the price of a home, based on multiple different variables. Use sci-kit’s linear_model.LinearRegression() Task (1b) - Train a model to distinguish between different species of the Iris flower based on sepal length, sepal width, petal length, and petal width. Use sci-kit’s linear_model.LogisticRegression() ## Data Visualization Matplotlib is one the most common Python libraries and is used for data visualization purposes. Different kinds of plots like bar graphs, scatter plots, etc. can be plotted using this library. It works as an extension of NumPy as provides an API for embedding the plots into applications, making it extremely convenient. Task (2) - Using matplotlib and diff kinds of plots. (Bar, scatter, Time Series and Histogram). ## NumPy NumPy is another such important library. Python doesn't support arrays by itself which is where NumPy comes to the rescue. This library supports large arrays and matrices and also provides a large collection of mathematical operations Task (3) - Using Numpy Generate an array by repeating a small array across each dimension and Generate an array with element indexes such that the array elements appear in ascending order. ## Metrics and Performance Evaluation One of the most important aspects of a machine learning algorithm/model is the metrics that calculate some form of accuracy and performance evaluation so that necessary changes can be made to improve the model. Task (4) - Regression Metrics - used to evaluate performance of regression algorithms and Classification Metrics - used to evaluate performance of classification algorithms. ## Linear and Logistic Regression - Coding the model from SCRATCH Knowing what the models do and how they function, we now learn how to code it form scratch by implementing two main concepts - the cost function and the gradient descent. Here, the cost function is the difference between actual and predicted values for the whole of the training data whereas the gradient is calculated by taking partial derivative of the cost function. Task (5) - Coding the regression models from scratch ## K- Nearest Neighbor Algorithm KNN is a supervised learning classification algorithm that makes use of proximity of all other points in order to make a prediction. The premise on which it works is that the data points close to each other have similar values. It can be implemented using sci-kit's existing model or built from scratch making use of what is known as the Euclidean distance function Task (6) - Implementing KNN using sci-kit and from scratch

UVCE,
K. R Circle,
Bengaluru 01