notes

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 4f6bc191bc4dcb2b37ab2e5764f99e4e112e2a09
parent e4912234bd3d0777fd0a2732e542be13c75fb150
Author: Andrew <andrewlaack1@gmail.com>
Date:   Fri, 10 May 2024 21:09:37 -0500

Today's notes

Diffstat:
AKNearestNeighbor.md | 19+++++++++++++++++++
MLinearRegression.md | 9+++++++++
MMachineLearning.md | 3+++
3 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/KNearestNeighbor.md b/KNearestNeighbor.md @@ -0,0 +1,19 @@ +:ml: +# k Nearest Neighbor + +ML CH1 + +## Notes + +**Definition:** k nearest neighbor is the idea of using the k nearest elements of some set to derive some information. + +In ml, this can be used used to find the k nearest neighbor regression of a sample using an instance based approach where you would find the k nearest values and average them. This would then be the prediction for the sample. + +Using sklearn you can specify to load k nearest neighbor as follows: + +```python + +from sklearn.neighbors import KNeighboarsRegressor +model = KNeighborsRegressor(n_neighbors=3) + +``` diff --git a/LinearRegression.md b/LinearRegression.md @@ -8,3 +8,12 @@ ML L2 - Also referred to as ordinary least squares **Definition:** Fitting a straight line to data which allows for arbitrary inputs in the valid domain but not necessarily in the training set, to get accurate outputs. The goal is to find a $\theta$ (parameters) that minimizes $J(\theta)=\frac{1}{2}\sum_{i=1}^{m}(h(x_i) - y_i)^2$. This is called the cost function. + +To load linear regression using SkiLearn do as follows: + +```python3 + +from sklearn.linear_model import LinearRegression +model = LinearRegression() + +``` diff --git a/MachineLearning.md b/MachineLearning.md @@ -10,6 +10,8 @@ Links to ML Notes 1. How do I create new ML models 2. Create chess ML program - [[ReinforcementLearning.md]] +3. Create a walking model + - [[ReinforcementLearning.md]] ## Good Info @@ -59,6 +61,7 @@ Concepts: [[Feature.md]] [[OfflineLearning.md]] [[OnlineLearning.md]] +[[KNearestNeighbor.md]] To do: