Implementing Machine Learning algorithms without using libraries - Python
-
1) K-Nearest Neighbors (KNN folder): is a simple and widely used machine learning algorithm for classification and regression tasks. The algorithm works by finding the k closest training examples in the feature space to a new input data point, and then predicting the output label or value based on the majority vote (in classification) or the mean (in regression) of the k nearest neighbors.
-
2) Linear Regression: is a supervised machine learning algorithm used for predicting a continuous target variable based on one or more input variables, also known as independent variables or predictors. It works by fitting a linear equation to the training data, which can then be used to make predictions for new data. The goal of linear regression is to find the best-fitting line through the data, which minimizes the distance between the predicted values and the actual values. The algorithm calculates the coefficients of the line using the method of least squares, which involves minimizing the sum of the squared differences between the predicted and actual values. Once the coefficients are calculated, they can be used to make predictions for new data by plugging in the input variables and solving for the target variable. Linear regression can be used for both simple and multiple regression problems, where there is only one or more than one input variable respectively.