Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
514 commits
Select commit Hold shift + click to select a range
a6eb54b
Update and rename mathematicsss.md to 1.generalIdeas.md
mevianna Apr 27, 2025
c915d34
Create graph.png
mevianna Apr 27, 2025
bab35f7
Add files via upload
mevianna Apr 27, 2025
26b056c
Update 1.generalIdeas.md
mevianna Apr 27, 2025
ed27a5c
Rename Grafico1.png to grafico1.png
mevianna Apr 27, 2025
bd0029c
Rename Graph1.png to graph1.png
mevianna Apr 27, 2025
d974637
Delete KNN/3.mathematics/Figures/graph.png
mevianna Apr 27, 2025
1c257de
Update 1.generalIdeas.md
mevianna Apr 27, 2025
140faaf
Create 2.distances.md
mevianna Apr 27, 2025
c19f48b
Update 2.distances.md
mevianna Apr 27, 2025
79cd3d6
Update The_Math_behind_the_Mith.md
ITA-LOW Apr 27, 2025
638ea0a
Update The_Math_behind_the_Mith.md
ITA-LOW Apr 27, 2025
398be5b
Update The_Math_behind_the_Mith.md
ITA-LOW Apr 27, 2025
fdc39df
Update The_Math_behind_the_Mith.md
ITA-LOW Apr 27, 2025
6406603
Value of K and corrections
rafasavaris Apr 27, 2025
080d1b5
new file
rafasavaris Apr 27, 2025
fbb2b7a
typical problmens
rafasavaris Apr 28, 2025
6e9aba9
correçao link
rafasavaris Apr 28, 2025
384222e
Update 4.Typical_problems.md
rafasavaris Apr 28, 2025
8f6397c
fields of use of k-NN
rafasavaris Apr 29, 2025
37218c6
Adicionando parte de matematica
SeidiDucher Apr 30, 2025
cdd3c42
Modificando
SeidiDucher Apr 30, 2025
2cae539
Modifica
SeidiDucher Apr 30, 2025
0e5ac6f
alterando
SeidiDucher Apr 30, 2025
1fe5d61
altera
SeidiDucher Apr 30, 2025
6b71253
altera
SeidiDucher Apr 30, 2025
a686ce0
modificando
SeidiDucher Apr 30, 2025
517e118
modif
SeidiDucher Apr 30, 2025
37d82c9
modif
SeidiDucher Apr 30, 2025
d8ae353
modif
SeidiDucher Apr 30, 2025
2ab7cf8
update how to determine the value of k
rafasavaris May 1, 2025
caec289
update Typical problems
rafasavaris May 1, 2025
be011d4
update Fields of use
rafasavaris May 1, 2025
64b55bb
Update 2.distances.md
mevianna May 2, 2025
496f29d
Add files via upload
mevianna May 2, 2025
8c8df25
Update 2.distances.md
mevianna May 2, 2025
b98ecbf
add readme
ITA-LOW May 2, 2025
f2f1b7c
add readme
ITA-LOW May 2, 2025
f0bc575
Create README.md
ITA-LOW May 2, 2025
c0d4d1d
Update LICENSE
ITA-LOW May 2, 2025
6c75403
Update README.md
ITA-LOW May 2, 2025
688bafd
Update LICENSE
ITA-LOW May 2, 2025
7f1e2f5
Update README.md
ITA-LOW May 2, 2025
aaf6b43
Update README.md
ITA-LOW May 2, 2025
d01c656
Update README.md
ITA-LOW May 2, 2025
87ec6e9
Update and rename LICENSE to LinearRegression/LICENSE
ITA-LOW May 2, 2025
061a100
Create README.md
ITA-LOW May 2, 2025
823b634
Create LICENSE
ITA-LOW May 2, 2025
60ab62b
Create LICENSE
ITA-LOW May 2, 2025
516a797
Update README.md
ITA-LOW May 2, 2025
24d3b18
Update LICENCE
ITA-LOW May 2, 2025
c736b18
Update 2.distances.md
mevianna May 2, 2025
6e815db
Delete KNN/3.mathematics/Figures/cosinesimilarity.png
mevianna May 3, 2025
fafdacc
Delete KNN/3.mathematics/Figures/similaridadecosseno.png
mevianna May 3, 2025
7989cfb
Add files via upload
mevianna May 3, 2025
dcfe4de
Update 2.distances.md
mevianna May 3, 2025
1f97bdd
Update 1.generalIdeas.md
mevianna May 3, 2025
f148ef9
Update 2.distances.md
ITA-LOW May 3, 2025
6d1a447
Update 2.distances.md
ITA-LOW May 3, 2025
aeff934
Update 2.distances.md
mevianna May 3, 2025
e81f683
Update 2.distances.md
mevianna May 3, 2025
6160a7b
Update 2.distances.md
mevianna May 3, 2025
13e2cd4
Update 2.distances.md
mevianna May 3, 2025
09a0a79
Update 2.distances.md
mevianna May 3, 2025
6b2634c
Update 2.distances.md
mevianna May 3, 2025
fd32234
Create 3.kInRegressionAndClassification
mevianna May 4, 2025
68a0ddd
Rename 3.kInRegressionAndClassification to 3.kInRegressionAndClassifi…
mevianna May 4, 2025
df5ccf5
Update 3.kInRegressionAndClassification.md
mevianna May 4, 2025
49140ef
Update 3.kInRegressionAndClassification.md
mevianna May 4, 2025
e62e6a5
Update 1.history.md
beastartare May 4, 2025
9416b45
Update 1.history.md
beastartare May 4, 2025
1e12058
Update 1.history.md
mevianna May 4, 2025
2663e25
Create PFVerhulst.png
mevianna May 4, 2025
aee4048
Delete LogisticRegression/1.concepts/Figures/PFVerhulst.png
mevianna May 4, 2025
c7ce4da
Create a.png
mevianna May 4, 2025
d2d19e4
Add files via upload
mevianna May 4, 2025
233d1a6
Create 2. Practice.md
ITA-LOW May 4, 2025
56d54ae
Update 1.history.md
mevianna May 4, 2025
b67a388
Atualização final
ITA-LOW May 4, 2025
ea1d845
Update 1.history.md
mevianna May 4, 2025
33e8efd
Update 1.history.md
mevianna May 4, 2025
7e35a16
Update 2.typicalProblems.md
mevianna May 4, 2025
2d59862
Create 6.Nearest Neighbors Algorithms.md
beastartare May 4, 2025
5a599cb
Update 2. Practice.md
ITA-LOW May 4, 2025
c0b0725
Update 3.kInRegressionAndClassification.md
mevianna May 4, 2025
9088138
Update 3.kInRegressionAndClassification.md
mevianna May 4, 2025
b4762a2
finalizando
ITA-LOW May 4, 2025
47190d1
Update 2. Practice.md
ITA-LOW May 4, 2025
0a58243
Atualizando
SeidiDucher May 4, 2025
d7de219
Update 2. Practice.md
ITA-LOW May 4, 2025
0960081
Update 1. Math_concepts_introduction.md
ITA-LOW May 4, 2025
a87d79a
Update README.md
ITA-LOW May 4, 2025
298a717
Update 1. Math_concepts_introduction.md
ITA-LOW May 4, 2025
22f42e9
Update 1. Math_concepts_introduction.md
ITA-LOW May 4, 2025
634b4f2
Update 2. Practice.md
ITA-LOW May 4, 2025
b6ed300
Update 2. Practice.md
ITA-LOW May 4, 2025
523dd12
Update 3.kInRegressionAndClassification.md
mevianna May 4, 2025
8ec7757
atualizar
SeidiDucher May 4, 2025
14f4b17
atualizando
SeidiDucher May 4, 2025
b866f9c
atualizando
SeidiDucher May 4, 2025
64e7624
atualizar
SeidiDucher May 4, 2025
60dc745
Update 2. Practice.md
ITA-LOW May 4, 2025
76c33e4
enviando
SeidiDucher May 4, 2025
31f3e81
atualizando
SeidiDucher May 4, 2025
f0bb0f2
atualizar
SeidiDucher May 4, 2025
fdc17a0
atualizar
SeidiDucher May 5, 2025
5102173
enviando a parte de limites
SeidiDucher May 5, 2025
f08094c
atualizar
SeidiDucher May 5, 2025
ca8b428
Atualizando
SeidiDucher May 5, 2025
3559a8a
atualizando
SeidiDucher May 5, 2025
1378304
atualizando
SeidiDucher May 5, 2025
2d8de5b
atualizando
SeidiDucher May 5, 2025
e067043
example criated
carol-lanzu May 5, 2025
67636a9
Update english 3
mevianna May 5, 2025
31d2162
Update 3 english again
mevianna May 5, 2025
f48a36a
Update 3.kInRegressionAndClassification.md
mevianna May 5, 2025
046e9f0
add code jupyter notebook
matheus1103 May 5, 2025
1cfcca8
Update and rename codee.md to code.md and add text
matheus1103 May 5, 2025
8a18061
Add files via upload
matheus1103 May 5, 2025
098890c
Update code.md
vini-muchulski May 5, 2025
ea7f03a
Update code.md
vini-muchulski May 5, 2025
5704e3b
Add files via upload
vini-muchulski May 5, 2025
d4bd660
Update code.md
vini-muchulski May 5, 2025
35bdab8
Update code.md
vini-muchulski May 5, 2025
97192ca
Update 3.potentialIssues.md
matoncoffee May 5, 2025
49dd7b7
Update 4.fieldsOfUse.md
matoncoffee May 5, 2025
568fa6e
Merge pull request #3 from mevianna/matheus-vinicius-code
matheus1103 May 5, 2025
05ff8c7
atualizando
SeidiDucher May 6, 2025
ff7a154
update contributors, license and refs
rafasavaris May 6, 2025
1a5534e
update contributors, license and refs
rafasavaris May 6, 2025
ca04b9a
atualizar
SeidiDucher May 6, 2025
7e7454d
atualizar
SeidiDucher May 6, 2025
36e2e59
update contributors, license and refs
rafasavaris May 6, 2025
251db56
update contributors, license and refs
rafasavaris May 6, 2025
00c9f83
update contributors, license and refs
rafasavaris May 6, 2025
8b517ff
atualizar
SeidiDucher May 6, 2025
9e3c8d4
atua
SeidiDucher May 6, 2025
daa3a82
updated code
carol-lanzu May 6, 2025
3a135d1
update contributors, license and refs
rafasavaris May 6, 2025
9d3d180
Update and rename codee.md to Heart_disease_prediction.md
carol-lanzu May 6, 2025
8a58797
Update 2. Practice.md
ITA-LOW May 6, 2025
b278e97
Update Heart_disease_prediction.md
AliceMotin May 6, 2025
5e4ab53
Update 2. Practice.md
ITA-LOW May 6, 2025
563493f
Update Heart_disease_prediction.md
AliceMotin May 6, 2025
ec19620
Update Heart_disease_prediction.md
AliceMotin May 6, 2025
8a22390
Update Heart_disease_prediction.md
AliceMotin May 6, 2025
b374b16
Update Heart_disease_prediction.md
AliceMotin May 6, 2025
492e90d
Update Heart_disease_prediction.md
AliceMotin May 6, 2025
1e14280
Update Heart_disease_prediction.md
AliceMotin May 6, 2025
9a6f163
Update 2. Practice.md
ITA-LOW May 6, 2025
6cc13f3
Update 3.kInRegressionAndClassification.md
mevianna May 6, 2025
e173aed
Update 3.kInRegressionAndClassification.md
mevianna May 6, 2025
18edfcc
Rename 5.Computational_Considerations_of_KNN.md to 5.computational_co…
mevianna May 6, 2025
889f29e
Rename 3.kInRegressionAndClassification.md to 3.k_in_regression_and_c…
mevianna May 6, 2025
db20f4a
Update and rename 1.generalIdeas.md to 1.general_ideas.md
mevianna May 6, 2025
c3060a6
Update 2.distances.md
mevianna May 6, 2025
ffd196c
Update 2.distances.md
mevianna May 6, 2025
64295f2
Atualizando
SeidiDucher May 6, 2025
3bbaea4
Ducher Atualizando
SeidiDucher May 6, 2025
3e2ce85
atualizando
SeidiDucher May 6, 2025
130d25c
Update 2.distances.md
mevianna May 6, 2025
517bcf0
Update 1.general_ideas.md
mevianna May 6, 2025
390468d
Update 2.distances.md
mevianna May 6, 2025
84c4503
Update 3.k_in_regression_and_classification.md
mevianna May 6, 2025
252718f
Update 3.k_in_regression_and_classification.md
mevianna May 6, 2025
7feb2c4
Update 3.k_in_regression_and_classification.md
mevianna May 6, 2025
bb546aa
Update 6.Nearest Neighbors Algorithms.md
beastartare May 6, 2025
f753ade
Rename 1.history.md to 1.History.md
rafasavaris May 6, 2025
1afef89
Create arq_img
beastartare May 6, 2025
c151ce3
Add files via upload
beastartare May 6, 2025
4af15dc
Update 2.ClassifierVsRegression.md
rafasavaris May 6, 2025
0fad597
Update 1.History.md
beastartare May 6, 2025
da182c8
Update 4.Typical_problems.md
rafasavaris May 6, 2025
3a55952
Update 5.Fields_of_use.md
rafasavaris May 6, 2025
1242a52
Update 2.distances.md
mevianna May 6, 2025
ba3857a
Update 1.History.md
beastartare May 6, 2025
1f96437
Delete KNN/3.mathematics/Figures/manhattandistance.png
mevianna May 6, 2025
42fdd4e
Delete KNN/3.mathematics/Figures/distanciamanhattan.png
mevianna May 6, 2025
a3d5da9
Add files via upload
mevianna May 6, 2025
185ffe5
Update 2.distances.md
mevianna May 6, 2025
af0170b
Update 3.potentialIssues.md
mevianna May 6, 2025
52a330b
Update and rename 3.potentialIssues.md to 3.potential_issues.md
mevianna May 6, 2025
49f1c09
Rename 4.fieldsOfUse.md to 4.fields_of_use.md
mevianna May 6, 2025
38053a3
Update 2.typicalProblems.md
mevianna May 6, 2025
2d470d9
Update 1.history.md
mevianna May 6, 2025
c6bb795
Rename 2.typicalProblems.md to 2.typical_problems.md
mevianna May 6, 2025
395729b
Update 3.k_in_regression_and_classification.md
mevianna May 6, 2025
13ad715
nem images
rafasavaris May 6, 2025
6160121
update
rafasavaris May 6, 2025
85fac0b
Update 3.How_to_determine_the_value_of_K.md
rafasavaris May 6, 2025
bbcb012
Update 2.distances.md
mevianna May 6, 2025
9bcd134
Update 4.fields_of_use.md
mevianna May 6, 2025
a1c2ea7
Update 3.How_to_determine_the_value_of_K.md
rafasavaris May 6, 2025
fc234e6
Create teste.md
mevianna May 8, 2025
d5de51d
Update teste.md
mevianna May 8, 2025
b78da8d
Rename 1.History.md to 1.history.md
mevianna May 9, 2025
adbcd05
Rename 2.Typical_problems.md to 2.typical_problems.md
mevianna May 9, 2025
1573c75
Rename 3.Potential_issues.md to 3.potential_issues.md
mevianna May 9, 2025
7bab55d
Rename 4.Fields_of_use.md to 4.fields_of_use.md
mevianna May 9, 2025
9e65f02
Create teste2.html
mevianna May 9, 2025
e618741
Delete KNN/3.mathematics/teste2.html
mevianna May 9, 2025
23063ac
Create teste22.md
mevianna May 9, 2025
5f72c98
Update teste22.md
mevianna May 9, 2025
aa789d7
Update teste22.md
mevianna May 9, 2025
1273fa6
linear_regression_padronizacao
mevianna May 12, 2025
a003cae
Update 2.typical_problems.md
mevianna May 12, 2025
a91863c
Update 1.dive_into_the_docs.md
mevianna May 12, 2025
a9af13a
Update 2.boston_housing_price_reg.md
mevianna May 12, 2025
e112ff3
Update 1.general_representation_of_linear_regression.md
mevianna May 12, 2025
2ce01c0
Update 2.the_least_squares_method.md
mevianna May 12, 2025
d243850
Update 3.equation_based_on_dataset.md
mevianna May 12, 2025
18decb4
Update README.md
mevianna May 12, 2025
d1e198c
Update 4.fields_of_use.md
mevianna May 12, 2025
a9620f6
Update 1.history.md
mevianna May 12, 2025
89ae636
Update 2.typical_problems.md
mevianna May 12, 2025
256e8d8
Update 3.potential_issues.md
mevianna May 12, 2025
7eecdfe
Update 1.dive_into_the_docs.md
mevianna May 12, 2025
dd12fb0
Update 2.boston_housing_price_reg.md
mevianna May 12, 2025
7c305c8
Update 3.student_study_hours_prediction.md
mevianna May 12, 2025
402679c
Update 1.general_representation_of_linear_regression.md
mevianna May 12, 2025
ec406f1
Update 2.the_least_squares_method.md
mevianna May 12, 2025
89554bc
Update 3.equation_based_on_dataset.md
mevianna May 12, 2025
cd7ea4c
Create 1.concepts
SeidiDucher May 17, 2025
c435fd5
Create 2.code
SeidiDucher May 17, 2025
5095f98
apagar
SeidiDucher May 17, 2025
371e410
adicionando arquivo
SeidiDucher May 17, 2025
d2c4fcf
Create 2.code
SeidiDucher May 17, 2025
2ebdb23
apaga
SeidiDucher May 17, 2025
275f943
Add files via upload
vini-muchulski May 18, 2025
7ee0c79
Add files via upload
vini-muchulski May 25, 2025
1f674cf
corrigindo
SeidiDucher May 25, 2025
150b4a1
Ducher adicionando conteudo para conceito
SeidiDucher May 25, 2025
2ffdf96
Ducher Adicionando history
SeidiDucher May 26, 2025
1992434
atualizando
SeidiDucher May 26, 2025
da5fd5f
Atualizando Ducher
SeidiDucher May 26, 2025
11f2888
atualizar
SeidiDucher May 26, 2025
7513df2
atualizar
SeidiDucher May 26, 2025
f979dd6
atualizar
SeidiDucher May 26, 2025
84aab71
atualizar Ducher
SeidiDucher May 26, 2025
aff8a15
Ducher adicionando
SeidiDucher Jun 1, 2025
bce0a65
atualizando
SeidiDucher Jun 1, 2025
ca017f1
Ducher Atualizando
SeidiDucher Jun 8, 2025
94533b4
atualizar
SeidiDucher Jun 8, 2025
d58cb32
atualizar
SeidiDucher Jun 8, 2025
db0fce1
Ducher atualizando
SeidiDucher Jun 8, 2025
dc0cff8
atualiza
SeidiDucher Jun 8, 2025
c1e2be7
atual
SeidiDucher Jun 8, 2025
1830edc
Finalizando-Ducher
SeidiDucher Jun 12, 2025
6bd93fe
colocando referencias
SeidiDucher Jun 25, 2025
6bd23aa
finalizando
SeidiDucher Jun 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Algoritmos-geneticos/LICENCE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
MIT License

Copyright (c) 2025 Ítalo Firmino da Silva

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
43 changes: 43 additions & 0 deletions Algoritmos-geneticos/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Algoritmos Genéticos: Guia e Exemplo

> Bem-vindo(a) a este repositório! Aqui, você encontrará um **tutorial completo** sobre algoritmos genéticos e um **exemplo prático** que evolui uma população de strings para corresponder a uma frase alvo.

---

## 📘 Sobre este repositório

Este projeto está organizado em duas partes principais:

1. **Explicação Teórica**
- Arquivo: `code/Algoritmos_geneticos.md`
- Conteúdo: definição de algoritmos genéticos, componentes principais (cromossomo, população, fitness, operadores genéticos e critérios de parada), fluxo de execução e exemplos de aplicação.

2. **Exemplo Prático: Acertando uma String**
- Arquivo: `code/Acertando_uma_string.md`
- Objetivo: demonstrar, passo a passo, um algoritmo genético em Python que transforma uma população de strings até que ela corresponda exatamente a uma frase alvo.

---

Agora você tem todas as peças de que precisa para montar seu quebra-cabeça. Abaixo você pode conferir na estrutura desse repositório vários exemplos de aplicação de algoritmos genéticos.
## Estrutura do Repositório

```text
RepoAI/
└── Algoritmos-geneticos/
├── content/
│ └── Capa.png
├── code/
| └── Acertando_uma_string.md
| └── Algoritmos_geneticos.md
├── README
└── license
```

## Contribuidores

| [<img loading="lazy" src="https://avatars.githubusercontent.com/u/91793807?v=4" width=115><br><sub>Ítalo Silva</sub>](https://github.com/ITA-LOW) | [<img loading="lazy" src="https://avatars.githubusercontent.com/u/11313404?v=4" width=115><br><sub>Alison R. Panisson</sub>](https://github.com/AlisonPanisson) |
| :---: | :---: |

---


20 changes: 0 additions & 20 deletions Algoritmos-geneticos/code/Algoritmos_geneticos.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,23 +144,3 @@ O algoritmo para quando a população atinge um nível de convergência, ou seja
Se uma solução ótima ou satisfatória for encontrada (isto é, uma solução que atenda aos critérios de qualidade ou um valor de aptidão que ultrapasse um limiar pré-estabelecido), o algoritmo é interrompido. Esse critério busca garantir que o algoritmo não execute mais do que o necessário quando uma boa solução já foi alcançada.

---

Agora você tem todas as peças de que precisa para montar seu quebra-cabeça. Abaixo você pode conferir na estrutura desse repositório vários exemplos de aplicação de algoritmos genéticos.
## Estrutura do Repositório

```text
RepoAI/
└── Algoritmos-geneticos/
├── content/
│ └── Capa.png
├── code/
| └── Acertando_uma_string.md
| └── Algoritmos_geneticos.md <- Você está aqui!
├── README.md
└── license
```

## Contribuidores

| [<img loading="lazy" src="https://avatars.githubusercontent.com/u/91793807?v=4" width=115><br><sub>Ítalo Silva</sub>](https://github.com/ITA-LOW) | [<img loading="lazy" src="https://avatars.githubusercontent.com/u/11313404?v=4" width=115><br><sub>Alison R. Panisson</sub>](https://github.com/AlisonPanisson) |
| :---: | :---: |
57 changes: 57 additions & 0 deletions KNN/1.concepts/1.History.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# English version

## Introduction ##
K-Nearest Neighbor is a supervised machine learning model, meaning it learns from labeled data consisting of inputs (x) and their corresponding desired outputs (y). This model is employed for predicting both categorical and numerical data, utilizing an instance-based learning approach. This approach involves storing the training data, subsequently, when a new instance is presented, a set of related, similar instances is retrieved from memory and used to classify the novel query instance.

In the k-Nearest Neighbor (k-NN) model, each data instance is represented as a point in a feature space. New instances are classified based on their proximity to instances in the training set, using a similarity measure. In this way, the prediction is made by considering the k nearest neighbors.

![neighbor-nosey](img/neighbor-nosey.gif)

## History ##
The k-Nearest Neighbor (k-NN) algorithm originated in the 1950s, initially proposed by Evelyn Fix and Joseph Hodges in a theoretical work presented as *Technical Report No. 21* at the University of California, Berkeley, in 1951. Years later, during the 1960s, the algorithm was refined and formally developed by Thomas M. Cover and Peter E. Hart in their 1967 paper *"Nearest Neighbor Pattern Classification."*.

## References
FIX, Evelyn; HODGES Jr., Joseph L. Discriminatory Analysis. Nonparametric Discrimination: Consistency Properties. Berkeley: University of California, 1951. (Technical Report nº 21).

COVER, Thomas M.; HART, Peter E. Nearest Neighbor Pattern Classification. IEEE Transactions on Information Theory, 1967.

Halder, R.K., Uddin, M.N., Uddin, M.A. et al. Enhancing K-nearest neighbor algorithm: a comprehensive review and performance analysis of modifications. J Big Data 11, 113 (2024).

## 👾 **Contributors**
| [<img loading="lazy" src="https://avatars.githubusercontent.com/u/197432407?v=4" width=115><br><sub>Beatriz Schuelter Tartare</sub>](https://github.com/beastartare) |
| :---: |

## **License**
[![Licença MIT](https://img.shields.io/badge/Licença-MIT-blue.svg)](https://pt.wikipedia.org/wiki/Licen%C3%A7a_MIT)
**Traslation:** Use, modify, and share at will! ✌️

***

# Portuguese version

## Introdução ##

O K-Vizinhos Mais Próximos (k-Nearest Neighbor, ou k-NN) é um modelo de aprendizado de máquina supervisionado, o que significa que ele aprende a partir de dados rotulados, compostos por entradas (x) e suas respectivas saídas desejadas (y). Esse modelo é utilizado para prever tanto dados categóricos quanto numéricos, empregando uma abordagem de aprendizado baseado em instâncias. Essa abordagem envolve o armazenamento dos dados de treinamento, posteriormente, quando uma nova instância é apresentada, um conjunto de instâncias semelhantes é recuperado da memória e utilizado para classificar a nova instância de consulta.

No modelo k-Vizinhos Mais Próximos (k-NN), cada instância de dados é representada como um ponto em um espaço de características. Novas instâncias são classificadas com base em sua proximidade com instâncias do conjunto de treinamento, utilizando uma medida de similaridade. Dessa forma, a predição é feita considerando os k vizinhos mais próximos.

![neighbor-nosey](img/neighbor-nosey.gif)

## Histórico ##

O algoritmo k-Vizinhos Mais Próximos (k-NN) surgiu na década de 1950, proposto inicialmente por Evelyn Fix e Joseph Hodges em um trabalho teórico apresentado como *Technical Report No. 21* na Universidade da Califórnia, Berkeley, em 1951. Anos depois, durante a década de 1960, o algoritmo foi refinado e formalmente desenvolvido por Thomas M. Cover e Peter E. Hart em seu artigo de 1967, intitulado *"Nearest Neighbor Pattern Classification"*.

## Referências ##
FIX, Evelyn; HODGES Jr., Joseph L. Discriminatory Analysis. Nonparametric Discrimination: Consistency Properties. Berkeley: University of California, 1951. (Technical Report nº 21).

COVER, Thomas M.; HART, Peter E. Nearest Neighbor Pattern Classification. IEEE Transactions on Information Theory, 1967.

Halder, R.K., Uddin, M.N., Uddin, M.A. et al. Enhancing K-nearest neighbor algorithm: a comprehensive review and performance analysis of modifications. J Big Data 11, 113 (2024).

## 👾 **Contribuidores**
| [<img loading="lazy" src="https://avatars.githubusercontent.com/u/197432407?v=4" width=115><br><sub>Beatriz Schuelter Tartare</sub>](https://github.com/beastartare) |
| :---: |

## **Licença**
[![Licença MIT](https://img.shields.io/badge/Licença-MIT-blue.svg)](https://pt.wikipedia.org/wiki/Licen%C3%A7a_MIT)
**Traslation:** Use, modifique e compartilhe à vontade! ✌️
174 changes: 174 additions & 0 deletions KNN/1.concepts/2.ClassifierVsRegression.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
# English version

The k-Nearest Neighbors (kNN) machine learning model can be divided into two main categories: classification kNN and regression kNN.

## KNN Classifier

In classification kNN, the model assigns a categorical label to a new input based on the K nearest neighbors in the dataset. It checks the classes of these neighbors and selects the most frequent one through a majority vote mechanism.
## Example:

Based on the following dataset, let's analyze and understand how the kNN Classifier model works.

| Patient ID | Resting Heart Rate (bpm) | Cholesterol Level (mg/dL) | Diagnosis |
|------------|---------------------------|--------------------------|---------------|
| 001 | 82 | 220 | Heart Disease |
| 002 | 70 | 190 | No Disease |
| 003 | 90 | 210 | Heart Disease |
| 004 | 72 | 180 | No Disease |
| 005 | 85 | 220 | Heart Disease |

*Table 1 - Heart Diagnosis*

Let us consider a new patient whose clinical measurements include a resting heart rate of 78 bpm and a cholesterol level of 200 mg/dL. Our goal is to predict this patient's diagnosis by comparing these values to those in the existing training dataset.

Defining K=3, the three nearest neighbors are:

- Patient 001 → Heart Disease (distance: 20.4)
- Patient 002 → No Disease (distance: 12.8)
- Patient 003 → Heart Disease (distance: 15.6)

Next, we compute the votes and determine which label received the majority:

Votes:

- Heart Disease: 2 votes
- No Disease: 1 vote

Thus, the classification of the new data point is 'Heart Disease'

## KNN Regression

In regression kNN, the model predicts a continuous numerical value. To do this, the algorithm identifies the K nearest neighbors and computes the average of their values to produce the prediction.

## Example:

Based on the following dataset, let's analyze and understand how the kNN Regression model works.

| ID | Size (m²) | Rooms | Price ($) |
|----|-----------|--------|-------------|
| 01 | 110 | 3 | 550,000 |
| 02 | 80 | 2 | 400,000 |
| 03 | 140 | 4 | 650,000 |
| 04 | 70 | 2 | 300,000 |
| 05 | 90 | 3 | 450,000 |

*Table 2 - House Price Prediction*

Let's consider a new house with 100 m² and 3 bedrooms.

the three nearest neighbors are:

- House 01 -> 550 (distance: 10)
- House 02 -> 400 (distance: 20.02)
- House 05 -> 450 (distance: 10)

Thus, the predicted price will be the average of these three values.

$$
\{predicted price} = \$466.666,67
$$

> [!IMPORTANT]
> To better understand the mathematical foundation, visit: [3. Mathematics](https://github.com/mevianna/ISA/tree/main/KNN/3.mathematics)

## References
**IBM.** _K-nearest neighbors (KNN)_. Disponível em: https://www.ibm.com/think/topics/knn. Acesso em: 21 de abril de 2025.

## 👾 **Contributors**
| [<img loading="lazy" src="https://avatars.githubusercontent.com/u/197432407?v=4" width=115><br><sub>Beatriz Schuelter Tartare</sub>](https://github.com/beastartare) | [<img loading="lazy" src="https://avatars.githubusercontent.com/u/178849007?v=4" width=115><br><sub>Rafaela Savaris</sub>](https://github.com/rafasavaris) |
| :---: | :---: |

## **License**
[![Licença MIT](https://img.shields.io/badge/Licença-MIT-blue.svg)](https://pt.wikipedia.org/wiki/Licen%C3%A7a_MIT)
**Traslation:** Use, modify, and share at will! ✌️

***

# Portuguese version

O modelo de aprendizado de máquina k-Nearest Neighbors (kNN) pode ser dividido em duas categorias principais: kNN de classificação e kNN de regressão.

## KNN Classificador

No kNN de classificação, o modelo atribui um rótulo categórico a uma nova entrada com base nos K vizinhos mais próximos do conjunto de dados. Ele verifica as classes desses vizinhos e seleciona a mais frequente por meio de um mecanismo de "votação por pluralidade".

> [!NOTE]
> Na tradução para PT-BR, o termo "pluralidade" é utilizado, algumas vezes, em vez de "maioria" ou "majoritária", pois estes últimos implicam em mais de 50% de um total de votos - o que, nem sempre, é necessário.
> Por exemplo, imigine uma votação entre 3 candidatos, A, B, C, e D, com 10 votantes. O resultado é: 4 votos no candidato A; 2 votos no candidato B; 3 votos no Candidato C e 1 voto no candidato D. O candidato A irá ganhar, pois obteve a pluralidade dos votos, embora não seja mais de 50% do total de votos.

## Exemplo:

Com base no seguinte conjunto de dados, vamos analisar e entender como funciona o modelo kNN Classificador.

| ID do Paciente | Frequência Cardíaca de Repouso (bpm) | Nível de Colesterol (mg/dL) | Diagnóstico |
|----------------|---------------------------------------|------------------------------|------------------|
| 001 | 82 | 220 | Doença Cardíaca |
| 002 | 70 | 190 | Sem Doença |
| 003 | 90 | 210 | Doença Cardíaca |
| 004 | 72 | 180 | Sem Doença |
| 005 | 85 | 220 | Doença Cardíaca |

*Tabela 1 - Diagnóstico Cardíaco*

Vamos considerar um novo paciente cujas medições clínicas incluem uma frequência cardíaca de repouso de 78 bpm e um nível de colesterol de 200 mg/dL. Nosso objetivo é prever o diagnóstico desse paciente comparando esses valores com os do conjunto de dados de treinamento existente.

Definindo K = 3, os três vizinhos mais próximos são:

- Paciente 001 → Doença Cardíaca ( distancia: 20,4)
- Paciente 002 → Sem Doença (distancia: 12,8)
- Paciente 003 → Doença Cardíaca (distancia: 15,6)

Em seguida, computamos os votos e verificamos qual rótulo recebeu a maioria:

Votos:

- Doença Cardíaca: 2 votos
- Sem Doença: 1 voto

Dessa forma, a classificação do novo dado é 'Doença Cardíaca'.

## KNN Regressão

No kNN de regressão, o modelo prevê um valor numérico contínuo. Para isso, o algoritmo identifica os K vizinhos mais próximos e calcula a média de seus valores para gerar a previsão.

## Exemplo:

Com base no seguinte conjunto de dados, vamos analisar e entender como funciona o modelo kNN Regressor.

| ID | Tamanho (m²) | Quartos | Preço (R$) |
|-----|--------------|---------|-------------|
| 01 | 110 | 3 | 550.000 |
| 02 | 80 | 2 | 400.000 |
| 03 | 140 | 4 | 650.000 |
| 04 | 70 | 2 | 300.000 |
| 05 | 90 | 3 | 450.000 |

*Tabela 2 - Previsão de Preço de Casa*

Vamos considerar uma nova casa com 100 m² e 3 quartos.

Os três vizinhos mais próximos são:

- Casa 01 → 550.000 (distância: 10)
- Casa 02 → 400.000 (distância: 20,02)
- Casa 05 → 450.000 (distância: 10)

Desse modo, o preço previsto será a média desses três valores.

$$
\{preço previsto} = R$ 466.666,67
$$

> [!IMPORTANT]
> Para compreender melhor a fundamentação matemática, visite: [3. Mathematics](https://github.com/mevianna/ISA/tree/main/KNN/3.mathematics)

## Referências ##
**IBM.** _K-nearest neighbors (KNN)_. Disponível em: https://www.ibm.com/think/topics/knn. Acesso em: 21 de abril de 2025.

## 👾 **Contribuidores**
| [<img loading="lazy" src="https://avatars.githubusercontent.com/u/197432407?v=4" width=115><br><sub>Beatriz Schuelter Tartare</sub>](https://github.com/beastartare) | [<img loading="lazy" src="https://avatars.githubusercontent.com/u/178849007?v=4" width=115><br><sub>Rafaela Savaris</sub>](https://github.com/rafasavaris) |
| :---: | :---: |

## **Licença**
[![Licença MIT](https://img.shields.io/badge/Licença-MIT-blue.svg)](https://pt.wikipedia.org/wiki/Licen%C3%A7a_MIT)
**Traslation:** Use, modifique e compartilhe à vontade! ✌️
Loading