-
-Here γ is the so-called **discount factor** that determines to which extent you should prefer the current reward over the future reward and vice versa.
-
-## Learning Algorithm
-
-Given the equation above, we can now write pseudo-code for our learning algorithm:
-
-* Initialize Q-Table Q with equal numbers for all states and actions
-* Set learning rate α ← 1
-* Repeat simulation many times
- 1. Start at random position
- 1. Repeat
- 1. Select an action *a* at state *s*
- 2. Execute action by moving to a new state *s'*
- 3. If we encounter end-of-game condition, or total reward is too small - exit simulation
- 4. Compute reward *r* at the new state
- 5. Update Q-Function according to Bellman equation: *Q(s,a)* ← *(1-α)Q(s,a)+α(r+γ maxa'Q(s',a'))*
- 6. *s* ← *s'*
- 7. Update the total reward and decrease α.
-
-## Exploit vs. explore
-
-In the algorithm above, we did not specify how exactly we should choose an action at step 2.1. If we are choosing the action randomly, we will randomly **explore** the environment, and we are quite likely to die often as well as explore areas where we would not normally go. An alternative approach would be to **exploit** the Q-Table values that we already know, and thus to choose the best action (with higher Q-Table value) at state *s*. This, however, will prevent us from exploring other states, and it's likely we might not find the optimal solution.
-
-Thus, the best approach is to strike a balance between exploration and exploitation. This can be done by choosing the action at state *s* with probabilities proportional to values in the Q-Table. In the beginning, when Q-Table values are all the same, it would correspond to a random selection, but as we learn more about our environment, we would be more likely to follow the optimal route while allowing the agent to choose the unexplored path once in a while.
-
-## Python implementation
-
-We are now ready to implement the learning algorithm. Before we do that, we also need some function that will convert arbitrary numbers in the Q-Table into a vector of probabilities for corresponding actions.
-
-1. Create a function `probs()`:
-
- ```python
- def probs(v,eps=1e-4):
- v = v-v.min()+eps
- v = v/v.sum()
- return v
- ```
-
- Aggiungiamo alcuni `eps` al vettore originale per evitare la divisione per 0 nel caso iniziale, quando tutti i componenti del vettore sono identici.
-
-Esegui l'algoritmo di apprendimento attraverso 5000 esperimenti, chiamati anche **epoche**: (blocco di codice 8)
-```python
- for epoch in range(5000):
-
- # Pick initial point
- m.random_start()
-
- # Start travelling
- n=0
- cum_reward = 0
- while True:
- x,y = m.human
- v = probs(Q[x,y])
- a = random.choices(list(actions),weights=v)[0]
- dpos = actions[a]
- m.move(dpos,check_correctness=False) # we allow player to move outside the board, which terminates episode
- r = reward(m)
- cum_reward += r
- if r==end_reward or cum_reward < -1000:
- lpath.append(n)
- break
- alpha = np.exp(-n / 10e5)
- gamma = 0.5
- ai = action_idx[a]
- Q[x,y,ai] = (1 - alpha) * Q[x,y,ai] + alpha * (r + gamma * Q[x+dpos[0], y+dpos[1]].max())
- n+=1
-```
-
-Dopo aver eseguito questo algoritmo, la Q-Table dovrebbe essere aggiornata con valori che definiscono l'attrattività delle diverse azioni a ogni passo. Possiamo provare a visualizzare la Q-Table tracciando un vettore in ogni cella che indicherà la direzione desiderata del movimento. Per semplicità, disegniamo un piccolo cerchio invece della punta di una freccia.
-
-## Verifica della politica
-
-Poiché la Q-Table elenca l'"attrattività" di ciascuna azione in ogni stato, è abbastanza facile utilizzarla per definire la navigazione efficiente nel nostro mondo. Nel caso più semplice, possiamo selezionare l'azione corrispondente al valore Q-Table più alto: (blocco di codice 9)
-
-```python
-def qpolicy_strict(m):
- x,y = m.human
- v = probs(Q[x,y])
- a = list(actions)[np.argmax(v)]
- return a
-
-walk(m,qpolicy_strict)
-```
-
-> Se provi il codice sopra diverse volte, potresti notare che a volte si "blocca" e devi premere il pulsante STOP nel notebook per interromperlo. Questo accade perché potrebbero esserci situazioni in cui due stati "puntano" l'uno all'altro in termini di valore Q ottimale, nel qual caso l'agente finisce per muoversi tra quegli stati indefinitamente.
-
-## 🚀Sfida
-
-> **Compito 1:** Modifica il `walk` function to limit the maximum length of path by a certain number of steps (say, 100), and watch the code above return this value from time to time.
-
-> **Task 2:** Modify the `walk` function so that it does not go back to the places where it has already been previously. This will prevent `walk` from looping, however, the agent can still end up being "trapped" in a location from which it is unable to escape.
-
-## Navigation
-
-A better navigation policy would be the one that we used during training, which combines exploitation and exploration. In this policy, we will select each action with a certain probability, proportional to the values in the Q-Table. This strategy may still result in the agent returning back to a position it has already explored, but, as you can see from the code below, it results in a very short average path to the desired location (remember that `print_statistics` esegue la simulazione 100 volte): (blocco di codice 10)
-
-```python
-def qpolicy(m):
- x,y = m.human
- v = probs(Q[x,y])
- a = random.choices(list(actions),weights=v)[0]
- return a
-
-print_statistics(qpolicy)
-```
-
-Dopo aver eseguito questo codice, dovresti ottenere una lunghezza media del percorso molto più piccola rispetto a prima, nell'intervallo di 3-6.
-
-## Indagare il processo di apprendimento
-
-Come abbiamo menzionato, il processo di apprendimento è un equilibrio tra esplorazione e esplorazione della conoscenza acquisita sulla struttura dello spazio dei problemi. Abbiamo visto che i risultati dell'apprendimento (la capacità di aiutare un agente a trovare un percorso breve verso l'obiettivo) sono migliorati, ma è anche interessante osservare come si comporta la lunghezza media del percorso durante il processo di apprendimento:
-
-Le lezioni possono essere riassunte come:
-
-- **Aumento della lunghezza media del percorso**. Quello che vediamo qui è che all'inizio, la lunghezza media del percorso aumenta. Questo è probabilmente dovuto al fatto che quando non sappiamo nulla sull'ambiente, è probabile che ci imbattiamo in stati negativi, acqua o lupo. Man mano che impariamo di più e iniziamo a utilizzare questa conoscenza, possiamo esplorare l'ambiente per più tempo, ma non sappiamo ancora bene dove si trovano le mele.
-
-- **Diminuzione della lunghezza del percorso, man mano che impariamo di più**. Una volta che impariamo abbastanza, diventa più facile per l'agente raggiungere l'obiettivo, e la lunghezza del percorso inizia a diminuire. Tuttavia, siamo ancora aperti all'esplorazione, quindi spesso ci allontaniamo dal percorso migliore e esploriamo nuove opzioni, rendendo il percorso più lungo del necessario.
-
-- **Aumento improvviso della lunghezza**. Quello che osserviamo anche su questo grafico è che a un certo punto, la lunghezza è aumentata improvvisamente. Questo indica la natura stocastica del processo, e che a un certo punto possiamo "rovinare" i coefficienti della Q-Table sovrascrivendoli con nuovi valori. Questo dovrebbe idealmente essere minimizzato riducendo il tasso di apprendimento (ad esempio, verso la fine dell'addestramento, regoliamo i valori della Q-Table solo di un piccolo valore).
-
-In generale, è importante ricordare che il successo e la qualità del processo di apprendimento dipendono significativamente dai parametri, come il tasso di apprendimento, la decadenza del tasso di apprendimento e il fattore di sconto. Questi sono spesso chiamati **iperparametri**, per distinguerli dai **parametri**, che ottimizziamo durante l'addestramento (ad esempio, i coefficienti della Q-Table). Il processo di trovare i migliori valori degli iperparametri è chiamato **ottimizzazione degli iperparametri**, e merita un argomento a parte.
-
-## [Quiz post-lezione](https://gray-sand-07a10f403.1.azurestaticapps.net/quiz/46/)
-
-## Compito
-[Un Mondo Più Realistico](assignment.md)
-
-**Avvertenza**:
-Questo documento è stato tradotto utilizzando servizi di traduzione basati su intelligenza artificiale. Sebbene ci impegniamo per garantire l'accuratezza, si prega di essere consapevoli che le traduzioni automatiche possono contenere errori o imprecisioni. Il documento originale nella sua lingua nativa dovrebbe essere considerato la fonte autorevole. Per informazioni critiche, si raccomanda una traduzione professionale umana. Non siamo responsabili per eventuali malintesi o interpretazioni errate derivanti dall'uso di questa traduzione.
\ No newline at end of file
diff --git a/translations/it/8-Reinforcement/1-QLearning/assignment.md b/translations/it/8-Reinforcement/1-QLearning/assignment.md
deleted file mode 100644
index d91102cf7..000000000
--- a/translations/it/8-Reinforcement/1-QLearning/assignment.md
+++ /dev/null
@@ -1,30 +0,0 @@
-# Un Mondo Più Realistico
-
-Nella nostra situazione, Peter era in grado di muoversi quasi senza stancarsi o avere fame. In un mondo più realistico, deve sedersi e riposare di tanto in tanto, e anche nutrirsi. Rendiamo il nostro mondo più realistico, implementando le seguenti regole:
-
-1. Spostandosi da un luogo all'altro, Peter perde **energia** e guadagna un po' di **fatica**.
-2. Peter può guadagnare più energia mangiando mele.
-3. Peter può liberarsi della fatica riposando sotto l'albero o sull'erba (cioè camminando in una posizione della tavola con un albero o erba - campo verde)
-4. Peter deve trovare e uccidere il lupo.
-5. Per uccidere il lupo, Peter deve avere certi livelli di energia e fatica, altrimenti perde la battaglia.
-
-## Istruzioni
-
-Usa il [notebook.ipynb](../../../../8-Reinforcement/1-QLearning/notebook.ipynb) originale come punto di partenza per la tua soluzione.
-
-Modifica la funzione di ricompensa sopra secondo le regole del gioco, esegui l'algoritmo di apprendimento per rinforzo per imparare la migliore strategia per vincere il gioco, e confronta i risultati del cammino casuale con il tuo algoritmo in termini di numero di giochi vinti e persi.
-
-> **Note**: Nel tuo nuovo mondo, lo stato è più complesso, e oltre alla posizione umana include anche i livelli di fatica e energia. Puoi scegliere di rappresentare lo stato come una tupla (Board,energy,fatigue), o definire una classe per lo stato (puoi anche voler derivarla da `Board`), o anche modificare la classe originale `Board` all'interno di [rlboard.py](../../../../8-Reinforcement/1-QLearning/rlboard.py).
-
-Nella tua soluzione, per favore mantieni il codice responsabile della strategia del cammino casuale, e confronta i risultati del tuo algoritmo con il cammino casuale alla fine.
-
-> **Note**: Potrebbe essere necessario regolare gli iperparametri per farlo funzionare, specialmente il numero di epoche. Poiché il successo del gioco (combattere il lupo) è un evento raro, puoi aspettarti tempi di allenamento molto più lunghi.
-
-## Rubrica
-
-| Criteri | Esemplare | Adeguato | Bisogno di Miglioramento |
-| -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
-| | Un notebook è presentato con la definizione delle nuove regole del mondo, algoritmo Q-Learning e alcune spiegazioni testuali. Q-Learning è in grado di migliorare significativamente i risultati rispetto al cammino casuale. | Il notebook è presentato, Q-Learning è implementato e migliora i risultati rispetto al cammino casuale, ma non significativamente; o il notebook è scarsamente documentato e il codice non è ben strutturato | È stato fatto qualche tentativo di ridefinire le regole del mondo, ma l'algoritmo Q-Learning non funziona, o la funzione di ricompensa non è completamente definita |
-
-**Disclaimer**:
-Questo documento è stato tradotto utilizzando servizi di traduzione automatica basati su intelligenza artificiale. Sebbene ci impegniamo per garantire l'accuratezza, si prega di essere consapevoli che le traduzioni automatiche possono contenere errori o imprecisioni. Il documento originale nella sua lingua nativa dovrebbe essere considerato la fonte autorevole. Per informazioni critiche, si raccomanda una traduzione umana professionale. Non siamo responsabili per eventuali incomprensioni o interpretazioni errate derivanti dall'uso di questa traduzione.
\ No newline at end of file
diff --git a/translations/it/8-Reinforcement/1-QLearning/solution/Julia/README.md b/translations/it/8-Reinforcement/1-QLearning/solution/Julia/README.md
deleted file mode 100644
index 434620a63..000000000
--- a/translations/it/8-Reinforcement/1-QLearning/solution/Julia/README.md
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-**Disclaimer**:
-Questo documento è stato tradotto utilizzando servizi di traduzione basati su intelligenza artificiale. Sebbene ci impegniamo per l'accuratezza, si prega di notare che le traduzioni automatiche possono contenere errori o imprecisioni. Il documento originale nella sua lingua nativa dovrebbe essere considerato la fonte autorevole. Per informazioni critiche, si raccomanda una traduzione umana professionale. Non siamo responsabili per eventuali malintesi o interpretazioni errate derivanti dall'uso di questa traduzione.
\ No newline at end of file
diff --git a/translations/it/8-Reinforcement/1-QLearning/solution/R/README.md b/translations/it/8-Reinforcement/1-QLearning/solution/R/README.md
deleted file mode 100644
index dd36ee3d8..000000000
--- a/translations/it/8-Reinforcement/1-QLearning/solution/R/README.md
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-**Disclaimer**:
-Questo documento è stato tradotto utilizzando servizi di traduzione automatica basati su AI. Sebbene ci impegniamo per garantire l'accuratezza, si prega di essere consapevoli che le traduzioni automatiche possono contenere errori o imprecisioni. Il documento originale nella sua lingua nativa dovrebbe essere considerato la fonte autorevole. Per informazioni critiche, si raccomanda una traduzione professionale umana. Non siamo responsabili per eventuali incomprensioni o interpretazioni errate derivanti dall'uso di questa traduzione.
\ No newline at end of file
diff --git a/translations/it/8-Reinforcement/2-Gym/README.md b/translations/it/8-Reinforcement/2-Gym/README.md
deleted file mode 100644
index 49403b0c9..000000000
--- a/translations/it/8-Reinforcement/2-Gym/README.md
+++ /dev/null
@@ -1,342 +0,0 @@
-# CartPole Skating
-
-Il problema che abbiamo risolto nella lezione precedente potrebbe sembrare un problema giocattolo, non realmente applicabile a scenari di vita reale. Non è così, perché molti problemi del mondo reale condividono questo scenario - incluso giocare a scacchi o Go. Sono simili, perché abbiamo anche una scacchiera con regole date e uno **stato discreto**.
-
-## [Quiz Pre-lezione](https://gray-sand-07a10f403.1.azurestaticapps.net/quiz/47/)
-
-## Introduzione
-
-In questa lezione applicheremo gli stessi principi del Q-Learning a un problema con **stato continuo**, cioè uno stato che è dato da uno o più numeri reali. Ci occuperemo del seguente problema:
-
-> **Problema**: Se Peter vuole scappare dal lupo, deve essere in grado di muoversi più velocemente. Vedremo come Peter può imparare a pattinare, in particolare, a mantenere l'equilibrio, usando il Q-Learning.
-
-
-
-> Peter e i suoi amici diventano creativi per scappare dal lupo! Immagine di [Jen Looper](https://twitter.com/jenlooper)
-
-Utilizzeremo una versione semplificata del mantenimento dell'equilibrio nota come problema **CartPole**. Nel mondo del cartpole, abbiamo uno slider orizzontale che può muoversi a sinistra o a destra, e l'obiettivo è mantenere in equilibrio un palo verticale sulla parte superiore dello slider.
-
-## Prerequisiti
-
-In questa lezione, utilizzeremo una libreria chiamata **OpenAI Gym** per simulare diversi **ambienti**. Puoi eseguire il codice di questa lezione localmente (ad esempio da Visual Studio Code), nel qual caso la simulazione si aprirà in una nuova finestra. Quando esegui il codice online, potresti dover apportare alcune modifiche al codice, come descritto [qui](https://towardsdatascience.com/rendering-openai-gym-envs-on-binder-and-google-colab-536f99391cc7).
-
-## OpenAI Gym
-
-Nella lezione precedente, le regole del gioco e lo stato erano dati dalla classe `Board` che abbiamo definito noi stessi. Qui utilizzeremo un **ambiente di simulazione** speciale, che simulerà la fisica dietro il palo in equilibrio. Uno degli ambienti di simulazione più popolari per l'addestramento degli algoritmi di apprendimento per rinforzo è chiamato [Gym](https://gym.openai.com/), che è mantenuto da [OpenAI](https://openai.com/). Utilizzando questo gym possiamo creare diversi **ambienti** da una simulazione di cartpole a giochi Atari.
-
-> **Nota**: Puoi vedere altri ambienti disponibili da OpenAI Gym [qui](https://gym.openai.com/envs/#classic_control).
-
-Prima, installiamo il gym e importiamo le librerie necessarie (blocco di codice 1):
-
-```python
-import sys
-!{sys.executable} -m pip install gym
-
-import gym
-import matplotlib.pyplot as plt
-import numpy as np
-import random
-```
-
-## Esercizio - inizializzare un ambiente cartpole
-
-Per lavorare con un problema di equilibrio del cartpole, dobbiamo inizializzare l'ambiente corrispondente. Ogni ambiente è associato a:
-
-- **Observation space** che definisce la struttura delle informazioni che riceviamo dall'ambiente. Per il problema del cartpole, riceviamo la posizione del palo, la velocità e altri valori.
-
-- **Action space** che definisce le azioni possibili. Nel nostro caso lo spazio delle azioni è discreto e consiste in due azioni - **sinistra** e **destra**. (blocco di codice 2)
-
-1. Per inizializzare, digita il seguente codice:
-
- ```python
- env = gym.make("CartPole-v1")
- print(env.action_space)
- print(env.observation_space)
- print(env.action_space.sample())
- ```
-
-Per vedere come funziona l'ambiente, eseguiamo una breve simulazione per 100 passi. Ad ogni passo, forniamo una delle azioni da intraprendere - in questa simulazione selezioniamo casualmente un'azione da `action_space`.
-
-1. Esegui il codice qui sotto e vedi a cosa porta.
-
- ✅ Ricorda che è preferibile eseguire questo codice su un'installazione locale di Python! (blocco di codice 3)
-
- ```python
- env.reset()
-
- for i in range(100):
- env.render()
- env.step(env.action_space.sample())
- env.close()
- ```
-
- Dovresti vedere qualcosa di simile a questa immagine:
-
- 
-
-1. Durante la simulazione, dobbiamo ottenere osservazioni per decidere come agire. Infatti, la funzione step restituisce le osservazioni attuali, una funzione di ricompensa e il flag done che indica se ha senso continuare la simulazione o meno: (blocco di codice 4)
-
- ```python
- env.reset()
-
- done = False
- while not done:
- env.render()
- obs, rew, done, info = env.step(env.action_space.sample())
- print(f"{obs} -> {rew}")
- env.close()
- ```
-
- Finirai per vedere qualcosa di simile a questo nell'output del notebook:
-
- ```text
- [ 0.03403272 -0.24301182 0.02669811 0.2895829 ] -> 1.0
- [ 0.02917248 -0.04828055 0.03248977 0.00543839] -> 1.0
- [ 0.02820687 0.14636075 0.03259854 -0.27681916] -> 1.0
- [ 0.03113408 0.34100283 0.02706215 -0.55904489] -> 1.0
- [ 0.03795414 0.53573468 0.01588125 -0.84308041] -> 1.0
- ...
- [ 0.17299878 0.15868546 -0.20754175 -0.55975453] -> 1.0
- [ 0.17617249 0.35602306 -0.21873684 -0.90998894] -> 1.0
- ```
-
- Il vettore di osservazione che viene restituito ad ogni passo della simulazione contiene i seguenti valori:
- - Posizione del carrello
- - Velocità del carrello
- - Angolo del palo
- - Velocità di rotazione del palo
-
-1. Ottieni il valore minimo e massimo di questi numeri: (blocco di codice 5)
-
- ```python
- print(env.observation_space.low)
- print(env.observation_space.high)
- ```
-
- Potresti anche notare che il valore della ricompensa ad ogni passo della simulazione è sempre 1. Questo perché il nostro obiettivo è sopravvivere il più a lungo possibile, cioè mantenere il palo in una posizione ragionevolmente verticale per il periodo di tempo più lungo possibile.
-
- ✅ In effetti, la simulazione del CartPole è considerata risolta se riusciamo a ottenere una ricompensa media di 195 su 100 prove consecutive.
-
-## Discretizzazione dello stato
-
-Nel Q-Learning, dobbiamo costruire una Q-Table che definisca cosa fare in ogni stato. Per poter fare questo, lo stato deve essere **discreto**, più precisamente, deve contenere un numero finito di valori discreti. Pertanto, dobbiamo in qualche modo **discretizzare** le nostre osservazioni, mappandole su un insieme finito di stati.
-
-Ci sono alcuni modi in cui possiamo farlo:
-
-- **Dividere in bin**. Se conosciamo l'intervallo di un certo valore, possiamo dividere questo intervallo in un numero di **bin**, e poi sostituire il valore con il numero del bin a cui appartiene. Questo può essere fatto usando il metodo numpy [`digitize`](https://numpy.org/doc/stable/reference/generated/numpy.digitize.html). In questo caso, conosceremo esattamente la dimensione dello stato, perché dipenderà dal numero di bin che selezioniamo per la digitalizzazione.
-
-✅ Possiamo usare l'interpolazione lineare per portare i valori a un intervallo finito (diciamo, da -20 a 20), e poi convertire i numeri in interi arrotondandoli. Questo ci dà un po' meno controllo sulla dimensione dello stato, soprattutto se non conosciamo gli intervalli esatti dei valori di input. Ad esempio, nel nostro caso 2 dei 4 valori non hanno limiti superiori/inferiori sui loro valori, il che può comportare un numero infinito di stati.
-
-Nel nostro esempio, utilizzeremo il secondo approccio. Come potresti notare più avanti, nonostante i limiti superiori/inferiori indefiniti, quei valori raramente assumono valori al di fuori di certi intervalli finiti, quindi quegli stati con valori estremi saranno molto rari.
-
-1. Ecco la funzione che prenderà l'osservazione dal nostro modello e produrrà una tupla di 4 valori interi: (blocco di codice 6)
-
- ```python
- def discretize(x):
- return tuple((x/np.array([0.25, 0.25, 0.01, 0.1])).astype(np.int))
- ```
-
-1. Esploriamo anche un altro metodo di discretizzazione usando i bin: (blocco di codice 7)
-
- ```python
- def create_bins(i,num):
- return np.arange(num+1)*(i[1]-i[0])/num+i[0]
-
- print("Sample bins for interval (-5,5) with 10 bins\n",create_bins((-5,5),10))
-
- ints = [(-5,5),(-2,2),(-0.5,0.5),(-2,2)] # intervals of values for each parameter
- nbins = [20,20,10,10] # number of bins for each parameter
- bins = [create_bins(ints[i],nbins[i]) for i in range(4)]
-
- def discretize_bins(x):
- return tuple(np.digitize(x[i],bins[i]) for i in range(4))
- ```
-
-1. Ora eseguiamo una breve simulazione e osserviamo quei valori discreti dell'ambiente. Sentiti libero di provare sia `discretize` and `discretize_bins` e vedere se c'è una differenza.
-
- ✅ discretize_bins restituisce il numero del bin, che è basato su 0. Quindi per i valori della variabile di input intorno a 0 restituisce il numero dal centro dell'intervallo (10). In discretize, non ci siamo preoccupati dell'intervallo dei valori di output, permettendo loro di essere negativi, quindi i valori dello stato non sono spostati, e 0 corrisponde a 0. (blocco di codice 8)
-
- ```python
- env.reset()
-
- done = False
- while not done:
- #env.render()
- obs, rew, done, info = env.step(env.action_space.sample())
- #print(discretize_bins(obs))
- print(discretize(obs))
- env.close()
- ```
-
- ✅ Decommenta la riga che inizia con env.render se vuoi vedere come l'ambiente viene eseguito. Altrimenti puoi eseguirlo in background, che è più veloce. Utilizzeremo questa esecuzione "invisibile" durante il nostro processo di Q-Learning.
-
-## La struttura della Q-Table
-
-Nella nostra lezione precedente, lo stato era una semplice coppia di numeri da 0 a 8, quindi era conveniente rappresentare la Q-Table con un tensore numpy con una forma di 8x8x2. Se usiamo la discretizzazione dei bin, la dimensione del nostro vettore di stato è anche conosciuta, quindi possiamo usare lo stesso approccio e rappresentare lo stato con un array di forma 20x20x10x10x2 (qui 2 è la dimensione dello spazio delle azioni, e le prime dimensioni corrispondono al numero di bin che abbiamo selezionato per ciascuno dei parametri nello spazio delle osservazioni).
-
-Tuttavia, a volte le dimensioni precise dello spazio delle osservazioni non sono conosciute. Nel caso della funzione `discretize`, potremmo non essere mai sicuri che il nostro stato rimanga entro certi limiti, perché alcuni dei valori originali non sono limitati. Pertanto, utilizzeremo un approccio leggermente diverso e rappresenteremo la Q-Table con un dizionario.
-
-1. Usa la coppia *(stato, azione)* come chiave del dizionario, e il valore corrisponderebbe al valore dell'entry della Q-Table. (blocco di codice 9)
-
- ```python
- Q = {}
- actions = (0,1)
-
- def qvalues(state):
- return [Q.get((state,a),0) for a in actions]
- ```
-
- Qui definiamo anche una funzione `qvalues()`, che restituisce una lista di valori della Q-Table per un dato stato che corrisponde a tutte le azioni possibili. Se l'entry non è presente nella Q-Table, restituiremo 0 come valore predefinito.
-
-## Iniziamo il Q-Learning
-
-Ora siamo pronti a insegnare a Peter a mantenere l'equilibrio!
-
-1. Prima, impostiamo alcuni iperparametri: (blocco di codice 10)
-
- ```python
- # hyperparameters
- alpha = 0.3
- gamma = 0.9
- epsilon = 0.90
- ```
-
- Qui, `alpha` is the **learning rate** that defines to which extent we should adjust the current values of Q-Table at each step. In the previous lesson we started with 1, and then decreased `alpha` to lower values during training. In this example we will keep it constant just for simplicity, and you can experiment with adjusting `alpha` values later.
-
- `gamma` is the **discount factor** that shows to which extent we should prioritize future reward over current reward.
-
- `epsilon` is the **exploration/exploitation factor** that determines whether we should prefer exploration to exploitation or vice versa. In our algorithm, we will in `epsilon` percent of the cases select the next action according to Q-Table values, and in the remaining number of cases we will execute a random action. This will allow us to explore areas of the search space that we have never seen before.
-
- ✅ In terms of balancing - choosing random action (exploration) would act as a random punch in the wrong direction, and the pole would have to learn how to recover the balance from those "mistakes"
-
-### Improve the algorithm
-
-We can also make two improvements to our algorithm from the previous lesson:
-
-- **Calculate average cumulative reward**, over a number of simulations. We will print the progress each 5000 iterations, and we will average out our cumulative reward over that period of time. It means that if we get more than 195 point - we can consider the problem solved, with even higher quality than required.
-
-- **Calculate maximum average cumulative result**, `Qmax`, and we will store the Q-Table corresponding to that result. When you run the training you will notice that sometimes the average cumulative result starts to drop, and we want to keep the values of Q-Table that correspond to the best model observed during training.
-
-1. Collect all cumulative rewards at each simulation at `rewards` per ulteriori grafici. (blocco di codice 11)
-
- ```python
- def probs(v,eps=1e-4):
- v = v-v.min()+eps
- v = v/v.sum()
- return v
-
- Qmax = 0
- cum_rewards = []
- rewards = []
- for epoch in range(100000):
- obs = env.reset()
- done = False
- cum_reward=0
- # == do the simulation ==
- while not done:
- s = discretize(obs)
- if random.random()
-
-これは、ある種の相関があることを示唆しており、`Month` and `Price`, or between `DayOfYear` and `Price`. Here is the scatter plot that shows the latter relationship:
-
-
-
-Let's see if there is a correlation using the `corr` 関数を使用して相関を計算してみることができます:
-
-```python
-print(new_pumpkins['Month'].corr(new_pumpkins['Price']))
-print(new_pumpkins['DayOfYear'].corr(new_pumpkins['Price']))
-```
-
-相関はかなり小さいようです、`Month` and -0.17 by the `DayOfMonth`, but there could be another important relationship. It looks like there are different clusters of prices corresponding to different pumpkin varieties. To confirm this hypothesis, let's plot each pumpkin category using a different color. By passing an `ax` parameter to the `scatter` プロット関数を使用してすべてのポイントを同じグラフにプロットできます:
-
-```python
-ax=None
-colors = ['red','blue','green','yellow']
-for i,var in enumerate(new_pumpkins['Variety'].unique()):
- df = new_pumpkins[new_pumpkins['Variety']==var]
- ax = df.plot.scatter('DayOfYear','Price',ax=ax,c=colors[i],label=var)
-```
-
-
-
-私たちの調査は、実際の販売日よりも品種が全体の価格に影響を与えることを示唆しています。これを棒グラフで確認できます:
-
-```python
-new_pumpkins.groupby('Variety')['Price'].mean().plot(kind='bar')
-```
-
-
-
-今のところ、'パイタイプ'のかぼちゃ品種にのみ焦点を当て、日付が価格に与える影響を見てみましょう:
-
-```python
-pie_pumpkins = new_pumpkins[new_pumpkins['Variety']=='PIE TYPE']
-pie_pumpkins.plot.scatter('DayOfYear','Price')
-```
-
-
-`Price` and `DayOfYear` using `corr` function, we will get something like `-0.27` の相関を計算すると、予測モデルのトレーニングが意味を持つことがわかります。
-
-> 線形回帰モデルをトレーニングする前に、データがクリーンであることを確認することが重要です。線形回帰は欠損値に対してうまく機能しないため、すべての空のセルを取り除くことが理にかなっています:
-
-```python
-pie_pumpkins.dropna(inplace=True)
-pie_pumpkins.info()
-```
-
-もう一つのアプローチは、それらの空の値を対応する列の平均値で埋めることです。
-
-## 単純な線形回帰
-
-[](https://youtu.be/e4c_UP2fSjg "初心者向けML - Scikit-learnを使用した線形および多項式回帰")
-
-> 🎥 上の画像をクリックすると、線形回帰と多項式回帰の概要を短いビデオで確認できます。
-
-線形回帰モデルをトレーニングするために、**Scikit-learn**ライブラリを使用します。
-
-```python
-from sklearn.linear_model import LinearRegression
-from sklearn.metrics import mean_squared_error
-from sklearn.model_selection import train_test_split
-```
-
-まず、入力値(特徴)と予想出力(ラベル)を別々のnumpy配列に分けます:
-
-```python
-X = pie_pumpkins['DayOfYear'].to_numpy().reshape(-1,1)
-y = pie_pumpkins['Price']
-```
-
-> 入力データに`reshape`を実行する必要があることに注意してください。線形回帰は2D配列を入力として期待し、配列の各行が入力特徴のベクトルに対応します。私たちの場合、入力が1つしかないため、形状がN×1の配列が必要です。Nはデータセットのサイズです。
-
-次に、データをトレーニングデータセットとテストデータセットに分割し、トレーニング後にモデルを検証できるようにします:
-
-```python
-X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=0)
-```
-
-最後に、実際の線形回帰モデルのトレーニングは2行のコードで行います。`LinearRegression` object, and fit it to our data using the `fit` メソッドを定義します:
-
-```python
-lin_reg = LinearRegression()
-lin_reg.fit(X_train,y_train)
-```
-
-`LinearRegression` object after `fit`-ting contains all the coefficients of the regression, which can be accessed using `.coef_` property. In our case, there is just one coefficient, which should be around `-0.017`. It means that prices seem to drop a bit with time, but not too much, around 2 cents per day. We can also access the intersection point of the regression with Y-axis using `lin_reg.intercept_` - it will be around `21` が示しているように、年の初めの価格を示しています。
-
-モデルの精度を確認するために、テストデータセットで価格を予測し、予測値と期待値の違いを測定します。これは、期待値と予測値のすべての二乗誤差の平均である平均二乗誤差(MSE)を使用して行うことができます。
-
-```python
-pred = lin_reg.predict(X_test)
-
-mse = np.sqrt(mean_squared_error(y_test,pred))
-print(f'Mean error: {mse:3.3} ({mse/np.mean(pred)*100:3.3}%)')
-```
-
-誤差は約2ポイントで、約17%です。あまり良くありません。モデルの品質のもう一つの指標は**決定係数**であり、次のように取得できます:
-
-```python
-score = lin_reg.score(X_train,y_train)
-print('Model determination: ', score)
-```
-値が0の場合、モデルは入力データを考慮せず、*最悪の線形予測器*として機能し、単に結果の平均値を示します。値が1の場合、すべての期待出力を完全に予測できることを意味します。私たちの場合、決定係数は約0.06で、かなり低いです。
-
-テストデータと回帰ラインを一緒にプロットして、回帰がどのように機能するかをよりよく見ることができます:
-
-```python
-plt.scatter(X_test,y_test)
-plt.plot(X_test,pred)
-```
-
-
-
-## 多項式回帰
-
-もう一つの線形回帰のタイプは多項式回帰です。変数間に線形関係がある場合がありますが、例えば、かぼちゃの体積が大きいほど価格が高くなる場合がありますが、これらの関係は平面や直線としてプロットできないことがあります。
-
-✅ ここに[いくつかの例](https://online.stat.psu.edu/stat501/lesson/9/9.8)があります。多項式回帰を使用できるデータの例です。
-
-日付と価格の関係をもう一度見てみましょう。この散布図は直線で分析すべきだと思いますか?価格は変動する可能性がありますか?この場合、多項式回帰を試すことができます。
-
-✅ 多項式は、1つ以上の変数と係数で構成される数学的表現です。
-
-多項式回帰は、非線形データにより適合する曲線を作成します。私たちの場合、入力データに`DayOfYear`の二乗変数を含めると、年のある時点で最小値を持つ放物線をフィットさせることができます。
-
-Scikit-learnには、データ処理の異なるステップを組み合わせるための便利な[パイプラインAPI](https://scikit-learn.org/stable/modules/generated/sklearn.pipeline.make_pipeline.html?highlight=pipeline#sklearn.pipeline.make_pipeline)が含まれています。**パイプライン**は、**推定器**のチェーンです。私たちの場合、まずモデルに多項式特徴を追加し、その後回帰をトレーニングするパイプラインを作成します:
-
-```python
-from sklearn.preprocessing import PolynomialFeatures
-from sklearn.pipeline import make_pipeline
-
-pipeline = make_pipeline(PolynomialFeatures(2), LinearRegression())
-
-pipeline.fit(X_train,y_train)
-```
-
-`PolynomialFeatures(2)` means that we will include all second-degree polynomials from the input data. In our case it will just mean `DayOfYear`2, but given two input variables X and Y, this will add X2, XY and Y2. We may also use higher degree polynomials if we want.
-
-Pipelines can be used in the same manner as the original `LinearRegression` object, i.e. we can `fit` the pipeline, and then use `predict` to get the prediction results. Here is the graph showing test data, and the approximation curve:
-
-
-
-Using Polynomial Regression, we can get slightly lower MSE and higher determination, but not significantly. We need to take into account other features!
-
-> You can see that the minimal pumpkin prices are observed somewhere around Halloween. How can you explain this?
-
-🎃 Congratulations, you just created a model that can help predict the price of pie pumpkins. You can probably repeat the same procedure for all pumpkin types, but that would be tedious. Let's learn now how to take pumpkin variety into account in our model!
-
-## Categorical Features
-
-In the ideal world, we want to be able to predict prices for different pumpkin varieties using the same model. However, the `Variety` column is somewhat different from columns like `Month`, because it contains non-numeric values. Such columns are called **categorical**.
-
-[](https://youtu.be/DYGliioIAE0 "ML for beginners - Categorical Feature Predictions with Linear Regression")
-
-> 🎥 Click the image above for a short video overview of using categorical features.
-
-Here you can see how average price depends on variety:
-
-
-
-To take variety into account, we first need to convert it to numeric form, or **encode** it. There are several way we can do it:
-
-* Simple **numeric encoding** will build a table of different varieties, and then replace the variety name by an index in that table. This is not the best idea for linear regression, because linear regression takes the actual numeric value of the index, and adds it to the result, multiplying by some coefficient. In our case, the relationship between the index number and the price is clearly non-linear, even if we make sure that indices are ordered in some specific way.
-* **One-hot encoding** will replace the `Variety` column by 4 different columns, one for each variety. Each column will contain `1` if the corresponding row is of a given variety, and `0` ということになります。つまり、線形回帰には4つの係数があり、各かぼちゃ品種ごとに1つの係数があり、その品種の「開始価格」(または「追加価格」)を表します。
-
-以下のコードは、品種をワンホットエンコードする方法を示しています:
-
-```python
-pd.get_dummies(new_pumpkins['Variety'])
-```
-
- ID | FAIRYTALE | MINIATURE | MIXED HEIRLOOM VARIETIES | PIE TYPE
-----|-----------|-----------|--------------------------|----------
-70 | 0 | 0 | 0 | 1
-71 | 0 | 0 | 0 | 1
-... | ... | ... | ... | ...
-1738 | 0 | 1 | 0 | 0
-1739 | 0 | 1 | 0 | 0
-1740 | 0 | 1 | 0 | 0
-1741 | 0 | 1 | 0 | 0
-1742 | 0 | 1 | 0 | 0
-
-ワンホットエンコードされた品種を使用して線形回帰をトレーニングするには、`X` and `y`データを正しく初期化するだけです:
-
-```python
-X = pd.get_dummies(new_pumpkins['Variety'])
-y = new_pumpkins['Price']
-```
-
-他のコードは、上記で使用した線形回帰をトレーニングするためのコードと同じです。試してみると、平均二乗誤差はほぼ同じですが、決定係数が大幅に高くなります(約77%)。さらに正確な予測を行うために、より多くのカテゴリカル特徴や数値的特徴(例えば`Month` or `DayOfYear`. To get one large array of features, we can use `join`)を考慮することができます:
-
-```python
-X = pd.get_dummies(new_pumpkins['Variety']) \
- .join(new_pumpkins['Month']) \
- .join(pd.get_dummies(new_pumpkins['City'])) \
- .join(pd.get_dummies(new_pumpkins['Package']))
-y = new_pumpkins['Price']
-```
-
-ここでは、`City` and `Package`タイプも考慮しており、MSEは2.84(10%)、決定係数は0.94です!
-
-## すべてをまとめる
-
-最良のモデルを作成するために、上記の例からの結合データ(ワンホットエンコードされたカテゴリカルデータ+数値データ)と多項式回帰を使用します。ここに完全なコードがあります:
-
-```python
-# set up training data
-X = pd.get_dummies(new_pumpkins['Variety']) \
- .join(new_pumpkins['Month']) \
- .join(pd.get_dummies(new_pumpkins['City'])) \
- .join(pd.get_dummies(new_pumpkins['Package']))
-y = new_pumpkins['Price']
-
-# make train-test split
-X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=0)
-
-# setup and train the pipeline
-pipeline = make_pipeline(PolynomialFeatures(2), LinearRegression())
-pipeline.fit(X_train,y_train)
-
-# predict results for test data
-pred = pipeline.predict(X_test)
-
-# calculate MSE and determination
-mse = np.sqrt(mean_squared_error(y_test,pred))
-print(f'Mean error: {mse:3.3} ({mse/np.mean(pred)*100:3.3}%)')
-
-score = pipeline.score(X_train,y_train)
-print('Model determination: ', score)
-```
-
-これにより、決定係数がほぼ97%、MSE=2.23(約8%の予測誤差)となります。
-
-| モデル | MSE | 決定係数 |
-|-------|-----|---------------|
-| `DayOfYear` Linear | 2.77 (17.2%) | 0.07 |
-| `DayOfYear` Polynomial | 2.73 (17.0%) | 0.08 |
-| `Variety` 線形 | 5.24 (19.7%) | 0.77 |
-| すべての特徴 線形 | 2.84 (10.5%) | 0.94 |
-| すべての特徴 多項式 | 2.23 (8.25%) | 0.97 |
-
-🏆 よくできました!1つのレッスンで4つの回帰モデルを作成し、モデルの品質を97%に向上させました。回帰の最終セクションでは、ロジスティック回帰について学び、カテゴリを
-
-**免責事項**:
-この文書は機械翻訳サービスを使用して翻訳されています。正確さを期すよう努めていますが、自動翻訳には誤りや不正確さが含まれる場合があります。原文の言語による文書が権威ある情報源と見なされるべきです。重要な情報については、専門の人間による翻訳をお勧めします。この翻訳の使用に起因する誤解や誤認について、当社は一切の責任を負いません。
\ No newline at end of file
diff --git a/translations/ja/2-Regression/3-Linear/assignment.md b/translations/ja/2-Regression/3-Linear/assignment.md
deleted file mode 100644
index fff2e1173..000000000
--- a/translations/ja/2-Regression/3-Linear/assignment.md
+++ /dev/null
@@ -1,14 +0,0 @@
-# 回帰モデルの作成
-
-## 手順
-
-このレッスンでは、線形回帰と多項式回帰の両方を使用してモデルを構築する方法が示されました。この知識を活用して、データセットを見つけるか、Scikit-learn の組み込みセットのいずれかを使用して新しいモデルを構築してください。ノートブックで、なぜその手法を選んだのかを説明し、モデルの精度を実証してください。もし精度が低い場合は、その理由を説明してください。
-
-## ルーブリック
-
-| 基準 | 模範的な | 適切な | 改善が必要な |
-| --------- | ------------------------------------------------------------ | -------------------------- | ------------------------------ |
-| | 完全にドキュメント化された解決策を含む完全なノートブックを提示する | 解決策が不完全である | 解決策に欠陥やバグがある |
-
-**免責事項**:
-この文書は、機械翻訳サービスを使用して翻訳されています。正確さを期していますが、自動翻訳には誤りや不正確さが含まれる可能性があります。元の言語で書かれた原文を公式な情報源と見なしてください。重要な情報については、専門の人間による翻訳をお勧めします。この翻訳の使用に起因する誤解や誤解については、一切の責任を負いかねます。
\ No newline at end of file
diff --git a/translations/ja/2-Regression/3-Linear/solution/Julia/README.md b/translations/ja/2-Regression/3-Linear/solution/Julia/README.md
deleted file mode 100644
index 08c7f1db5..000000000
--- a/translations/ja/2-Regression/3-Linear/solution/Julia/README.md
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-**免責事項**:
-この文書は機械翻訳サービスを使用して翻訳されています。正確さを期していますが、自動翻訳には誤りや不正確さが含まれる可能性があることをご了承ください。原文が権威ある情報源と見なされるべきです。重要な情報については、専門の人間による翻訳をお勧めします。この翻訳の使用により生じた誤解や誤った解釈について、当方は責任を負いません。
\ No newline at end of file
diff --git a/translations/ja/2-Regression/4-Logistic/README.md b/translations/ja/2-Regression/4-Logistic/README.md
deleted file mode 100644
index eeebca6ea..000000000
--- a/translations/ja/2-Regression/4-Logistic/README.md
+++ /dev/null
@@ -1,328 +0,0 @@
-# カテゴリー予測のためのロジスティック回帰
-
-
-
-## [講義前クイズ](https://gray-sand-07a10f403.1.azurestaticapps.net/quiz/15/)
-
-> ### [このレッスンはRでも利用可能です!](../../../../2-Regression/4-Logistic/solution/R/lesson_4.html)
-
-## はじめに
-
-この回帰に関する最終レッスンでは、基本的な _クラシック_ な機械学習技術の一つであるロジスティック回帰について見ていきます。この技術を使用して、二値のカテゴリーを予測するパターンを発見することができます。このキャンディーはチョコレートかどうか?この病気は伝染するかどうか?この顧客はこの製品を選ぶかどうか?
-
-このレッスンで学ぶこと:
-
-- データビジュアライゼーションのための新しいライブラリ
-- ロジスティック回帰の技術
-
-✅ このタイプの回帰を扱う理解を深めるために、この [Learnモジュール](https://docs.microsoft.com/learn/modules/train-evaluate-classification-models?WT.mc_id=academic-77952-leestott) を参照してください。
-
-## 前提条件
-
-パンプキンデータを扱ってきたので、二値のカテゴリーが一つあることに気づくことができました:`Color`。
-
-いくつかの変数を与えられた場合に、_特定のカボチャの色がオレンジ 🎃 か白 👻 かを予測する_ ロジスティック回帰モデルを構築しましょう。
-
-> なぜ回帰に関するレッスンで二値分類について話しているのか?それは言語的な便宜のためであり、ロジスティック回帰は [実際には分類方法](https://scikit-learn.org/stable/modules/linear_model.html#logistic-regression) ですが、線形に基づいているためです。次のレッスングループでは、データを分類する他の方法について学びます。
-
-## 質問を定義する
-
-私たちの目的のために、これを「白」または「白ではない」として表現します。データセットには「ストライプ」カテゴリもありますが、インスタンスが少ないため使用しません。データセットからnull値を削除すると、いずれにせよ消えます。
-
-> 🎃 面白い事実:白いカボチャを「ゴーストカボチャ」と呼ぶことがあります。彫るのが難しいので、オレンジのカボチャほど人気はありませんが、見た目はクールです!したがって、質問を「ゴースト」または「ゴーストではない」と再定義することもできます。👻
-
-## ロジスティック回帰について
-
-ロジスティック回帰は、以前に学んだ線形回帰とはいくつかの重要な点で異なります。
-
-[](https://youtu.be/KpeCT6nEpBY "ML初心者向け - 機械学習分類のためのロジスティック回帰の理解")
-
-> 🎥 上の画像をクリックして、ロジスティック回帰の概要を短いビデオで確認してください。
-
-### 二値分類
-
-ロジスティック回帰は、線形回帰と同じ機能を提供しません。前者は二値のカテゴリー(「白か白ではない」)についての予測を提供しますが、後者は連続的な値を予測することができます。たとえば、カボチャの産地と収穫時期を考慮して、_その価格がどの程度上昇するか_ を予測できます。
-
-
-> インフォグラフィック by [Dasani Madipalli](https://twitter.com/dasani_decoded)
-
-### 他の分類
-
-ロジスティック回帰には、他にも多項式や順序などの種類があります:
-
-- **多項式**:複数のカテゴリを持つもの - 「オレンジ、白、ストライプ」。
-- **順序**:順序付けられたカテゴリを持つもの。たとえば、カボチャのサイズ(ミニ、小、中、大、XL、XXL)で順序付ける場合など。
-
-
-
-### 変数が相関している必要はない
-
-線形回帰がより相関のある変数でうまく機能することを覚えていますか?ロジスティック回帰はその逆で、変数が一致する必要はありません。このデータには、やや弱い相関がありますが、それでも機能します。
-
-### たくさんのクリーンなデータが必要
-
-ロジスティック回帰は、データが多いほど正確な結果をもたらします。私たちの小さなデータセットはこのタスクには最適ではないので、それを念頭に置いてください。
-
-[](https://youtu.be/B2X4H9vcXTs "ML初心者向け - ロジスティック回帰のためのデータ分析と準備")
-
-> 🎥 上の画像をクリックして、線形回帰のためのデータ準備の概要を短いビデオで確認してください。
-
-✅ ロジスティック回帰に適したデータの種類について考えてみてください。
-
-## 演習 - データの整頓
-
-まず、データを少しクリーンにし、null値を削除し、いくつかの列のみを選択します:
-
-1. 以下のコードを追加します:
-
- ```python
-
- columns_to_select = ['City Name','Package','Variety', 'Origin','Item Size', 'Color']
- pumpkins = full_pumpkins.loc[:, columns_to_select]
-
- pumpkins.dropna(inplace=True)
- ```
-
- 新しいデータフレームを覗いてみることもできます:
-
- ```python
- pumpkins.info
- ```
-
-### ビジュアライゼーション - カテゴリカルプロット
-
-これまでに、パンプキンデータを再度読み込み、いくつかの変数を含むデータセットを保持するようにクリーニングした [スターターノートブック](../../../../2-Regression/4-Logistic/notebook.ipynb) をロードしました。ノートブックでデータフレームを新しいライブラリを使ってビジュアライズしましょう:[Seaborn](https://seaborn.pydata.org/index.html) は、以前使用したMatplotlibの上に構築されています。
-
-Seabornはデータをビジュアライズするための便利な方法を提供します。たとえば、`Variety`と`Color`のデータの分布をカテゴリカルプロットで比較することができます。
-
-1. `catplot` function, using our pumpkin data `pumpkins` を使用して、各カボチャカテゴリ(オレンジまたは白)の色マッピングを指定して、プロットを作成します:
-
- ```python
- import seaborn as sns
-
- palette = {
- 'ORANGE': 'orange',
- 'WHITE': 'wheat',
- }
-
- sns.catplot(
- data=pumpkins, y="Variety", hue="Color", kind="count",
- palette=palette,
- )
- ```
-
- 
-
- データを観察することで、色データがVarietyにどのように関連しているかがわかります。
-
- ✅ このカテゴリカルプロットを見て、どのような興味深い探索ができるか考えてみてください。
-
-### データ前処理:特徴とラベルのエンコーディング
-私たちのカボチャデータセットには、すべての列に文字列値が含まれています。カテゴリカルデータを扱うことは人間にとっては直感的ですが、機械にはそうではありません。機械学習アルゴリズムは数値でうまく機能します。そのため、エンコーディングはデータ前処理フェーズで非常に重要なステップです。これにより、カテゴリカルデータを数値データに変換することができ、情報を失うことなく行えます。良いエンコーディングは良いモデルの構築につながります。
-
-特徴エンコーディングには2つの主要なエンコーダーがあります:
-
-1. 順序エンコーダー:これは順序変数に適しています。順序変数は、データが論理的な順序に従うカテゴリカル変数です。私たちのデータセットの`Item Size`列のようなものです。各カテゴリを数値で表し、その列の順序に従ってマッピングを作成します。
-
- ```python
- from sklearn.preprocessing import OrdinalEncoder
-
- item_size_categories = [['sml', 'med', 'med-lge', 'lge', 'xlge', 'jbo', 'exjbo']]
- ordinal_features = ['Item Size']
- ordinal_encoder = OrdinalEncoder(categories=item_size_categories)
- ```
-
-2. カテゴリカルエンコーダー:これは名義変数に適しています。名義変数は、データが論理的な順序に従わないカテゴリカル変数です。データセットの`Item Size`以外のすべての特徴がこれに該当します。これはワンホットエンコーディングであり、各カテゴリをバイナリ列で表します。エンコードされた変数が1の場合、そのカボチャがそのVarietyに属し、0の場合はそうではありません。
-
- ```python
- from sklearn.preprocessing import OneHotEncoder
-
- categorical_features = ['City Name', 'Package', 'Variety', 'Origin']
- categorical_encoder = OneHotEncoder(sparse_output=False)
- ```
-その後、`ColumnTransformer`を使用して、複数のエンコーダーを1つのステップに組み合わせて適切な列に適用します。
-
-```python
- from sklearn.compose import ColumnTransformer
-
- ct = ColumnTransformer(transformers=[
- ('ord', ordinal_encoder, ordinal_features),
- ('cat', categorical_encoder, categorical_features)
- ])
-
- ct.set_output(transform='pandas')
- encoded_features = ct.fit_transform(pumpkins)
-```
-一方、ラベルをエンコードするために、scikit-learnの`LabelEncoder`クラスを使用します。これは、ラベルを0からn_classes-1(ここでは0と1)の間の値のみを含むように正規化するユーティリティクラスです。
-
-```python
- from sklearn.preprocessing import LabelEncoder
-
- label_encoder = LabelEncoder()
- encoded_label = label_encoder.fit_transform(pumpkins['Color'])
-```
-特徴とラベルをエンコードしたら、新しいデータフレーム`encoded_pumpkins`にマージできます。
-
-```python
- encoded_pumpkins = encoded_features.assign(Color=encoded_label)
-```
-✅ 順序エンコーダーを`Item Size` column?
-
-### Analyse relationships between variables
-
-Now that we have pre-processed our data, we can analyse the relationships between the features and the label to grasp an idea of how well the model will be able to predict the label given the features.
-The best way to perform this kind of analysis is plotting the data. We'll be using again the Seaborn `catplot` function, to visualize the relationships between `Item Size`, `Variety`および`Color`にカテゴリカルプロットで使用する利点は何ですか?データをよりよくプロットするために、エンコードされた`Item Size` column and the unencoded `Variety`列を使用します。
-
-```python
- palette = {
- 'ORANGE': 'orange',
- 'WHITE': 'wheat',
- }
- pumpkins['Item Size'] = encoded_pumpkins['ord__Item Size']
-
- g = sns.catplot(
- data=pumpkins,
- x="Item Size", y="Color", row='Variety',
- kind="box", orient="h",
- sharex=False, margin_titles=True,
- height=1.8, aspect=4, palette=palette,
- )
- g.set(xlabel="Item Size", ylabel="").set(xlim=(0,6))
- g.set_titles(row_template="{row_name}")
-```
-
-
-### スウォームプロットを使用する
-
-色は二値のカテゴリ(白か白ではない)であるため、ビジュアライゼーションには「[特化したアプローチ](https://seaborn.pydata.org/tutorial/categorical.html?highlight=bar)」が必要です。このカテゴリと他の変数の関係をビジュアライズする他の方法もあります。
-
-Seabornプロットを使用して変数を並べて視覚化することができます。
-
-1. 値の分布を示すために「スウォーム」プロットを試してみてください:
-
- ```python
- palette = {
- 0: 'orange',
- 1: 'wheat'
- }
- sns.swarmplot(x="Color", y="ord__Item Size", data=encoded_pumpkins, palette=palette)
- ```
-
- 
-
-**注意**:上記のコードは警告を生成する可能性があります。これはSeabornがスウォームプロットに多くのデータポイントを表示するのに失敗するためです。解決策として、マーカーのサイズを「size」パラメーターを使用して小さくすることが考えられます。ただし、これによりプロットの可読性が影響を受ける可能性があることに注意してください。
-
-> **🧮 数学を見せて**
->
-> ロジスティック回帰は「最大尤度」の概念に依存しており、[シグモイド関数](https://wikipedia.org/wiki/Sigmoid_function)を使用します。プロット上の「シグモイド関数」は「S」字型に見えます。これは値を取り、それを0から1の間のどこかにマッピングします。この曲線は「ロジスティック曲線」とも呼ばれます。その公式は次のようになります:
->
-> 
->
-> ここで、シグモイドの中点はxの0点にあり、Lは曲線の最大値、kは曲線の急峻さです。関数の結果が0.5を超える場合、そのラベルは二値選択の「1」として分類されます。それ以外の場合は「0」として分類されます。
-
-## モデルを構築する
-
-Scikit-learnでこの二値分類を見つけるモデルを構築するのは驚くほど簡単です。
-
-[](https://youtu.be/MmZS2otPrQ8 "ML初心者向け - データの分類のためのロジスティック回帰")
-
-> 🎥 上の画像をクリックして、線形回帰モデルの構築についての短いビデオを確認してください。
-
-1. 分類モデルで使用する変数を選択し、`train_test_split()`を呼び出してトレーニングセットとテストセットに分割します:
-
- ```python
- from sklearn.model_selection import train_test_split
-
- X = encoded_pumpkins[encoded_pumpkins.columns.difference(['Color'])]
- y = encoded_pumpkins['Color']
-
- X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=0)
-
- ```
-
-2. 次に、トレーニングデータを使用してモデルをトレーニングし、結果を出力します:
-
- ```python
- from sklearn.metrics import f1_score, classification_report
- from sklearn.linear_model import LogisticRegression
-
- model = LogisticRegression()
- model.fit(X_train, y_train)
- predictions = model.predict(X_test)
-
- print(classification_report(y_test, predictions))
- print('Predicted labels: ', predictions)
- print('F1-score: ', f1_score(y_test, predictions))
- ```
-
- モデルのスコアボードを見てみましょう。約1000行のデータしかないことを考えると、悪くないです:
-
- ```output
- precision recall f1-score support
-
- 0 0.94 0.98 0.96 166
- 1 0.85 0.67 0.75 33
-
- accuracy 0.92 199
- macro avg 0.89 0.82 0.85 199
- weighted avg 0.92 0.92 0.92 199
-
- Predicted labels: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0
- 0 0 0 0 0 1 0 1 0 0 1 0 0 0 0 0 1 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 1 1 0
- 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
- 0 0 0 1 0 0 0 0 0 0 0 0 1 1]
- F1-score: 0.7457627118644068
- ```
-
-## 混同行列による理解の向上
-
-上記の項目を印刷してスコアボードレポートを取得することもできますが、[混同行列](https://scikit-learn.org/stable/modules/model_evaluation.html#confusion-matrix)を使用してモデルのパフォーマンスを理解する方が簡単かもしれません。
-
-> 🎓 「[混同行列](https://wikipedia.org/wiki/Confusion_matrix)」または「エラーマトリックス」は、モデルの真陽性と偽陽性、および真陰性と偽陰性を表現する表であり、予測の正確性を測定します。
-
-1. 混同行列を使用するには、`confusion_matrix()`を呼び出します:
-
- ```python
- from sklearn.metrics import confusion_matrix
- confusion_matrix(y_test, predictions)
- ```
-
- モデルの混同行列を見てみましょう:
-
- ```output
- array([[162, 4],
- [ 11, 22]])
- ```
-
-Scikit-learnの混同行列では、行(軸0)は実際のラベルであり、列(軸1)は予測されたラベルです。
-
-| | 0 | 1 |
-| :---: | :---: | :---: |
-| 0 | TN | FP |
-| 1 | FN | TP |
-
-ここで何が起こっているのでしょうか?たとえば、モデルがカボチャを「白」と「白ではない」という二値カテゴリに分類するとしましょう。
-
-- モデルがカボチャを「白ではない」と予測し、実際に「白ではない」カテゴリに属する場合、これを真陰性(TN)と呼びます。これは左上の数字で示されます。
-- モデルがカボチャを「白」と予測し、実際に「白ではない」カテゴリに属する場合、これを偽陰性(FN)と呼びます。これは左下の数字で示されます。
-- モデルがカボチャを「白ではない」と予測し、実際に「白」カテゴリに属する場合、これを偽陽性(FP)と呼びます。これは右上の数字で示されます。
-- モデルがカボチャを「白」と予測し、実際に「白」カテゴリに属する場合、これを真陽性(TP)と呼びます。これは右下の数字で示されます。
-
-予想通り、真陽性と真陰性の数が多く、偽陽性と偽陰性の数が少ない方が、モデルのパフォーマンスが優れていることを示します。
-
-混同行列が精度と再現率にどのように関連しているかを見てみましょう。前述の分類レポートには精度(0.85)と再現率(0.67)が表示されました。
-
-精度 = tp / (tp + fp) = 22 / (22 + 4) = 0.8461538461538461
-
-再現率 = tp / (tp + fn) = 22 / (22 + 11) = 0.6666666666666666
-
-✅ Q: 混同行列によると、モデルはどうでしたか? A: 悪くないです。真陰性の数が多いですが、偽陰性もいくつかあります。
-
-混同行列のTP/TNとFP/FNのマッピングを使用して、先ほど見た用語を再確認しましょう:
-
-🎓 精度:TP/(TP + FP)
-
-**免責事項**:
-この文書は機械ベースのAI翻訳サービスを使用して翻訳されています。正確さを期しておりますが、自動翻訳には誤りや不正確さが含まれる場合がありますのでご注意ください。原文の言語による元の文書を信頼できる情報源とみなすべきです。重要な情報については、専門の人間による翻訳をお勧めします。この翻訳の使用に起因する誤解や誤訳について、当社は一切の責任を負いません。
\ No newline at end of file
diff --git a/translations/ja/2-Regression/4-Logistic/assignment.md b/translations/ja/2-Regression/4-Logistic/assignment.md
deleted file mode 100644
index 13ed9aa89..000000000
--- a/translations/ja/2-Regression/4-Logistic/assignment.md
+++ /dev/null
@@ -1,14 +0,0 @@
-# 回帰の再試行
-
-## 手順
-
-このレッスンでは、かぼちゃデータの一部を使用しました。今度は、元のデータに戻り、すべてのデータをクリーンアップして標準化し、ロジスティック回帰モデルを構築してみましょう。
-
-## 評価基準
-
-| 基準 | 優秀 | 適切 | 改善の余地あり |
-| -------- | -------------------------------------------------------------------- | ------------------------------------------------------- | -------------------------------------------------------- |
-| | よく説明され、パフォーマンスの良いモデルを持つノートブックが提出される | 最低限のパフォーマンスを持つモデルを持つノートブックが提出される | パフォーマンスの低いモデル、またはモデルがないノートブックが提出される |
-
-**免責事項**:
-この文書は機械翻訳AIサービスを使用して翻訳されています。正確さを期していますが、自動翻訳には誤りや不正確さが含まれる場合があります。元の言語で記載された原文を信頼できる情報源と見なしてください。重要な情報については、専門の人間による翻訳を推奨します。この翻訳の使用に起因する誤解や誤った解釈については責任を負いかねます。
\ No newline at end of file
diff --git a/translations/ja/2-Regression/4-Logistic/solution/Julia/README.md b/translations/ja/2-Regression/4-Logistic/solution/Julia/README.md
deleted file mode 100644
index 8ce1ec93f..000000000
--- a/translations/ja/2-Regression/4-Logistic/solution/Julia/README.md
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-**免責事項**:
-この文書は機械ベースのAI翻訳サービスを使用して翻訳されています。正確さを期していますが、自動翻訳にはエラーや不正確さが含まれる場合があります。元の言語で記載された原文を信頼できる情報源と見なしてください。重要な情報については、専門の人間による翻訳をお勧めします。この翻訳の使用によって生じたいかなる誤解や誤訳についても、当社は責任を負いません。
\ No newline at end of file
diff --git a/translations/ja/2-Regression/README.md b/translations/ja/2-Regression/README.md
deleted file mode 100644
index e1a749bf3..000000000
--- a/translations/ja/2-Regression/README.md
+++ /dev/null
@@ -1,43 +0,0 @@
-# 機械学習のための回帰モデル
-## 地域トピック: 北米のカボチャ価格に対する回帰モデル 🎃
-
-北米では、ハロウィンのためにカボチャがよく怖い顔に彫られます。この魅力的な野菜についてもっと発見してみましょう!
-
-
-> 写真提供: Beth Teutschmann on Unsplash
-
-## 学ぶこと
-
-[](https://youtu.be/5QnJtDad4iQ "回帰紹介ビデオ - クリックして視聴!")
-> 🎥 上の画像をクリックして、このレッスンの簡単な紹介ビデオを視聴してください
-
-このセクションのレッスンでは、機械学習の文脈での回帰の種類について説明します。回帰モデルは、変数間の_関係_を決定するのに役立ちます。このタイプのモデルは、長さ、温度、年齢などの値を予測することができ、データポイントを分析することで変数間の関係を明らかにします。
-
-この一連のレッスンでは、線形回帰とロジスティック回帰の違いを発見し、どちらを選ぶべきかを学びます。
-
-[](https://youtu.be/XA3OaoW86R8 "初心者向け機械学習 - 回帰モデルの紹介")
-
-> 🎥 上の画像をクリックして、回帰モデルの紹介ビデオを視聴してください
-
-この一連のレッスンでは、機械学習のタスクを開始するための準備を行います。これには、データサイエンティストの共通の環境であるノートブックを管理するためのVisual Studio Codeの設定が含まれます。Scikit-learnという機械学習のライブラリを発見し、この章では回帰モデルに焦点を当てて最初のモデルを構築します。
-
-> 回帰モデルの操作について学ぶのに役立つローコードツールがあります。このタスクには [Azure ML](https://docs.microsoft.com/learn/modules/create-regression-model-azure-machine-learning-designer/?WT.mc_id=academic-77952-leestott) を試してみてください。
-
-### レッスン
-
-1. [ツールの紹介](1-Tools/README.md)
-2. [データの管理](2-Data/README.md)
-3. [線形および多項式回帰](3-Linear/README.md)
-4. [ロジスティック回帰](4-Logistic/README.md)
-
----
-### クレジット
-
-「回帰を用いた機械学習」は [Jen Looper](https://twitter.com/jenlooper) によって♥️を込めて書かれました。
-
-♥️ クイズの貢献者には [Muhammad Sakib Khan Inan](https://twitter.com/Sakibinan) と [Ornella Altunyan](https://twitter.com/ornelladotcom) が含まれます。
-
-カボチャのデータセットは [このKaggleプロジェクト](https://www.kaggle.com/usda/a-year-of-pumpkin-prices) によって提案され、そのデータはアメリカ合衆国農務省が配布する [Specialty Crops Terminal Markets Standard Reports](https://www.marketnews.usda.gov/mnp/fv-report-config-step1?type=termPrice) に由来しています。品種に基づく色に関するポイントを追加して分布を正規化しました。このデータはパブリックドメインです。
-
-**免責事項**:
-この文書は機械ベースのAI翻訳サービスを使用して翻訳されています。正確さを期すよう努めていますが、自動翻訳には誤りや不正確さが含まれる場合がありますのでご注意ください。原文の言語によるオリジナル文書が権威ある情報源と見なされるべきです。重要な情報については、専門の人間による翻訳をお勧めします。この翻訳の使用に起因する誤解や誤訳について、当社は一切の責任を負いません。
\ No newline at end of file
diff --git a/translations/ja/3-Web-App/1-Web-App/README.md b/translations/ja/3-Web-App/1-Web-App/README.md
deleted file mode 100644
index 38fd5e80d..000000000
--- a/translations/ja/3-Web-App/1-Web-App/README.md
+++ /dev/null
@@ -1,348 +0,0 @@
-# MLモデルを使用するWebアプリを構築する
-
-このレッスンでは、NUFORCのデータベースから取得した「過去1世紀のUFO目撃情報」という、まさに非現実的なデータセットでMLモデルを訓練します。
-
-あなたが学ぶこと:
-
-- 訓練されたモデルを「ピクル」する方法
-- Flaskアプリでそのモデルを使用する方法
-
-データをクリーンアップし、モデルを訓練するためにノートブックを引き続き使用しますが、プロセスを一歩進めて、いわば「野生で」モデルを使用する方法を探求します:それはWebアプリの中でのことです。
-
-これを実現するために、Flaskを使用してWebアプリを構築する必要があります。
-
-## [講義前クイズ](https://gray-sand-07a10f403.1.azurestaticapps.net/quiz/17/)
-
-## アプリの構築
-
-機械学習モデルを消費するためのWebアプリを構築する方法はいくつかあります。あなたのWebアーキテクチャは、モデルがどのように訓練されるかに影響を与えるかもしれません。データサイエンスグループが訓練したモデルをアプリで使用したいビジネスで働いていると想像してください。
-
-### 考慮事項
-
-考慮すべき多くの質問があります:
-
-- **Webアプリですか、それともモバイルアプリですか?** モバイルアプリを構築している場合や、IoTのコンテキストでモデルを使用する必要がある場合は、[TensorFlow Lite](https://www.tensorflow.org/lite/)を使用して、AndroidまたはiOSアプリでモデルを使用できます。
-- **モデルはどこに配置されますか?** クラウド上かローカルか?
-- **オフラインサポート。** アプリはオフラインで動作する必要がありますか?
-- **モデルを訓練するために使用された技術は何ですか?** 選択した技術は、使用するツールに影響を与えるかもしれません。
- - **TensorFlowを使用する。** 例えば、TensorFlowを使用してモデルを訓練している場合、そのエコシステムは[TensorFlow.js](https://www.tensorflow.org/js/)を使用してWebアプリで利用するためにTensorFlowモデルを変換する機能を提供します。
- - **PyTorchを使用する。** [PyTorch](https://pytorch.org/)のようなライブラリを使用してモデルを構築している場合、JavaScriptのWebアプリで使用できる[ONNX](https://onnx.ai/)(Open Neural Network Exchange)形式でエクスポートするオプションがあります。このオプションは、Scikit-learnで訓練されたモデルの将来のレッスンで探求されます。
- - **Lobe.aiまたはAzure Custom Visionを使用する。** [Lobe.ai](https://lobe.ai/)や[Azure Custom Vision](https://azure.microsoft.com/services/cognitive-services/custom-vision-service/?WT.mc_id=academic-77952-leestott)のようなML SaaS(Software as a Service)システムを使用してモデルを訓練している場合、この種のソフトウェアは、オンラインアプリケーションからクラウドでクエリされるカスタムAPIを構築するなど、多くのプラットフォーム向けにモデルをエクスポートする方法を提供します。
-
-また、ブラウザでモデルを自ら訓練できる完全なFlask Webアプリを構築する機会もあります。これもJavaScriptコンテキストでTensorFlow.jsを使用して実現できます。
-
-私たちの目的のために、Pythonベースのノートブックを使用しているので、そのようなノートブックから訓練されたモデルをPythonで構築されたWebアプリが読み取れる形式にエクスポートする手順を探ってみましょう。
-
-## ツール
-
-このタスクには2つのツールが必要です:FlaskとPickle、どちらもPythonで動作します。
-
-✅ [Flask](https://palletsprojects.com/p/flask/)とは何ですか? Flaskはその作成者によって「マイクロフレームワーク」と定義されており、Pythonを使用してWebページを構築するための基本機能を提供します。Flaskでの構築を練習するために、[このLearnモジュール](https://docs.microsoft.com/learn/modules/python-flask-build-ai-web-app?WT.mc_id=academic-77952-leestott)を見てみてください。
-
-✅ [Pickle](https://docs.python.org/3/library/pickle.html)とは何ですか? Pickle 🥒はPythonオブジェクト構造をシリアライズおよびデシリアライズするPythonモジュールです。モデルを「ピクル」すると、Webで使用するためにその構造をシリアライズまたはフラット化します。注意してください:pickleは本質的に安全ではないため、ファイルを「アンピクル」するように求められた場合は注意してください。ピクルされたファイルには接尾辞`.pkl`があります。
-
-## 演習 - データをクリーンアップする
-
-このレッスンでは、[NUFORC](https://nuforc.org)(全米UFO報告センター)が収集した80,000件のUFO目撃データを使用します。このデータには、UFO目撃の興味深い説明が含まれています。例えば:
-
-- **長い例の説明。** 「光のビームから男が現れ、夜の草原に照らされ、テキサス・インスツルメンツの駐車場に向かって走る」。
-- **短い例の説明。** 「光が私たちを追いかけてきた」。
-
-[ufos.csv](../../../../3-Web-App/1-Web-App/data/ufos.csv)スプレッドシートには、目撃が発生した`city`、`state`、`country`に関する列、オブジェクトの`shape`、およびその`latitude`と`longitude`が含まれています。
-
-このレッスンに含まれる空の[ノートブック](../../../../3-Web-App/1-Web-App/notebook.ipynb)で:
-
-1. 前のレッスンで行ったように`pandas`、`matplotlib`、`numpy`をインポートし、ufosスプレッドシートをインポートします。サンプルデータセットを確認できます:
-
- ```python
- import pandas as pd
- import numpy as np
-
- ufos = pd.read_csv('./data/ufos.csv')
- ufos.head()
- ```
-
-1. ufosデータを新しいタイトルの小さなデータフレームに変換します。`Country`フィールドのユニークな値を確認します。
-
- ```python
- ufos = pd.DataFrame({'Seconds': ufos['duration (seconds)'], 'Country': ufos['country'],'Latitude': ufos['latitude'],'Longitude': ufos['longitude']})
-
- ufos.Country.unique()
- ```
-
-1. 次に、null値を削除し、1〜60秒の間の目撃情報のみをインポートすることで、処理するデータの量を減らすことができます:
-
- ```python
- ufos.dropna(inplace=True)
-
- ufos = ufos[(ufos['Seconds'] >= 1) & (ufos['Seconds'] <= 60)]
-
- ufos.info()
- ```
-
-1. Scikit-learnの`LabelEncoder`ライブラリをインポートして、国のテキスト値を数値に変換します:
-
- ✅ LabelEncoderはデータをアルファベット順にエンコードします
-
- ```python
- from sklearn.preprocessing import LabelEncoder
-
- ufos['Country'] = LabelEncoder().fit_transform(ufos['Country'])
-
- ufos.head()
- ```
-
- あなたのデータは次のようになります:
-
- ```output
- Seconds Country Latitude Longitude
- 2 20.0 3 53.200000 -2.916667
- 3 20.0 4 28.978333 -96.645833
- 14 30.0 4 35.823889 -80.253611
- 23 60.0 4 45.582778 -122.352222
- 24 3.0 3 51.783333 -0.783333
- ```
-
-## 演習 - モデルを構築する
-
-データを訓練グループとテストグループに分割して、モデルを訓練する準備が整いました。
-
-1. 訓練に使用する3つの特徴をXベクトルとして選択し、yベクトルは`Country`. You want to be able to input `Seconds`, `Latitude` and `Longitude`で、国のIDを返します。
-
- ```python
- from sklearn.model_selection import train_test_split
-
- Selected_features = ['Seconds','Latitude','Longitude']
-
- X = ufos[Selected_features]
- y = ufos['Country']
-
- X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=0)
- ```
-
-1. ロジスティック回帰を使用してモデルを訓練します:
-
- ```python
- from sklearn.metrics import accuracy_score, classification_report
- from sklearn.linear_model import LogisticRegression
- model = LogisticRegression()
- model.fit(X_train, y_train)
- predictions = model.predict(X_test)
-
- print(classification_report(y_test, predictions))
- print('Predicted labels: ', predictions)
- print('Accuracy: ', accuracy_score(y_test, predictions))
- ```
-
-精度は悪くありません **(約95%)**、予想通り、`Country` and `Latitude/Longitude` correlate.
-
-The model you created isn't very revolutionary as you should be able to infer a `Country` from its `Latitude` and `Longitude`ですが、クリーンアップし、エクスポートした生データから訓練し、このモデルをWebアプリで使用することを試みるのは良い練習です。
-
-## 演習 - モデルを「ピクル」する
-
-さて、モデルを_ピクル_する時が来ました! いくつかの行のコードでそれを行うことができます。一度_ピクル_したら、ピクルされたモデルを読み込み、秒、緯度、経度の値を含むサンプルデータ配列に対してテストします。
-
-```python
-import pickle
-model_filename = 'ufo-model.pkl'
-pickle.dump(model, open(model_filename,'wb'))
-
-model = pickle.load(open('ufo-model.pkl','rb'))
-print(model.predict([[50,44,-12]]))
-```
-
-モデルは**「3」**を返します。これは、イギリスの国コードです。すごい! 👽
-
-## 演習 - Flaskアプリを構築する
-
-次に、モデルを呼び出して似たような結果を返すFlaskアプリを構築できますが、より視覚的に魅力的な方法で。
-
-1. _ufo-model.pkl_ファイルが存在する_notebook.ipynb_ファイルの隣に**web-app**という名前のフォルダを作成します。
-
-1. そのフォルダ内に、**static**というフォルダとその中に**css**フォルダ、さらに**templates**というフォルダを作成します。これで、次のファイルとディレクトリが揃っているはずです:
-
- ```output
- web-app/
- static/
- css/
- templates/
- notebook.ipynb
- ufo-model.pkl
- ```
-
- ✅ 完成したアプリのビューについては、ソリューションフォルダを参照してください。
-
-1. _web-app_フォルダで最初に作成するファイルは**requirements.txt**ファイルです。JavaScriptアプリの_package.json_のように、このファイルにはアプリに必要な依存関係がリストされています。**requirements.txt**に次の行を追加します:
-
- ```text
- scikit-learn
- pandas
- numpy
- flask
- ```
-
-1. 次に、このファイルを実行するために_web-app_に移動します:
-
- ```bash
- cd web-app
- ```
-
-1. ターミナルに`pip install`と入力し、_requirements.txt_にリストされたライブラリをインストールします:
-
- ```bash
- pip install -r requirements.txt
- ```
-
-1. これで、アプリを完成させるためにさらに3つのファイルを作成する準備が整いました:
-
- 1. ルートに**app.py**を作成します。
- 2. _templates_ディレクトリに**index.html**を作成します。
- 3. _static/css_ディレクトリに**styles.css**を作成します。
-
-1. _styles.css_ファイルにいくつかのスタイルを追加します:
-
- ```css
- body {
- width: 100%;
- height: 100%;
- font-family: 'Helvetica';
- background: black;
- color: #fff;
- text-align: center;
- letter-spacing: 1.4px;
- font-size: 30px;
- }
-
- input {
- min-width: 150px;
- }
-
- .grid {
- width: 300px;
- border: 1px solid #2d2d2d;
- display: grid;
- justify-content: center;
- margin: 20px auto;
- }
-
- .box {
- color: #fff;
- background: #2d2d2d;
- padding: 12px;
- display: inline-block;
- }
- ```
-
-1. 次に、_index.html_ファイルを構築します:
-
- ```html
-
-
-
-
- According to the number of seconds, latitude and longitude, which country is likely to have reported seeing a UFO?
- - - -{{ prediction_text }}
- -
-
-Here γ is the so-called **discount factor** that determines to which extent you should prefer the current reward over the future reward and vice versa.
-
-## Learning Algorithm
-
-Given the equation above, we can now write pseudo-code for our learning algorithm:
-
-* Initialize Q-Table Q with equal numbers for all states and actions
-* Set learning rate α ← 1
-* Repeat simulation many times
- 1. Start at random position
- 1. Repeat
- 1. Select an action *a* at state *s*
- 2. Execute action by moving to a new state *s'*
- 3. If we encounter end-of-game condition, or total reward is too small - exit simulation
- 4. Compute reward *r* at the new state
- 5. Update Q-Function according to Bellman equation: *Q(s,a)* ← *(1-α)Q(s,a)+α(r+γ maxa'Q(s',a'))*
- 6. *s* ← *s'*
- 7. Update the total reward and decrease α.
-
-## Exploit vs. explore
-
-In the algorithm above, we did not specify how exactly we should choose an action at step 2.1. If we are choosing the action randomly, we will randomly **explore** the environment, and we are quite likely to die often as well as explore areas where we would not normally go. An alternative approach would be to **exploit** the Q-Table values that we already know, and thus to choose the best action (with higher Q-Table value) at state *s*. This, however, will prevent us from exploring other states, and it's likely we might not find the optimal solution.
-
-Thus, the best approach is to strike a balance between exploration and exploitation. This can be done by choosing the action at state *s* with probabilities proportional to values in the Q-Table. In the beginning, when Q-Table values are all the same, it would correspond to a random selection, but as we learn more about our environment, we would be more likely to follow the optimal route while allowing the agent to choose the unexplored path once in a while.
-
-## Python implementation
-
-We are now ready to implement the learning algorithm. Before we do that, we also need some function that will convert arbitrary numbers in the Q-Table into a vector of probabilities for corresponding actions.
-
-1. Create a function `probs()` に渡すことができます:
-
- ```python
- def probs(v,eps=1e-4):
- v = v-v.min()+eps
- v = v/v.sum()
- return v
- ```
-
- 初期状態でベクトルのすべての成分が同一である場合に 0 で割ることを避けるために、元のベクトルにいくつかの `eps` を追加します。
-
-5000回の実験(エポック)を通じて学習アルゴリズムを実行します(コードブロック 8)。
-
-```python
- for epoch in range(5000):
-
- # Pick initial point
- m.random_start()
-
- # Start travelling
- n=0
- cum_reward = 0
- while True:
- x,y = m.human
- v = probs(Q[x,y])
- a = random.choices(list(actions),weights=v)[0]
- dpos = actions[a]
- m.move(dpos,check_correctness=False) # we allow player to move outside the board, which terminates episode
- r = reward(m)
- cum_reward += r
- if r==end_reward or cum_reward < -1000:
- lpath.append(n)
- break
- alpha = np.exp(-n / 10e5)
- gamma = 0.5
- ai = action_idx[a]
- Q[x,y,ai] = (1 - alpha) * Q[x,y,ai] + alpha * (r + gamma * Q[x+dpos[0], y+dpos[1]].max())
- n+=1
-```
-
-このアルゴリズムを実行した後、Qテーブルは各ステップでの異なるアクションの魅力を定義する値で更新されます。Qテーブルを視覚化して、各セルに小さな円を描くことで、移動の希望方向を示すベクトルをプロットすることができます。
-
-## ポリシーの確認
-
-Qテーブルは各状態での各アクションの「魅力」をリストしているため、効率的なナビゲーションを定義するのに簡単に使用できます。最も簡単な場合、Qテーブルの値が最も高いアクションを選択できます(コードブロック 9)。
-
-```python
-def qpolicy_strict(m):
- x,y = m.human
- v = probs(Q[x,y])
- a = list(actions)[np.argmax(v)]
- return a
-
-walk(m,qpolicy_strict)
-```
-
-> 上記のコードを数回試してみると、時々「ハング」することがあり、ノートブックの STOP ボタンを押して中断する必要があることに気付くかもしれません。これは、最適な Q値の観点から2つの状態が互いに「指し示す」状況があり、その場合、エージェントが無限にその状態間を移動し続けるためです。
-
-## 🚀チャレンジ
-
-> **タスク 1:** `walk` function to limit the maximum length of path by a certain number of steps (say, 100), and watch the code above return this value from time to time.
-
-> **Task 2:** Modify the `walk` function so that it does not go back to the places where it has already been previously. This will prevent `walk` from looping, however, the agent can still end up being "trapped" in a location from which it is unable to escape.
-
-## Navigation
-
-A better navigation policy would be the one that we used during training, which combines exploitation and exploration. In this policy, we will select each action with a certain probability, proportional to the values in the Q-Table. This strategy may still result in the agent returning back to a position it has already explored, but, as you can see from the code below, it results in a very short average path to the desired location (remember that `print_statistics` を修正して、シミュレーションを100回実行します(コードブロック 10)。
-
-```python
-def qpolicy(m):
- x,y = m.human
- v = probs(Q[x,y])
- a = random.choices(list(actions),weights=v)[0]
- return a
-
-print_statistics(qpolicy)
-```
-
-このコードを実行した後、以前よりも平均経路長がはるかに短くなり、3〜6の範囲になります。
-
-## 学習プロセスの調査
-
-学習プロセスは、問題空間の構造に関する獲得した知識の探索と探索のバランスです。学習の結果(エージェントが目標に到達するための短い経路を見つける能力)が向上したことがわかりましたが、学習プロセス中の平均経路長の変化を観察することも興味深いです。
-
-学習の要点をまとめると:
-
-- **平均経路長の増加**。最初は平均経路長が増加します。これは、環境について何も知らないときに、悪い状態(水や狼)に閉じ込められやすいことが原因です。より多くを学び、この知識を使い始めると、環境をより長く探索できますが、リンゴの位置についてはまだよくわかりません。
-
-- **学習が進むにつれて経路長が減少**。十分に学習すると、エージェントが目標を達成するのが簡単になり、経路長が減少し始めます。ただし、探索は続けているため、最適な経路から逸れ、新しいオプションを探索することがあり、経路が最適より長くなることがあります。
-
-- **突然の経路長の増加**。グラフで経路長が突然増加することもあります。これはプロセスの確率的な性質を示しており、新しい値で Qテーブルの係数を上書きすることで Qテーブルが「損なわれる」可能性があります。理想的には、学習率を低下させることでこれを最小限に抑えるべきです(例えば、学習の終わりに向かって、Qテーブルの値をわずかに調整する)。
-
-全体として、学習プロセスの成功と質は、学習率、学習率の減衰、割引率などのパラメータに大きく依存することを覚えておくことが重要です。これらは **ハイパーパラメータ** と呼ばれ、**パラメータ** とは区別されます。パラメータは学習中に最適化するものであり(例えば、Qテーブルの係数)、最適なハイパーパラメータ値を見つけるプロセスは **ハイパーパラメータ最適化** と呼ばれ、別のトピックとして取り上げる価値があります。
-
-## [講義後のクイズ](https://gray-sand-07a10f403.1.azurestaticapps.net/quiz/46/)
-
-## 課題
-[より現実的な世界](assignment.md)
-
-**免責事項**:
-この文書は機械翻訳AIサービスを使用して翻訳されています。正確さを期していますが、自動翻訳には誤りや不正確さが含まれる場合がありますのでご注意ください。元の言語で記載された文書が信頼できる情報源と見なされるべきです。重要な情報については、専門の人間による翻訳をお勧めします。この翻訳の使用に起因する誤解や誤った解釈について、当社は一切の責任を負いません。
\ No newline at end of file
diff --git a/translations/ja/8-Reinforcement/1-QLearning/assignment.md b/translations/ja/8-Reinforcement/1-QLearning/assignment.md
deleted file mode 100644
index 7f19b4629..000000000
--- a/translations/ja/8-Reinforcement/1-QLearning/assignment.md
+++ /dev/null
@@ -1,30 +0,0 @@
-# より現実的な世界
-
-私たちのシナリオでは、ピーターはほとんど疲れたりお腹が空いたりすることなく移動することができました。より現実的な世界では、ピーターは時々座って休憩し、食事をする必要があります。次のルールを実装して、私たちの世界をより現実的にしましょう。
-
-1. 一つの場所から別の場所に移動することで、ピーターは**エネルギー**を失い、少し**疲労**を得ます。
-2. ピーターはリンゴを食べることでエネルギーを増やすことができます。
-3. ピーターは木の下や草の上で休むことで疲労を取り除くことができます(つまり、木や草のあるボードの位置に移動すること - 緑のフィールド)。
-4. ピーターはオオカミを見つけて倒す必要があります。
-5. オオカミを倒すためには、ピーターは一定のエネルギーと疲労のレベルが必要で、それがないと戦いに負けてしまいます。
-
-## 手順
-
-解決策の出発点として、元の [notebook.ipynb](../../../../8-Reinforcement/1-QLearning/notebook.ipynb) ノートブックを使用してください。
-
-上記のルールに従って報酬関数を修正し、強化学習アルゴリズムを実行してゲームに勝つための最適な戦略を学び、ランダムウォークとの勝敗数を比較してください。
-
-> **Note**: 新しい世界では状態がより複雑で、人間の位置に加えて疲労とエネルギーのレベルも含まれます。状態をタプル (Board, energy, fatigue) として表現するか、状態のためのクラスを定義することを選ぶことができます(`Board` から派生させることもできます)、または元の `Board` クラスを [rlboard.py](../../../../8-Reinforcement/1-QLearning/rlboard.py) 内で修正することもできます。
-
-解決策では、ランダムウォーク戦略を担当するコードを保持し、最後にアルゴリズムの結果をランダムウォークと比較してください。
-
-> **Note**: ハイパーパラメータを調整して動作させる必要があるかもしれません。特にエポック数です。ゲームの成功(オオカミとの戦い)は稀なイベントであるため、訓練時間が長くなることが予想されます。
-
-## 評価基準
-
-| 基準 | 模範的 | 適切 | 改善が必要 |
-| ---- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
-| | 新しい世界のルール、Q学習アルゴリズム、およびいくつかのテキスト説明が定義されたノートブックが提示されます。Q学習はランダムウォークと比較して結果を大幅に改善することができます。 | ノートブックが提示され、Q学習が実装され、ランダムウォークと比較して結果が改善されますが、大幅ではないか、ノートブックの文書が不十分でコードがよく構成されていない。 | 世界のルールを再定義しようとする試みがなされていますが、Q学習アルゴリズムが機能せず、報酬関数が完全に定義されていない。 |
-
-**免責事項**:
-この文書は機械翻訳サービスを使用して翻訳されています。正確さを期しておりますが、自動翻訳には誤りや不正確さが含まれる場合があります。原文の言語で書かれた元の文書を権威ある情報源とみなしてください。重要な情報については、専門の人間による翻訳を推奨します。この翻訳の使用に起因する誤解や誤解について、当社は一切の責任を負いません。
\ No newline at end of file
diff --git a/translations/ja/8-Reinforcement/1-QLearning/solution/Julia/README.md b/translations/ja/8-Reinforcement/1-QLearning/solution/Julia/README.md
deleted file mode 100644
index 327ab68ec..000000000
--- a/translations/ja/8-Reinforcement/1-QLearning/solution/Julia/README.md
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-**免責事項**:
-この文書は機械ベースのAI翻訳サービスを使用して翻訳されています。正確さを期すよう努めておりますが、自動翻訳には誤りや不正確さが含まれる可能性があることをご了承ください。元の言語の文書が権威ある情報源と見なされるべきです。重要な情報については、専門の人間による翻訳を推奨します。この翻訳の使用に起因する誤解や誤訳については、当社は責任を負いません。
\ No newline at end of file
diff --git a/translations/ja/8-Reinforcement/1-QLearning/solution/R/README.md b/translations/ja/8-Reinforcement/1-QLearning/solution/R/README.md
deleted file mode 100644
index 59121ca43..000000000
--- a/translations/ja/8-Reinforcement/1-QLearning/solution/R/README.md
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-**免責事項**:
-この文書は機械翻訳AIサービスを使用して翻訳されています。正確さを期すよう努めていますが、自動翻訳には誤りや不正確さが含まれる場合があります。元の言語の文書が権威ある情報源と見なされるべきです。重要な情報については、専門の人間による翻訳をお勧めします。この翻訳の使用に起因する誤解や誤訳については、一切の責任を負いかねます。
\ No newline at end of file
diff --git a/translations/ja/8-Reinforcement/2-Gym/README.md b/translations/ja/8-Reinforcement/2-Gym/README.md
deleted file mode 100644
index cda88ba74..000000000
--- a/translations/ja/8-Reinforcement/2-Gym/README.md
+++ /dev/null
@@ -1,342 +0,0 @@
-# カートポール スケート
-
-前回のレッスンで解決していた問題は、現実のシナリオには適用できないおもちゃの問題のように見えるかもしれません。しかし、実際には多くの現実の問題もこのシナリオを共有しています。例えば、チェスや囲碁のプレイも同様です。これらは、与えられたルールと**離散状態**を持つボードがあるため、似ています。
-
-## [講義前クイズ](https://gray-sand-07a10f403.1.azurestaticapps.net/quiz/47/)
-
-## はじめに
-
-このレッスンでは、**連続状態**を持つ問題にQラーニングの原則を適用します。連続状態とは、1つ以上の実数で与えられる状態のことです。以下の問題に取り組みます:
-
-> **問題**: ピーターが狼から逃げるためには、もっと速く動けるようになる必要があります。Qラーニングを使用して、ピーターがスケートを学び、特にバランスを保つ方法を見てみましょう。
-
-
-
-> ピーターと彼の友達は、狼から逃れるために創造的になります!画像は[Jen Looper](https://twitter.com/jenlooper)によるものです。
-
-ここでは、**カートポール**問題として知られるバランスを取る方法の簡略版を使用します。カートポールの世界では、左右に動ける水平スライダーがあり、その上に垂直のポールをバランスさせることが目標です。
-
-## 前提条件
-
-このレッスンでは、**OpenAI Gym**というライブラリを使用して、さまざまな**環境**をシミュレートします。このレッスンのコードをローカル(例:Visual Studio Code)で実行する場合、シミュレーションは新しいウィンドウで開きます。オンラインでコードを実行する場合は、[こちら](https://towardsdatascience.com/rendering-openai-gym-envs-on-binder-and-google-colab-536f99391cc7)に記載されているように、コードにいくつかの調整が必要になるかもしれません。
-
-## OpenAI Gym
-
-前回のレッスンでは、ゲームのルールと状態は自分で定義した`Board`クラスによって与えられました。ここでは、バランスポールの物理をシミュレートする特別な**シミュレーション環境**を使用します。強化学習アルゴリズムをトレーニングするための最も人気のあるシミュレーション環境の1つは、[Gym](https://gym.openai.com/)と呼ばれ、[OpenAI](https://openai.com/)によって維持されています。このジムを使用することで、カートポールシミュレーションからアタリゲームまで、さまざまな**環境**を作成できます。
-
-> **Note**: OpenAI Gymで利用可能な他の環境は[こちら](https://gym.openai.com/envs/#classic_control)で確認できます。
-
-まず、ジムをインストールし、必要なライブラリをインポートしましょう(コードブロック1):
-
-```python
-import sys
-!{sys.executable} -m pip install gym
-
-import gym
-import matplotlib.pyplot as plt
-import numpy as np
-import random
-```
-
-## 演習 - カートポール環境の初期化
-
-カートポールのバランス問題に取り組むために、対応する環境を初期化する必要があります。各環境には次のものが関連付けられています:
-
-- **観察スペース**: 環境から受け取る情報の構造を定義します。カートポール問題では、ポールの位置、速度、およびその他の値を受け取ります。
-
-- **アクションスペース**: 可能なアクションを定義します。私たちの場合、アクションスペースは離散的で、**左**と**右**の2つのアクションから成ります。(コードブロック2)
-
-1. 初期化するために、次のコードを入力します:
-
- ```python
- env = gym.make("CartPole-v1")
- print(env.action_space)
- print(env.observation_space)
- print(env.action_space.sample())
- ```
-
-環境がどのように機能するかを見るために、100ステップの短いシミュレーションを実行してみましょう。各ステップで、取るべきアクションの1つを提供します。このシミュレーションでは、`action_space`からランダムにアクションを選択します。
-
-1. 以下のコードを実行して、その結果を確認してください。
-
- ✅ このコードをローカルのPythonインストールで実行することが推奨されます!(コードブロック3)
-
- ```python
- env.reset()
-
- for i in range(100):
- env.render()
- env.step(env.action_space.sample())
- env.close()
- ```
-
- 次のような画像が表示されるはずです:
-
- 
-
-1. シミュレーション中に、どのように行動するかを決定するために観察を取得する必要があります。実際、ステップ関数は現在の観察、報酬関数、およびシミュレーションを続行するかどうかを示す完了フラグを返します:(コードブロック4)
-
- ```python
- env.reset()
-
- done = False
- while not done:
- env.render()
- obs, rew, done, info = env.step(env.action_space.sample())
- print(f"{obs} -> {rew}")
- env.close()
- ```
-
- ノートブックの出力に次のようなものが表示されるはずです:
-
- ```text
- [ 0.03403272 -0.24301182 0.02669811 0.2895829 ] -> 1.0
- [ 0.02917248 -0.04828055 0.03248977 0.00543839] -> 1.0
- [ 0.02820687 0.14636075 0.03259854 -0.27681916] -> 1.0
- [ 0.03113408 0.34100283 0.02706215 -0.55904489] -> 1.0
- [ 0.03795414 0.53573468 0.01588125 -0.84308041] -> 1.0
- ...
- [ 0.17299878 0.15868546 -0.20754175 -0.55975453] -> 1.0
- [ 0.17617249 0.35602306 -0.21873684 -0.90998894] -> 1.0
- ```
-
- シミュレーションの各ステップで返される観察ベクトルには次の値が含まれます:
- - カートの位置
- - カートの速度
- - ポールの角度
- - ポールの回転率
-
-1. これらの数値の最小値と最大値を取得します:(コードブロック5)
-
- ```python
- print(env.observation_space.low)
- print(env.observation_space.high)
- ```
-
- また、各シミュレーションステップでの報酬値が常に1であることに気付くかもしれません。これは、私たちの目標ができるだけ長く生存し、ポールを垂直に保つことであるためです。
-
- ✅ 実際、カートポールシミュレーションは、100回連続の試行で平均報酬が195に達した場合に解決されたと見なされます。
-
-## 状態の離散化
-
-Qラーニングでは、各状態で何をするかを定義するQテーブルを構築する必要があります。これを行うためには、状態が**離散的**である必要があります。つまり、有限の離散値を含む必要があります。したがって、観察を**離散化**し、有限の状態セットにマッピングする必要があります。
-
-これを行う方法はいくつかあります:
-
-- **ビンに分割する**。特定の値の範囲がわかっている場合、この範囲をいくつかの**ビン**に分割し、その値が属するビン番号で置き換えることができます。これはnumpyの[`digitize`](https://numpy.org/doc/stable/reference/generated/numpy.digitize.html)メソッドを使用して行うことができます。この場合、デジタル化に選択したビンの数に依存するため、状態サイズが正確にわかります。
-
-✅ 線形補間を使用して値をある有限の範囲(例えば、-20から20)に持ってきてから、四捨五入して整数に変換することもできます。これにより、入力値の正確な範囲がわからない場合でも、状態サイズに対する制御が少なくなります。例えば、私たちの場合、4つの値のうち2つは上限/下限がありません。これにより、無限の状態数が発生する可能性があります。
-
-この例では、2番目のアプローチを使用します。後で気づくかもしれませんが、定義されていない上限/下限にもかかわらず、これらの値は特定の有限の範囲外に出ることはめったにありません。そのため、極端な値を持つ状態は非常にまれです。
-
-1. 次の関数は、モデルからの観察を取り、4つの整数値のタプルを生成します:(コードブロック6)
-
- ```python
- def discretize(x):
- return tuple((x/np.array([0.25, 0.25, 0.01, 0.1])).astype(np.int))
- ```
-
-1. もう1つのビンを使用した離散化方法も探索しましょう:(コードブロック7)
-
- ```python
- def create_bins(i,num):
- return np.arange(num+1)*(i[1]-i[0])/num+i[0]
-
- print("Sample bins for interval (-5,5) with 10 bins\n",create_bins((-5,5),10))
-
- ints = [(-5,5),(-2,2),(-0.5,0.5),(-2,2)] # intervals of values for each parameter
- nbins = [20,20,10,10] # number of bins for each parameter
- bins = [create_bins(ints[i],nbins[i]) for i in range(4)]
-
- def discretize_bins(x):
- return tuple(np.digitize(x[i],bins[i]) for i in range(4))
- ```
-
-1. 次に、短いシミュレーションを実行し、それらの離散環境値を観察しましょう。`discretize` and `discretize_bins`の両方を試してみて、違いがあるかどうかを確認してください。
-
- ✅ discretize_binsはビン番号を返しますが、これは0ベースです。したがって、入力変数の値が0に近い場合、範囲の中央(10)の数を返します。discretizeでは、出力値の範囲を気にしなかったため、値はシフトされず、0は0に対応します。(コードブロック8)
-
- ```python
- env.reset()
-
- done = False
- while not done:
- #env.render()
- obs, rew, done, info = env.step(env.action_space.sample())
- #print(discretize_bins(obs))
- print(discretize(obs))
- env.close()
- ```
-
- ✅ 環境が実行される様子を見たい場合は、env.renderで始まる行のコメントを外してください。そうでない場合は、バックグラウンドで実行することができ、これにより高速化されます。この「見えない」実行をQラーニングプロセス中に使用します。
-
-## Q-テーブルの構造
-
-前回のレッスンでは、状態は0から8までの単純な数字のペアであり、そのためQ-テーブルを8x8x2の形状のnumpyテンソルで表現するのが便利でした。ビンの離散化を使用する場合、状態ベクトルのサイズもわかっているため、同じアプローチを使用し、観察スペースの各パラメータに使用するビンの数に対応する形状の配列(20x20x10x10x2)で状態を表現できます。
-
-しかし、観察スペースの正確な次元がわからない場合もあります。`discretize`関数の場合、元の値の一部が制限されていないため、状態が特定の制限内に収まることを保証できません。そのため、Q-テーブルを辞書で表現するという異なるアプローチを使用します。
-
-1. 辞書キーとして*(state,action)*のペアを使用し、値はQ-テーブルのエントリ値に対応します。(コードブロック9)
-
- ```python
- Q = {}
- actions = (0,1)
-
- def qvalues(state):
- return [Q.get((state,a),0) for a in actions]
- ```
-
- ここでは、特定の状態に対するすべての可能なアクションに対応するQ-テーブル値のリストを返す`qvalues()`関数も定義します。Q-テーブルにエントリが存在しない場合、デフォルトで0を返します。
-
-## Qラーニングを始めましょう
-
-さて、ピーターにバランスを取ることを教える準備ができました!
-
-1. まず、いくつかのハイパーパラメータを設定しましょう:(コードブロック10)
-
- ```python
- # hyperparameters
- alpha = 0.3
- gamma = 0.9
- epsilon = 0.90
- ```
-
- ここで、`alpha` is the **learning rate** that defines to which extent we should adjust the current values of Q-Table at each step. In the previous lesson we started with 1, and then decreased `alpha` to lower values during training. In this example we will keep it constant just for simplicity, and you can experiment with adjusting `alpha` values later.
-
- `gamma` is the **discount factor** that shows to which extent we should prioritize future reward over current reward.
-
- `epsilon` is the **exploration/exploitation factor** that determines whether we should prefer exploration to exploitation or vice versa. In our algorithm, we will in `epsilon` percent of the cases select the next action according to Q-Table values, and in the remaining number of cases we will execute a random action. This will allow us to explore areas of the search space that we have never seen before.
-
- ✅ In terms of balancing - choosing random action (exploration) would act as a random punch in the wrong direction, and the pole would have to learn how to recover the balance from those "mistakes"
-
-### Improve the algorithm
-
-We can also make two improvements to our algorithm from the previous lesson:
-
-- **Calculate average cumulative reward**, over a number of simulations. We will print the progress each 5000 iterations, and we will average out our cumulative reward over that period of time. It means that if we get more than 195 point - we can consider the problem solved, with even higher quality than required.
-
-- **Calculate maximum average cumulative result**, `Qmax`, and we will store the Q-Table corresponding to that result. When you run the training you will notice that sometimes the average cumulative result starts to drop, and we want to keep the values of Q-Table that correspond to the best model observed during training.
-
-1. Collect all cumulative rewards at each simulation at `rewards`ベクトルに収集しました。これを後でプロットするために使用します。(コードブロック11)
-
- ```python
- def probs(v,eps=1e-4):
- v = v-v.min()+eps
- v = v/v.sum()
- return v
-
- Qmax = 0
- cum_rewards = []
- rewards = []
- for epoch in range(100000):
- obs = env.reset()
- done = False
- cum_reward=0
- # == do the simulation ==
- while not done:
- s = discretize(obs)
- if random.random()
-
-이는 어느 정도 상관 관계가 있음을 시사하며, `Month` and `Price`, or between `DayOfYear` and `Price`. Here is the scatter plot that shows the latter relationship:
-
-
-
-Let's see if there is a correlation using the `corr` 함수를 사용하여 상관 관계를 확인해 볼 수 있습니다:
-
-```python
-print(new_pumpkins['Month'].corr(new_pumpkins['Price']))
-print(new_pumpkins['DayOfYear'].corr(new_pumpkins['Price']))
-```
-
-상관 관계는 -0.15로 상당히 작아 보입니다. `Month` and -0.17 by the `DayOfMonth`, but there could be another important relationship. It looks like there are different clusters of prices corresponding to different pumpkin varieties. To confirm this hypothesis, let's plot each pumpkin category using a different color. By passing an `ax` parameter to the `scatter` 플로팅 함수를 사용하여 모든 포인트를 동일한 그래프에 플로팅할 수 있습니다:
-
-```python
-ax=None
-colors = ['red','blue','green','yellow']
-for i,var in enumerate(new_pumpkins['Variety'].unique()):
- df = new_pumpkins[new_pumpkins['Variety']==var]
- ax = df.plot.scatter('DayOfYear','Price',ax=ax,c=colors[i],label=var)
-```
-
-
-
-우리의 조사에 따르면 품종이 실제 판매 날짜보다 전체 가격에 더 큰 영향을 미치는 것으로 보입니다. 이는 막대 그래프로 확인할 수 있습니다:
-
-```python
-new_pumpkins.groupby('Variety')['Price'].mean().plot(kind='bar')
-```
-
-
-
-잠시 동안 '파이 타입'이라는 한 가지 호박 품종에만 집중하여 날짜가 가격에 미치는 영향을 확인해 봅시다:
-
-```python
-pie_pumpkins = new_pumpkins[new_pumpkins['Variety']=='PIE TYPE']
-pie_pumpkins.plot.scatter('DayOfYear','Price')
-```
-
-
-이제 `Price` and `DayOfYear` using `corr` function, we will get something like `-0.27` 사이의 상관 관계를 계산하면 예측 모델을 훈련시키는 것이 의미가 있음을 알 수 있습니다.
-
-> 선형 회귀 모델을 훈련시키기 전에 데이터가 깨끗한지 확인하는 것이 중요합니다. 선형 회귀는 누락된 값과 잘 작동하지 않으므로 모든 빈 셀을 제거하는 것이 좋습니다:
-
-```python
-pie_pumpkins.dropna(inplace=True)
-pie_pumpkins.info()
-```
-
-다른 접근 방식은 해당 열의 평균 값으로 빈 값을 채우는 것입니다.
-
-## 단순 선형 회귀
-
-[](https://youtu.be/e4c_UP2fSjg "초보자를 위한 머신러닝 - Scikit-learn을 사용한 선형 및 다항 회귀")
-
-> 🎥 위 이미지를 클릭하여 선형 및 다항 회귀에 대한 짧은 비디오 개요를 확인하세요.
-
-우리의 선형 회귀 모델을 훈련시키기 위해 **Scikit-learn** 라이브러리를 사용할 것입니다.
-
-```python
-from sklearn.linear_model import LinearRegression
-from sklearn.metrics import mean_squared_error
-from sklearn.model_selection import train_test_split
-```
-
-먼저 입력 값(특징)과 예상 출력(레이블)을 별도의 numpy 배열로 분리합니다:
-
-```python
-X = pie_pumpkins['DayOfYear'].to_numpy().reshape(-1,1)
-y = pie_pumpkins['Price']
-```
-
-> 선형 회귀 패키지가 입력 데이터를 올바르게 이해할 수 있도록 입력 데이터에 `reshape`를 수행해야 했습니다. 선형 회귀는 각 배열 행이 입력 특징 벡터에 해당하는 2D 배열을 입력으로 기대합니다. 우리의 경우, 하나의 입력만 있기 때문에 N×1 형상의 배열이 필요합니다. 여기서 N은 데이터셋 크기입니다.
-
-그런 다음 데이터를 훈련 및 테스트 데이터셋으로 분할하여 훈련 후 모델을 검증할 수 있습니다:
-
-```python
-X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=0)
-```
-
-마지막으로 실제 선형 회귀 모델을 훈련시키는 것은 단 두 줄의 코드로 가능합니다. `LinearRegression` object, and fit it to our data using the `fit` 메서드를 정의합니다:
-
-```python
-lin_reg = LinearRegression()
-lin_reg.fit(X_train,y_train)
-```
-
-`LinearRegression` object after `fit`-ting contains all the coefficients of the regression, which can be accessed using `.coef_` property. In our case, there is just one coefficient, which should be around `-0.017`. It means that prices seem to drop a bit with time, but not too much, around 2 cents per day. We can also access the intersection point of the regression with Y-axis using `lin_reg.intercept_` - it will be around `21`은 연초의 가격을 나타냅니다.
-
-모델의 정확성을 확인하려면 테스트 데이터셋에서 가격을 예측한 다음, 예측 값과 예상 값이 얼마나 가까운지 측정할 수 있습니다. 이는 모든 예상 값과 예측 값의 제곱 차이의 평균인 평균 제곱 오차(MSE) 메트릭을 사용하여 수행할 수 있습니다.
-
-```python
-pred = lin_reg.predict(X_test)
-
-mse = np.sqrt(mean_squared_error(y_test,pred))
-print(f'Mean error: {mse:3.3} ({mse/np.mean(pred)*100:3.3}%)')
-```
-
-우리의 오류는 약 2 포인트로, 약 17%입니다. 그다지 좋지 않습니다. 모델 품질의 또 다른 지표는 **결정 계수**로, 다음과 같이 얻을 수 있습니다:
-
-```python
-score = lin_reg.score(X_train,y_train)
-print('Model determination: ', score)
-```
-값이 0이면 모델이 입력 데이터를 고려하지 않고 *최악의 선형 예측기*로 작동하며, 이는 단순히 결과의 평균 값입니다. 값이 1이면 모든 예상 출력을 완벽하게 예측할 수 있음을 의미합니다. 우리의 경우 결정 계수는 약 0.06으로 상당히 낮습니다.
-
-테스트 데이터와 회귀선을 함께 플로팅하여 우리의 경우 회귀가 어떻게 작동하는지 더 잘 볼 수 있습니다:
-
-```python
-plt.scatter(X_test,y_test)
-plt.plot(X_test,pred)
-```
-
-
-
-## 다항 회귀
-
-다른 유형의 선형 회귀는 다항 회귀입니다. 변수 간에 선형 관계가 있을 때가 있지만 - 호박의 부피가 클수록 가격이 높아지는 경우 - 때로는 이러한 관계를 평면이나 직선으로 그릴 수 없습니다.
-
-✅ [다항 회귀를 사용할 수 있는 데이터의 더 많은 예시](https://online.stat.psu.edu/stat501/lesson/9/9.8)를 확인해 보세요.
-
-날짜와 가격 간의 관계를 다시 한 번 살펴보세요. 이 산점도가 반드시 직선으로 분석되어야 할 것처럼 보이나요? 가격이 변동할 수 있지 않나요? 이 경우 다항 회귀를 시도해 볼 수 있습니다.
-
-✅ 다항식은 하나 이상의 변수와 계수로 구성될 수 있는 수학적 표현입니다.
-
-다항 회귀는 비선형 데이터를 더 잘 맞추기 위해 곡선을 만듭니다. 우리의 경우, 입력 데이터에 제곱 `DayOfYear` 변수를 포함하면, 연도의 특정 시점에 최소값을 가지는 포물선 곡선으로 데이터를 맞출 수 있습니다.
-
-Scikit-learn에는 데이터 처리의 다양한 단계를 함께 결합할 수 있는 유용한 [파이프라인 API](https://scikit-learn.org/stable/modules/generated/sklearn.pipeline.make_pipeline.html?highlight=pipeline#sklearn.pipeline.make_pipeline)가 포함되어 있습니다. **파이프라인**은 **추정기**의 체인입니다. 우리의 경우, 모델에 다항 특징을 먼저 추가하고, 그 다음 회귀를 훈련시키는 파이프라인을 만들 것입니다:
-
-```python
-from sklearn.preprocessing import PolynomialFeatures
-from sklearn.pipeline import make_pipeline
-
-pipeline = make_pipeline(PolynomialFeatures(2), LinearRegression())
-
-pipeline.fit(X_train,y_train)
-```
-
-`PolynomialFeatures(2)` means that we will include all second-degree polynomials from the input data. In our case it will just mean `DayOfYear`2, but given two input variables X and Y, this will add X2, XY and Y2. We may also use higher degree polynomials if we want.
-
-Pipelines can be used in the same manner as the original `LinearRegression` object, i.e. we can `fit` the pipeline, and then use `predict` to get the prediction results. Here is the graph showing test data, and the approximation curve:
-
-
-
-Using Polynomial Regression, we can get slightly lower MSE and higher determination, but not significantly. We need to take into account other features!
-
-> You can see that the minimal pumpkin prices are observed somewhere around Halloween. How can you explain this?
-
-🎃 Congratulations, you just created a model that can help predict the price of pie pumpkins. You can probably repeat the same procedure for all pumpkin types, but that would be tedious. Let's learn now how to take pumpkin variety into account in our model!
-
-## Categorical Features
-
-In the ideal world, we want to be able to predict prices for different pumpkin varieties using the same model. However, the `Variety` column is somewhat different from columns like `Month`, because it contains non-numeric values. Such columns are called **categorical**.
-
-[](https://youtu.be/DYGliioIAE0 "ML for beginners - Categorical Feature Predictions with Linear Regression")
-
-> 🎥 Click the image above for a short video overview of using categorical features.
-
-Here you can see how average price depends on variety:
-
-
-
-To take variety into account, we first need to convert it to numeric form, or **encode** it. There are several way we can do it:
-
-* Simple **numeric encoding** will build a table of different varieties, and then replace the variety name by an index in that table. This is not the best idea for linear regression, because linear regression takes the actual numeric value of the index, and adds it to the result, multiplying by some coefficient. In our case, the relationship between the index number and the price is clearly non-linear, even if we make sure that indices are ordered in some specific way.
-* **One-hot encoding** will replace the `Variety` column by 4 different columns, one for each variety. Each column will contain `1` if the corresponding row is of a given variety, and `0` 그렇지 않으면. 이는 선형 회귀에서 네 개의 계수가 있으며, 각 호박 품종에 대해 하나씩, 해당 품종의 "시작 가격" (또는 "추가 가격")을 담당합니다.
-
-다음 코드는 품종을 원-핫 인코딩하는 방법을 보여줍니다:
-
-```python
-pd.get_dummies(new_pumpkins['Variety'])
-```
-
- ID | FAIRYTALE | MINIATURE | MIXED HEIRLOOM VARIETIES | PIE TYPE
-----|-----------|-----------|--------------------------|----------
-70 | 0 | 0 | 0 | 1
-71 | 0 | 0 | 0 | 1
-... | ... | ... | ... | ...
-1738 | 0 | 1 | 0 | 0
-1739 | 0 | 1 | 0 | 0
-1740 | 0 | 1 | 0 | 0
-1741 | 0 | 1 | 0 | 0
-1742 | 0 | 1 | 0 | 0
-
-원-핫 인코딩된 품종을 사용하여 선형 회귀를 훈련시키려면 `X` and `y` 데이터를 올바르게 초기화하기만 하면 됩니다:
-
-```python
-X = pd.get_dummies(new_pumpkins['Variety'])
-y = new_pumpkins['Price']
-```
-
-나머지 코드는 선형 회귀를 훈련시키는 데 사용한 것과 동일합니다. 시도해 보면 평균 제곱 오차는 비슷하지만 결정 계수는 훨씬 높아집니다 (~77%). 더 정확한 예측을 위해서는 `Month` or `DayOfYear`. To get one large array of features, we can use `join`과 같은 숫자 특징뿐만 아니라 더 많은 범주형 특징을 고려할 수 있습니다:
-
-```python
-X = pd.get_dummies(new_pumpkins['Variety']) \
- .join(new_pumpkins['Month']) \
- .join(pd.get_dummies(new_pumpkins['City'])) \
- .join(pd.get_dummies(new_pumpkins['Package']))
-y = new_pumpkins['Price']
-```
-
-여기에서는 `City` and `Package` 유형도 고려하여 MSE 2.84 (10%)와 결정 계수 0.94를 얻습니다!
-
-## 모든 것을 종합하여
-
-최고의 모델을 만들기 위해 위의 예제에서 사용한 결합된 (원-핫 인코딩된 범주형 + 숫자) 데이터를 사용하여 다항 회귀와 결합할 수 있습니다. 다음은 편의를 위해 전체 코드입니다:
-
-```python
-# set up training data
-X = pd.get_dummies(new_pumpkins['Variety']) \
- .join(new_pumpkins['Month']) \
- .join(pd.get_dummies(new_pumpkins['City'])) \
- .join(pd.get_dummies(new_pumpkins['Package']))
-y = new_pumpkins['Price']
-
-# make train-test split
-X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=0)
-
-# setup and train the pipeline
-pipeline = make_pipeline(PolynomialFeatures(2), LinearRegression())
-pipeline.fit(X_train,y_train)
-
-# predict results for test data
-pred = pipeline.predict(X_test)
-
-# calculate MSE and determination
-mse = np.sqrt(mean_squared_error(y_test,pred))
-print(f'Mean error: {mse:3.3} ({mse/np.mean(pred)*100:3.3}%)')
-
-score = pipeline.score(X_train,y_train)
-print('Model determination: ', score)
-```
-
-이것은 거의 97%의 최고의 결정 계수를 제공하며, MSE=2.23 (~8% 예측 오류)을 제공합니다.
-
-| 모델 | MSE | 결정 계수 |
-|-------|-----|---------------|
-| `DayOfYear` Linear | 2.77 (17.2%) | 0.07 |
-| `DayOfYear` Polynomial | 2.73 (17.0%) | 0.08 |
-| `Variety` 선형 | 5.24 (19.7%) | 0.77 |
-| 모든 특징 선형 | 2.84 (10.5%) | 0.94 |
-| 모든 특징 다항 | 2.23 (8.25%) | 0.97 |
-
-🏆 잘하셨습니다! 한 강의에서 네 가지 회귀 모델을 만들었으며, 모델 품질을 97%까지 향상시켰습니다. 회귀에 대한 마지막 섹션에서는 범주를 결정하기 위해 로지스틱 회귀에 대해 배울 것입니다.
-
----
-## 🚀도전
-
-이 노트북에서 여러 다른 변수를 테스트하여 상관 관계가 모델 정확도와 어떻게 대응하는지 확인하세요.
-
-## [강의 후 퀴즈](https://gray-sand-07a10f403.1.azurestaticapps.net/quiz/14/)
-
-## 복습 및 자습
-
-이번 강의에서는 선형 회귀에 대해 배웠습니다. 다른 중요한 회귀 유형도 있습니다. Stepwise, Ridge, Lasso 및 Elasticnet 기술에 대해 읽어보세요. 더 배우기 위해 좋은 과정은 [스탠포드 통계학 학습 과정](https://online.stanford.edu/courses/sohs-ystatslearning-statistical-learning)입니다.
-
-## 과제
-
-[모델 구축](assignment.md)
-
-**면책 조항**:
-이 문서는 기계 기반 AI 번역 서비스를 사용하여 번역되었습니다. 정확성을 위해 노력하지만, 자동 번역에는 오류나 부정확성이 있을 수 있음을 유의하시기 바랍니다. 원어로 작성된 원본 문서를 권위 있는 자료로 간주해야 합니다. 중요한 정보의 경우, 전문적인 인간 번역을 권장합니다. 이 번역 사용으로 인해 발생하는 오해나 잘못된 해석에 대해 우리는 책임을 지지 않습니다.
\ No newline at end of file
diff --git a/translations/ko/2-Regression/3-Linear/assignment.md b/translations/ko/2-Regression/3-Linear/assignment.md
deleted file mode 100644
index d18b9b92c..000000000
--- a/translations/ko/2-Regression/3-Linear/assignment.md
+++ /dev/null
@@ -1,14 +0,0 @@
-# 회귀 모델 만들기
-
-## 지침
-
-이 수업에서는 선형 회귀와 다항 회귀를 사용하여 모델을 구축하는 방법을 배웠습니다. 이 지식을 사용하여 데이터셋을 찾거나 Scikit-learn의 내장된 세트를 사용하여 새로운 모델을 구축하세요. 왜 해당 기법을 선택했는지 노트북에 설명하고, 모델의 정확성을 보여주세요. 만약 정확하지 않다면, 그 이유를 설명하세요.
-
-## 평가 기준
-
-| 기준 | 모범적 | 적절함 | 개선 필요 |
-| ------- | --------------------------------------------------------- | -------------------------- | -------------------------------- |
-| | 완벽하게 문서화된 솔루션을 포함한 완전한 노트북을 제시함 | 솔루션이 불완전함 | 솔루션에 결함이나 버그가 있음 |
-
-**면책 조항**:
-이 문서는 기계 기반 AI 번역 서비스를 사용하여 번역되었습니다. 정확성을 위해 노력하지만, 자동 번역에는 오류나 부정확성이 있을 수 있습니다. 원어로 작성된 원본 문서를 권위 있는 자료로 간주해야 합니다. 중요한 정보의 경우, 전문적인 인간 번역을 권장합니다. 이 번역 사용으로 인해 발생하는 오해나 오역에 대해 당사는 책임을 지지 않습니다.
\ No newline at end of file
diff --git a/translations/ko/2-Regression/3-Linear/solution/Julia/README.md b/translations/ko/2-Regression/3-Linear/solution/Julia/README.md
deleted file mode 100644
index 545fb34d1..000000000
--- a/translations/ko/2-Regression/3-Linear/solution/Julia/README.md
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-**면책 조항**:
-이 문서는 기계 기반 AI 번역 서비스를 사용하여 번역되었습니다. 우리는 정확성을 위해 노력하지만, 자동 번역에는 오류나 부정확성이 포함될 수 있습니다. 원본 문서는 해당 언어로 작성된 문서를 권위 있는 출처로 간주해야 합니다. 중요한 정보의 경우, 전문적인 인간 번역을 권장합니다. 이 번역을 사용함으로 인해 발생하는 오해나 오역에 대해 당사는 책임을 지지 않습니다.
\ No newline at end of file
diff --git a/translations/ko/2-Regression/4-Logistic/README.md b/translations/ko/2-Regression/4-Logistic/README.md
deleted file mode 100644
index 23e4dd65d..000000000
--- a/translations/ko/2-Regression/4-Logistic/README.md
+++ /dev/null
@@ -1,370 +0,0 @@
-# 카테고리 예측을 위한 로지스틱 회귀
-
-
-
-## [강의 전 퀴즈](https://gray-sand-07a10f403.1.azurestaticapps.net/quiz/15/)
-
-> ### [이 강의는 R에서도 사용할 수 있습니다!](../../../../2-Regression/4-Logistic/solution/R/lesson_4.html)
-
-## 소개
-
-이제 고전적인 머신러닝 기법 중 하나인 회귀에 대한 마지막 강의로, 로지스틱 회귀를 살펴보겠습니다. 이 기법을 사용하여 이진 카테고리를 예측하는 패턴을 발견할 수 있습니다. 이 사탕이 초콜릿인가 아닌가? 이 질병이 전염성이 있는가 없는가? 이 고객이 이 제품을 선택할 것인가 아닌가?
-
-이 강의에서는 다음을 배우게 됩니다:
-
-- 데이터 시각화를 위한 새로운 라이브러리
-- 로지스틱 회귀 기법
-
-✅ 이 [학습 모듈](https://docs.microsoft.com/learn/modules/train-evaluate-classification-models?WT.mc_id=academic-77952-leestott)을 통해 이 회귀 기법에 대한 이해를 심화하세요.
-
-## 전제 조건
-
-호박 데이터를 다루면서, 이제 우리가 작업할 수 있는 이진 카테고리 하나가 있다는 것을 알게 되었습니다: `Color`.
-
-이제 몇 가지 변수를 통해 _주어진 호박의 색상이 무엇일지_ (주황색 🎃 또는 흰색 👻) 예측하는 로지스틱 회귀 모델을 만들어 보겠습니다.
-
-> 왜 회귀에 관한 강의에서 이진 분류에 대해 이야기하고 있을까요? 단지 언어적 편의를 위해서입니다. 로지스틱 회귀는 [실제로는 분류 방법](https://scikit-learn.org/stable/modules/linear_model.html#logistic-regression)이지만, 선형 기반입니다. 다음 강의 그룹에서 데이터를 분류하는 다른 방법에 대해 배워보세요.
-
-## 질문 정의하기
-
-우리의 목적을 위해, 이를 '흰색' 또는 '흰색이 아님'으로 표현하겠습니다. 데이터셋에 '줄무늬' 카테고리도 있지만, 인스턴스가 거의 없어서 사용하지 않겠습니다. 어쨌든 데이터셋에서 null 값을 제거하면 사라집니다.
-
-> 🎃 재미있는 사실, 우리는 때때로 흰색 호박을 '유령' 호박이라고 부릅니다. 조각하기가 쉽지 않아서 주황색 호박만큼 인기가 많지 않지만, 멋지게 생겼습니다! 그래서 질문을 '유령' 또는 '유령이 아님'으로 다시 표현할 수도 있습니다. 👻
-
-## 로지스틱 회귀에 대하여
-
-로지스틱 회귀는 이전에 배운 선형 회귀와 몇 가지 중요한 면에서 다릅니다.
-
-[](https://youtu.be/KpeCT6nEpBY "초보자를 위한 머신러닝 - 로지스틱 회귀 이해하기")
-
-> 🎥 위 이미지를 클릭하여 로지스틱 회귀에 대한 짧은 비디오 개요를 확인하세요.
-
-### 이진 분류
-
-로지스틱 회귀는 선형 회귀와 동일한 기능을 제공하지 않습니다. 전자는 이진 카테고리("흰색 또는 흰색이 아님")에 대한 예측을 제공하는 반면, 후자는 예를 들어 호박의 출처와 수확 시기를 기준으로 _가격이 얼마나 오를지_와 같은 연속적인 값을 예측할 수 있습니다.
-
-
-> 인포그래픽 by [Dasani Madipalli](https://twitter.com/dasani_decoded)
-
-### 다른 분류들
-
-다른 유형의 로지스틱 회귀도 있습니다. 다항 로지스틱 회귀와 서열 로지스틱 회귀가 있습니다:
-
-- **다항 로지스틱 회귀**, 여러 카테고리가 있는 경우 - "주황색, 흰색, 줄무늬".
-- **서열 로지스틱 회귀**, 순서가 있는 카테고리로, 결과를 논리적으로 정렬해야 하는 경우 유용합니다. 예를 들어, 호박을 크기(미니, 소, 중, 대, 특대, 초대형)로 정렬하는 경우.
-
-
-
-### 변수들이 반드시 상관관계가 있을 필요는 없음
-
-선형 회귀가 상관관계가 더 높은 변수들과 더 잘 작동했던 것을 기억하시나요? 로지스틱 회귀는 반대입니다 - 변수들이 일치할 필요가 없습니다. 이는 상관관계가 약한 이 데이터에 적합합니다.
-
-### 많은 깨끗한 데이터가 필요함
-
-로지스틱 회귀는 더 많은 데이터를 사용할수록 더 정확한 결과를 제공합니다. 우리의 작은 데이터셋은 이 작업에 최적화되어 있지 않으므로 유의하세요.
-
-[](https://youtu.be/B2X4H9vcXTs "초보자를 위한 머신러닝 - 로지스틱 회귀를 위한 데이터 분석 및 준비")
-
-> 🎥 위 이미지를 클릭하여 로지스틱 회귀를 위한 데이터 준비에 대한 짧은 비디오 개요를 확인하세요.
-
-✅ 로지스틱 회귀에 적합한 데이터 유형을 생각해 보세요.
-
-## 연습 - 데이터 정리하기
-
-먼저 데이터를 조금 정리하고, null 값을 제거하고 일부 열만 선택합니다:
-
-1. 다음 코드를 추가하세요:
-
- ```python
-
- columns_to_select = ['City Name','Package','Variety', 'Origin','Item Size', 'Color']
- pumpkins = full_pumpkins.loc[:, columns_to_select]
-
- pumpkins.dropna(inplace=True)
- ```
-
- 새로운 데이터프레임을 항상 확인할 수 있습니다:
-
- ```python
- pumpkins.info
- ```
-
-### 시각화 - 카테고리 플롯
-
-이제 [시작 노트북](../../../../2-Regression/4-Logistic/notebook.ipynb)을 다시 열고 호박 데이터를 불러와서 몇 가지 변수를 포함하는 데이터셋을 유지하도록 정리했습니다. 이번에는 다른 라이브러리를 사용하여 데이터프레임을 시각화해 봅시다: [Seaborn](https://seaborn.pydata.org/index.html), 이는 이전에 사용한 Matplotlib 위에 구축되었습니다.
-
-Seaborn은 데이터를 시각화하는 멋진 방법을 제공합니다. 예를 들어, 각 `Variety`와 `Color`의 데이터 분포를 카테고리 플롯으로 비교할 수 있습니다.
-
-1. `catplot` function, using our pumpkin data `pumpkins`를 사용하여 각 호박 카테고리(주황색 또는 흰색)에 대한 색상 매핑을 지정하여 플롯을 만드세요:
-
- ```python
- import seaborn as sns
-
- palette = {
- 'ORANGE': 'orange',
- 'WHITE': 'wheat',
- }
-
- sns.catplot(
- data=pumpkins, y="Variety", hue="Color", kind="count",
- palette=palette,
- )
- ```
-
- 
-
- 데이터를 관찰하여 Color 데이터가 Variety와 어떻게 관련되는지 확인할 수 있습니다.
-
- ✅ 이 카테고리 플롯을 통해 어떤 흥미로운 탐색을 상상할 수 있습니까?
-
-### 데이터 전처리: 특성 및 라벨 인코딩
-호박 데이터셋의 모든 열은 문자열 값을 포함합니다. 카테고리 데이터를 다루는 것은 사람에게는 직관적이지만 기계에게는 그렇지 않습니다. 머신러닝 알고리즘은 숫자와 잘 작동합니다. 따라서 인코딩은 데이터 전처리 단계에서 매우 중요한 단계입니다. 이는 카테고리 데이터를 숫자 데이터로 변환하여 정보를 잃지 않도록 합니다. 좋은 인코딩은 좋은 모델을 구축하는 데 도움이 됩니다.
-
-특성 인코딩에는 두 가지 주요 유형의 인코더가 있습니다:
-
-1. 순서형 인코더: 이는 순서형 변수에 적합합니다. 순서형 변수는 데이터가 논리적 순서를 따르는 카테고리 변수입니다. 예를 들어, 데이터셋의 `Item Size` 열입니다. 각 카테고리가 열의 순서에 따라 숫자로 표현되도록 매핑을 만듭니다.
-
- ```python
- from sklearn.preprocessing import OrdinalEncoder
-
- item_size_categories = [['sml', 'med', 'med-lge', 'lge', 'xlge', 'jbo', 'exjbo']]
- ordinal_features = ['Item Size']
- ordinal_encoder = OrdinalEncoder(categories=item_size_categories)
- ```
-
-2. 카테고리 인코더: 이는 명목 변수에 적합합니다. 명목 변수는 데이터가 논리적 순서를 따르지 않는 카테고리 변수입니다. 데이터셋에서 `Item Size`를 제외한 모든 특성입니다. 이는 원-핫 인코딩으로, 각 카테고리가 이진 열로 표현됩니다: 인코딩된 변수는 호박이 해당 Variety에 속하면 1, 그렇지 않으면 0입니다.
-
- ```python
- from sklearn.preprocessing import OneHotEncoder
-
- categorical_features = ['City Name', 'Package', 'Variety', 'Origin']
- categorical_encoder = OneHotEncoder(sparse_output=False)
- ```
-그런 다음, `ColumnTransformer`를 사용하여 여러 인코더를 하나의 단계로 결합하고 적절한 열에 적용합니다.
-
-```python
- from sklearn.compose import ColumnTransformer
-
- ct = ColumnTransformer(transformers=[
- ('ord', ordinal_encoder, ordinal_features),
- ('cat', categorical_encoder, categorical_features)
- ])
-
- ct.set_output(transform='pandas')
- encoded_features = ct.fit_transform(pumpkins)
-```
-한편, 라벨을 인코딩하기 위해, scikit-learn의 `LabelEncoder` 클래스를 사용합니다. 이는 라벨을 0에서 n_classes-1(여기서는 0과 1) 사이의 값만 포함하도록 정규화하는 유틸리티 클래스입니다.
-
-```python
- from sklearn.preprocessing import LabelEncoder
-
- label_encoder = LabelEncoder()
- encoded_label = label_encoder.fit_transform(pumpkins['Color'])
-```
-특성과 라벨을 인코딩한 후, 이를 새로운 데이터프레임 `encoded_pumpkins`에 병합할 수 있습니다.
-
-```python
- encoded_pumpkins = encoded_features.assign(Color=encoded_label)
-```
-✅ `Item Size` column?
-
-### Analyse relationships between variables
-
-Now that we have pre-processed our data, we can analyse the relationships between the features and the label to grasp an idea of how well the model will be able to predict the label given the features.
-The best way to perform this kind of analysis is plotting the data. We'll be using again the Seaborn `catplot` function, to visualize the relationships between `Item Size`, `Variety`와 `Color`의 카테고리 플롯에 대해 순서형 인코더를 사용하는 장점은 무엇입니까? 데이터를 더 잘 플롯하기 위해 인코딩된 `Item Size` column and the unencoded `Variety` 열을 사용할 것입니다.
-
-```python
- palette = {
- 'ORANGE': 'orange',
- 'WHITE': 'wheat',
- }
- pumpkins['Item Size'] = encoded_pumpkins['ord__Item Size']
-
- g = sns.catplot(
- data=pumpkins,
- x="Item Size", y="Color", row='Variety',
- kind="box", orient="h",
- sharex=False, margin_titles=True,
- height=1.8, aspect=4, palette=palette,
- )
- g.set(xlabel="Item Size", ylabel="").set(xlim=(0,6))
- g.set_titles(row_template="{row_name}")
-```
-
-
-### 스웜 플롯 사용하기
-
-Color는 이진 카테고리(흰색 또는 흰색이 아님)이므로, 시각화를 위해 '특화된 접근 방식'이 필요합니다. 이 카테고리와 다른 변수 간의 관계를 시각화하는 다른 방법이 있습니다.
-
-Seaborn 플롯을 사용하여 변수를 나란히 시각화할 수 있습니다.
-
-1. 값의 분포를 보여주는 '스웜' 플롯을 시도해 보세요:
-
- ```python
- palette = {
- 0: 'orange',
- 1: 'wheat'
- }
- sns.swarmplot(x="Color", y="ord__Item Size", data=encoded_pumpkins, palette=palette)
- ```
-
- 
-
-**주의**: 위의 코드는 경고를 발생시킬 수 있습니다. Seaborn이 스웜 플롯에 많은 데이터 포인트를 나타내지 못하기 때문입니다. 가능한 해결책은 'size' 매개변수를 사용하여 마커의 크기를 줄이는 것입니다. 하지만 이는 플롯의 가독성에 영향을 미칠 수 있습니다.
-
-> **🧮 수학을 보여주세요**
->
-> 로지스틱 회귀는 [시그모이드 함수](https://wikipedia.org/wiki/Sigmoid_function)를 사용하여 '최대 가능성' 개념에 의존합니다. 플롯에서 '시그모이드 함수'는 'S' 모양처럼 보입니다. 이는 값을 0과 1 사이로 매핑합니다. 곡선은 '로지스틱 곡선'이라고도 합니다. 공식은 다음과 같습니다:
->
-> 
->
-> 여기서 시그모이드의 중간점은 x의 0 지점에 위치하고, L은 곡선의 최대 값이며, k는 곡선의 가파름을 나타냅니다. 함수의 결과가 0.5보다 크면 해당 라벨은 이진 선택의 '1'로 분류됩니다. 그렇지 않으면 '0'으로 분류됩니다.
-
-## 모델 구축하기
-
-이진 분류를 찾기 위한 모델을 구축하는 것은 Scikit-learn에서 놀랍도록 간단합니다.
-
-[](https://youtu.be/MmZS2otPrQ8 "초보자를 위한 머신러닝 - 데이터 분류를 위한 로지스틱 회귀")
-
-> 🎥 위 이미지를 클릭하여 선형 회귀 모델 구축에 대한 짧은 비디오 개요를 확인하세요.
-
-1. 분류 모델에 사용할 변수를 선택하고 `train_test_split()`을 호출하여 학습 및 테스트 세트를 분할하세요:
-
- ```python
- from sklearn.model_selection import train_test_split
-
- X = encoded_pumpkins[encoded_pumpkins.columns.difference(['Color'])]
- y = encoded_pumpkins['Color']
-
- X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=0)
-
- ```
-
-2. 이제 학습 데이터를 사용하여 `fit()`을 호출하여 모델을 학습시키고 결과를 출력할 수 있습니다:
-
- ```python
- from sklearn.metrics import f1_score, classification_report
- from sklearn.linear_model import LogisticRegression
-
- model = LogisticRegression()
- model.fit(X_train, y_train)
- predictions = model.predict(X_test)
-
- print(classification_report(y_test, predictions))
- print('Predicted labels: ', predictions)
- print('F1-score: ', f1_score(y_test, predictions))
- ```
-
- 모델의 점수를 확인하세요. 약 1000개의 데이터 행만 있는 것을 고려하면 나쁘지 않습니다:
-
- ```output
- precision recall f1-score support
-
- 0 0.94 0.98 0.96 166
- 1 0.85 0.67 0.75 33
-
- accuracy 0.92 199
- macro avg 0.89 0.82 0.85 199
- weighted avg 0.92 0.92 0.92 199
-
- Predicted labels: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0
- 0 0 0 0 0 1 0 1 0 0 1 0 0 0 0 0 1 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 1 1 0
- 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
- 0 0 0 1 0 0 0 0 0 0 0 0 1 1]
- F1-score: 0.7457627118644068
- ```
-
-## 혼동 행렬을 통한 더 나은 이해
-
-위에서 출력한 항목을 통해 점수 보고서를 얻을 수 있지만, [혼동 행렬](https://scikit-learn.org/stable/modules/model_evaluation.html#confusion-matrix)을 사용하여 모델의 성능을 더 쉽게 이해할 수 있습니다.
-
-> 🎓 '[혼동 행렬](https://wikipedia.org/wiki/Confusion_matrix)'(또는 '오류 행렬')은 모델의 실제 vs. 거짓 긍정 및 부정을 나타내어 예측의 정확성을 측정하는 테이블입니다.
-
-1. 혼동 행렬을 사용하려면 `confusion_matrix()`를 호출하세요:
-
- ```python
- from sklearn.metrics import confusion_matrix
- confusion_matrix(y_test, predictions)
- ```
-
- 모델의 혼동 행렬을 확인하세요:
-
- ```output
- array([[162, 4],
- [ 11, 22]])
- ```
-
-Scikit-learn에서 혼동 행렬의 행(축 0)은 실제 라벨이고 열(축 1)은 예측된 라벨입니다.
-
-| | 0 | 1 |
-| :---: | :---: | :---: |
-| 0 | TN | FP |
-| 1 | FN | TP |
-
-여기서 무슨 일이 일어나고 있는지 봅시다. 모델이 두 개의 이진 카테고리, '흰색'과 '흰색이 아님' 사이에서 호박을 분류하도록 요청받았다고 가정해 봅시다.
-
-- 모델이 호박을 흰색이 아니라고 예측하고 실제로도 '흰색이 아님' 카테고리에 속하면 이를 참 부정이라고 부릅니다. 이는 왼쪽 상단 숫자로 표시됩니다.
-- 모델이 호박을 흰색이라고 예측하고 실제로는 '흰색이 아님' 카테고리에 속하면 이를 거짓 부정이라고 부릅니다. 이는 왼쪽 하단 숫자로 표시됩니다.
-- 모델이 호박을 흰색이 아니라고 예측하고 실제로는 '흰색' 카테고리에 속하면 이를 거짓 긍정이라고 부릅니다. 이는 오른쪽 상단 숫자로 표시됩니다.
-- 모델이 호박을 흰색이라고 예측하고 실제로도 '흰색' 카테고리에 속하면 이를 참 긍정이라고 부릅니다. 이는 오른쪽 하단 숫자로 표시됩니다.
-
-참 긍정과 참 부정의 숫자가 많고 거짓 긍정과 거짓 부정의 숫자가 적을수록 모델이 더 잘 작동한다고 할 수 있습니다.
-
-혼동 행렬이 정확도와 재현율과 어떻게 관련이 있는지 봅시다. 위에서 출력된 분류 보고서는 정확도(0.85)와 재현율(0.67)을 보여줍니다.
-
-정확도 = tp / (tp + fp) = 22 / (22 + 4) = 0.8461538461538461
-
-재현율 = tp / (tp + fn) = 22 / (22 + 11) = 0.6666666666666666
-
-✅ Q: 혼동 행렬에 따르면 모델의 성능은 어땠나요? A: 나쁘지 않습니다. 참 부정의 숫자가 많지만 거짓 부정도 몇 개 있습니다.
-
-혼동 행렬의 TP/TN과 FP/FN 매핑을 통해 앞서 봤던 용어를 다시 살펴봅시다:
-
-🎓 정확도: TP/(TP + FP) 검색된 인스턴스 중 관련 인스턴스의 비율 (예: 잘 라벨된 라벨)
-
-🎓 재현율: TP/(TP + FN) 검색된 관련 인스턴스의 비율, 잘 라벨된지 여부와 관계없이
-
-🎓 f1-score: (2 * 정확도 * 재현율)/(정확도 + 재현율) 정확도와 재현율의 가중 평균, 최상은 1, 최악은 0
-
-🎓 지원: 검색된 각 라벨의 발생 수
-
-🎓 정확도: (TP + TN)/(TP + TN + FP + FN) 샘플에 대해 정확하게 예측된 라벨의 비율.
-
-🎓 매크로 평균: 라벨 불균형을 고려하지 않고 각 라벨에 대한 비가중 평균 메트릭 계산.
-
-🎓 가중 평균: 각 라벨에 대한 비율을 고려하여 라벨 불균형을 고려하여 지원에 따라 가중치를 부여한 평균 메트릭 계산.
-
-✅ 거짓 부정의 수를 줄이려면 어떤 메트릭을 주시해야 할지 생각해 보세요.
-
-## 이 모델의 ROC 곡선 시각화
-
-[](https://youtu.be/GApO575jTA0 "초보자를 위한 머신러닝 - ROC 곡선을 통한 로지스틱 회귀 성능 분석")
-
-> 🎥 위 이미지를 클릭하여 ROC 곡선에 대한 짧은 비디오 개요를 확인하세요.
-
-이제 'ROC' 곡선을 시각화해 봅시다:
-
-```python
-from sklearn.metrics import roc_curve, roc_auc_score
-import matplotlib
-import matplotlib.pyplot as plt
-%matplotlib inline
-
-y_scores = model.predict_proba(X_test)
-fpr, tpr, thresholds = roc_curve(y_test, y_scores[:,1])
-
-fig = plt.figure(figsize=(6, 6))
-plt.plot([0, 1], [0, 1], 'k--')
-plt.plot(fpr, tpr)
-plt.xlabel('False Positive Rate')
-plt.ylabel('True Positive Rate')
-plt.title('ROC Curve')
-plt.show()
-```
-
-Matplotlib을 사용하여 모델의 [수신 운영 특성](https://scikit-learn.org/stable/auto_examples/model_selection/plot_roc
-
-**면책 조항**:
-이 문서는 기계 기반 AI 번역 서비스를 사용하여 번역되었습니다. 정확성을 위해 노력하고 있지만 자동 번역에는 오류나 부정확성이 있을 수 있습니다. 원본 문서를 해당 언어로 작성된 상태에서 권위 있는 출처로 간주해야 합니다. 중요한 정보의 경우, 전문 인간 번역을 권장합니다. 이 번역 사용으로 인해 발생하는 오해나 오역에 대해 당사는 책임을 지지 않습니다.
\ No newline at end of file
diff --git a/translations/ko/2-Regression/4-Logistic/assignment.md b/translations/ko/2-Regression/4-Logistic/assignment.md
deleted file mode 100644
index 540d7ed49..000000000
--- a/translations/ko/2-Regression/4-Logistic/assignment.md
+++ /dev/null
@@ -1,14 +0,0 @@
-# 회귀 재시도
-
-## 지침
-
-강의에서 호박 데이터의 일부를 사용했습니다. 이제 원래 데이터를 다시 사용하여 모든 데이터를 정리하고 표준화하여 로지스틱 회귀 모델을 구축해 보세요.
-
-## 평가 기준
-
-| 기준 | 우수함 | 적절함 | 개선 필요 |
-| --------- | --------------------------------------------------------------------- | ----------------------------------------------------------- | -------------------------------------------------------- |
-| | 잘 설명되고 성능이 좋은 모델이 포함된 노트북을 제출함 | 최소한의 성능을 발휘하는 모델이 포함된 노트북을 제출함 | 성능이 떨어지는 모델이 포함된 노트북을 제출하거나 없음 |
-
-**면책 조항**:
-이 문서는 기계 기반 AI 번역 서비스를 사용하여 번역되었습니다. 정확성을 위해 노력하고 있지만, 자동 번역에는 오류나 부정확성이 포함될 수 있습니다. 원어로 작성된 원본 문서를 권위 있는 자료로 간주해야 합니다. 중요한 정보의 경우, 전문 인간 번역을 권장합니다. 이 번역 사용으로 인해 발생하는 오해나 오역에 대해 당사는 책임을 지지 않습니다.
\ No newline at end of file
diff --git a/translations/ko/2-Regression/4-Logistic/solution/Julia/README.md b/translations/ko/2-Regression/4-Logistic/solution/Julia/README.md
deleted file mode 100644
index d7e19ebfa..000000000
--- a/translations/ko/2-Regression/4-Logistic/solution/Julia/README.md
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-**면책 조항**:
-이 문서는 기계 기반 AI 번역 서비스를 사용하여 번역되었습니다. 정확성을 위해 노력하지만, 자동 번역에는 오류나 부정확한 내용이 포함될 수 있습니다. 원본 문서의 모국어 버전을 권위 있는 자료로 간주해야 합니다. 중요한 정보의 경우, 전문적인 인간 번역을 권장합니다. 이 번역의 사용으로 인해 발생하는 오해나 오역에 대해서는 책임을 지지 않습니다.
\ No newline at end of file
diff --git a/translations/ko/2-Regression/README.md b/translations/ko/2-Regression/README.md
deleted file mode 100644
index 15c6dd7f9..000000000
--- a/translations/ko/2-Regression/README.md
+++ /dev/null
@@ -1,43 +0,0 @@
-# 머신 러닝을 위한 회귀 모델
-## 지역 주제: 북미의 호박 가격을 위한 회귀 모델 🎃
-
-북미에서는 호박을 할로윈 때 무서운 얼굴로 조각하는 경우가 많습니다. 이 매력적인 채소에 대해 더 알아봅시다!
-
-
-> 사진 출처: Beth Teutschmann on Unsplash
-
-## 학습 내용
-
-[](https://youtu.be/5QnJtDad4iQ "Regression Introduction video - Click to Watch!")
-> 🎥 위 이미지를 클릭하면 이 강의의 간단한 소개 영상을 볼 수 있습니다
-
-이 섹션의 강의는 머신 러닝의 맥락에서 회귀의 유형을 다룹니다. 회귀 모델은 변수 간의 _관계_를 결정하는 데 도움을 줄 수 있습니다. 이 유형의 모델은 길이, 온도, 나이와 같은 값을 예측할 수 있으며, 데이터 포인트를 분석하면서 변수 간의 관계를 밝혀냅니다.
-
-이 시리즈의 강의에서는 선형 회귀와 로지스틱 회귀의 차이점과 어느 상황에서 어느 것을 선호해야 하는지 알아볼 것입니다.
-
-[](https://youtu.be/XA3OaoW86R8 "ML for beginners - Introduction to Regression models for Machine Learning")
-
-> 🎥 위 이미지를 클릭하면 회귀 모델을 소개하는 짧은 영상을 볼 수 있습니다.
-
-이 강의 그룹에서는 머신 러닝 작업을 시작하기 위한 설정 방법, 특히 데이터 과학자들이 주로 사용하는 노트북을 관리하기 위한 Visual Studio Code 설정 방법을 배웁니다. Scikit-learn이라는 머신 러닝 라이브러리를 발견하고, 이 장에서는 회귀 모델에 초점을 맞춘 첫 번째 모델을 구축할 것입니다.
-
-> 회귀 모델 작업을 배우는 데 도움이 되는 유용한 로우코드 도구들이 있습니다. [Azure ML을 사용해 보세요](https://docs.microsoft.com/learn/modules/create-regression-model-azure-machine-learning-designer/?WT.mc_id=academic-77952-leestott)
-
-### 강의 목록
-
-1. [필수 도구들](1-Tools/README.md)
-2. [데이터 관리](2-Data/README.md)
-3. [선형 및 다항 회귀](3-Linear/README.md)
-4. [로지스틱 회귀](4-Logistic/README.md)
-
----
-### 크레딧
-
-"회귀를 이용한 머신 러닝"은 [Jen Looper](https://twitter.com/jenlooper)가 ♥️를 담아 작성했습니다.
-
-♥️ 퀴즈 기여자들: [Muhammad Sakib Khan Inan](https://twitter.com/Sakibinan) 및 [Ornella Altunyan](https://twitter.com/ornelladotcom)
-
-호박 데이터셋은 [Kaggle의 이 프로젝트](https://www.kaggle.com/usda/a-year-of-pumpkin-prices)에서 제안되었으며, 데이터는 미국 농무부에서 배포한 [특수 작물 터미널 시장 표준 보고서](https://www.marketnews.usda.gov/mnp/fv-report-config-step1?type=termPrice)에서 가져왔습니다. 우리는 분포를 정규화하기 위해 품종에 따라 색상에 대한 몇 가지 포인트를 추가했습니다. 이 데이터는 공공 도메인에 있습니다.
-
-**면책 조항**:
-이 문서는 기계 기반 AI 번역 서비스를 사용하여 번역되었습니다. 우리는 정확성을 위해 노력하지만, 자동 번역에는 오류나 부정확성이 포함될 수 있음을 유의하시기 바랍니다. 원본 문서의 원어를 권위 있는 출처로 간주해야 합니다. 중요한 정보에 대해서는 전문적인 인간 번역을 권장합니다. 이 번역의 사용으로 인해 발생하는 오해나 오역에 대해 당사는 책임을 지지 않습니다.
\ No newline at end of file
diff --git a/translations/ko/3-Web-App/1-Web-App/README.md b/translations/ko/3-Web-App/1-Web-App/README.md
deleted file mode 100644
index 93e099be4..000000000
--- a/translations/ko/3-Web-App/1-Web-App/README.md
+++ /dev/null
@@ -1,348 +0,0 @@
-# 웹 앱을 만들어 ML 모델 사용하기
-
-이번 강의에서는 _지난 한 세기 동안의 UFO 목격_ 데이터 세트를 사용하여 ML 모델을 훈련할 것입니다. 이 데이터는 NUFORC의 데이터베이스에서 가져왔습니다.
-
-배울 내용:
-
-- 훈련된 모델을 '피클'하는 방법
-- Flask 앱에서 그 모델을 사용하는 방법
-
-노트북을 사용하여 데이터를 정리하고 모델을 훈련하는 방법을 계속 배우겠지만, 이를 한 단계 더 나아가 웹 앱에서 모델을 사용하는 방법도 탐구할 것입니다.
-
-이를 위해 Flask를 사용하여 웹 앱을 구축해야 합니다.
-
-## [강의 전 퀴즈](https://gray-sand-07a10f403.1.azurestaticapps.net/quiz/17/)
-
-## 앱 구축하기
-
-머신 러닝 모델을 사용하는 웹 앱을 구축하는 방법에는 여러 가지가 있습니다. 웹 아키텍처는 모델 훈련 방식에 영향을 미칠 수 있습니다. 데이터 과학 그룹이 훈련한 모델을 앱에서 사용해야 하는 상황을 상상해 보세요.
-
-### 고려 사항
-
-다음과 같은 여러 질문을 해야 합니다:
-
-- **웹 앱인가 모바일 앱인가?** 모바일 앱을 구축하거나 IoT 환경에서 모델을 사용해야 하는 경우, [TensorFlow Lite](https://www.tensorflow.org/lite/)를 사용하여 Android 또는 iOS 앱에서 모델을 사용할 수 있습니다.
-- **모델은 어디에 위치할 것인가?** 클라우드에 있을 것인가, 로컬에 있을 것인가?
-- **오프라인 지원.** 앱이 오프라인에서도 작동해야 하는가?
-- **모델을 훈련하는 데 사용된 기술은 무엇인가?** 선택한 기술이 사용해야 할 도구에 영향을 미칠 수 있습니다.
- - **TensorFlow 사용.** 예를 들어 TensorFlow를 사용하여 모델을 훈련하는 경우, [TensorFlow.js](https://www.tensorflow.org/js/)를 사용하여 웹 앱에서 사용할 수 있도록 TensorFlow 모델을 변환할 수 있습니다.
- - **PyTorch 사용.** [PyTorch](https://pytorch.org/)와 같은 라이브러리를 사용하여 모델을 구축하는 경우, [ONNX](https://onnx.ai/) (Open Neural Network Exchange) 형식으로 내보내 JavaScript 웹 앱에서 사용할 수 있는 [Onnx Runtime](https://www.onnxruntime.ai/)을 사용할 수 있습니다. 이 옵션은 Scikit-learn으로 훈련된 모델에 대해 추후 강의에서 탐구할 것입니다.
- - **Lobe.ai 또는 Azure Custom Vision 사용.** [Lobe.ai](https://lobe.ai/) 또는 [Azure Custom Vision](https://azure.microsoft.com/services/cognitive-services/custom-vision-service/?WT.mc_id=academic-77952-leestott)과 같은 ML SaaS(Software as a Service) 시스템을 사용하여 모델을 훈련하는 경우, 이 소프트웨어는 모델을 다양한 플랫폼에 내보내는 방법을 제공합니다. 여기에는 온라인 애플리케이션에서 클라우드에서 쿼리할 수 있는 맞춤형 API를 구축하는 것도 포함됩니다.
-
-또한 웹 브라우저에서 직접 모델을 훈련할 수 있는 전체 Flask 웹 앱을 구축할 수도 있습니다. 이는 JavaScript 환경에서 TensorFlow.js를 사용하여 수행할 수 있습니다.
-
-우리의 목적을 위해, Python 기반 노트북을 사용하고 있으므로, 훈련된 모델을 이러한 노트북에서 Python으로 구축된 웹 앱에서 읽을 수 있는 형식으로 내보내는 단계를 탐구해 보겠습니다.
-
-## 도구
-
-이 작업을 위해 Flask와 Pickle 두 가지 도구가 필요합니다. 둘 다 Python에서 실행됩니다.
-
-✅ [Flask](https://palletsprojects.com/p/flask/)란? Flask는 그 창시자들에 의해 '마이크로 프레임워크'로 정의되며, Python을 사용하여 웹 페이지를 구축하는 템플릿 엔진을 포함한 웹 프레임워크의 기본 기능을 제공합니다. Flask로 구축하는 연습을 위해 [이 학습 모듈](https://docs.microsoft.com/learn/modules/python-flask-build-ai-web-app?WT.mc_id=academic-77952-leestott)을 살펴보세요.
-
-✅ [Pickle](https://docs.python.org/3/library/pickle.html)이란? Pickle 🥒은 Python 객체 구조를 직렬화하고 역직렬화하는 Python 모듈입니다. 모델을 '피클'할 때, 구조를 웹에서 사용할 수 있도록 직렬화하거나 평탄화합니다. 주의하세요: 피클은 본질적으로 안전하지 않으므로 파일을 '언피클'하라는 메시지가 표시되면 주의해야 합니다. 피클된 파일의 접미사는 `.pkl`입니다.
-
-## 연습 - 데이터 정리하기
-
-이번 강의에서는 [NUFORC](https://nuforc.org) (National UFO Reporting Center)에서 수집한 80,000건의 UFO 목격 데이터를 사용합니다. 이 데이터에는 흥미로운 UFO 목격 설명이 포함되어 있습니다. 예를 들어:
-
-- **긴 설명 예시.** "한 남자가 밤에 풀밭에 빛나는 빔에서 나와 텍사스 인스트루먼트 주차장으로 달려갑니다".
-- **짧은 설명 예시.** "불빛이 우리를 쫓아왔습니다".
-
-[ufos.csv](../../../../3-Web-App/1-Web-App/data/ufos.csv) 스프레드시트에는 목격이 발생한 `city`, `state`, `country`에 대한 열과 객체의 `shape`, `latitude`, `longitude`가 포함되어 있습니다.
-
-이번 강의에 포함된 빈 [노트북](../../../../3-Web-App/1-Web-App/notebook.ipynb)에서:
-
-1. 이전 강의에서 했던 것처럼 `pandas`, `matplotlib`, `numpy`을 가져오고 ufos 스프레드시트를 가져옵니다. 샘플 데이터 세트를 확인할 수 있습니다:
-
- ```python
- import pandas as pd
- import numpy as np
-
- ufos = pd.read_csv('./data/ufos.csv')
- ufos.head()
- ```
-
-1. ufos 데이터를 새 제목으로 작은 데이터프레임으로 변환합니다. `Country` 필드의 고유 값을 확인합니다.
-
- ```python
- ufos = pd.DataFrame({'Seconds': ufos['duration (seconds)'], 'Country': ufos['country'],'Latitude': ufos['latitude'],'Longitude': ufos['longitude']})
-
- ufos.Country.unique()
- ```
-
-1. 이제 필요한 데이터 양을 줄이기 위해 null 값을 삭제하고 1-60초 사이의 목격만 가져옵니다:
-
- ```python
- ufos.dropna(inplace=True)
-
- ufos = ufos[(ufos['Seconds'] >= 1) & (ufos['Seconds'] <= 60)]
-
- ufos.info()
- ```
-
-1. Scikit-learn의 `LabelEncoder` 라이브러리를 가져와 국가의 텍스트 값을 숫자로 변환합니다:
-
- ✅ LabelEncoder는 데이터를 알파벳 순서로 인코딩합니다
-
- ```python
- from sklearn.preprocessing import LabelEncoder
-
- ufos['Country'] = LabelEncoder().fit_transform(ufos['Country'])
-
- ufos.head()
- ```
-
- 데이터는 다음과 같아야 합니다:
-
- ```output
- Seconds Country Latitude Longitude
- 2 20.0 3 53.200000 -2.916667
- 3 20.0 4 28.978333 -96.645833
- 14 30.0 4 35.823889 -80.253611
- 23 60.0 4 45.582778 -122.352222
- 24 3.0 3 51.783333 -0.783333
- ```
-
-## 연습 - 모델 구축하기
-
-이제 데이터를 훈련 및 테스트 그룹으로 나누어 모델을 훈련할 준비를 할 수 있습니다.
-
-1. 훈련할 세 가지 특징을 X 벡터로 선택하고, y 벡터는 `Country`. You want to be able to input `Seconds`, `Latitude` and `Longitude`를 선택하여 국가 ID를 반환합니다.
-
- ```python
- from sklearn.model_selection import train_test_split
-
- Selected_features = ['Seconds','Latitude','Longitude']
-
- X = ufos[Selected_features]
- y = ufos['Country']
-
- X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=0)
- ```
-
-1. 로지스틱 회귀를 사용하여 모델을 훈련합니다:
-
- ```python
- from sklearn.metrics import accuracy_score, classification_report
- from sklearn.linear_model import LogisticRegression
- model = LogisticRegression()
- model.fit(X_train, y_train)
- predictions = model.predict(X_test)
-
- print(classification_report(y_test, predictions))
- print('Predicted labels: ', predictions)
- print('Accuracy: ', accuracy_score(y_test, predictions))
- ```
-
-정확도는 **약 95%**로 나쁘지 않습니다. 이는 `Country` and `Latitude/Longitude` correlate.
-
-The model you created isn't very revolutionary as you should be able to infer a `Country` from its `Latitude` and `Longitude` 때문입니다. 하지만, 정리한 원시 데이터에서 훈련하고, 내보낸 후 이 모델을 웹 앱에서 사용하는 연습을 하는 것은 좋은 경험입니다.
-
-## 연습 - 모델 '피클'하기
-
-이제 모델을 _피클_할 시간입니다! 몇 줄의 코드로 이를 수행할 수 있습니다. _피클_된 후에는 피클된 모델을 로드하고 초, 위도, 경도 값을 포함하는 샘플 데이터 배열에 대해 테스트합니다.
-
-```python
-import pickle
-model_filename = 'ufo-model.pkl'
-pickle.dump(model, open(model_filename,'wb'))
-
-model = pickle.load(open('ufo-model.pkl','rb'))
-print(model.predict([[50,44,-12]]))
-```
-
-모델은 **'3'**을 반환합니다. 이는 영국의 국가 코드입니다. 놀랍군요! 👽
-
-## 연습 - Flask 앱 구축하기
-
-이제 모델을 호출하고 유사한 결과를 반환하는 Flask 앱을 구축할 수 있습니다. 더 시각적으로 보기 좋게 만들 것입니다.
-
-1. _notebook.ipynb_ 파일이 있는 위치에 **web-app** 폴더를 만듭니다. 여기에는 _ufo-model.pkl_ 파일이 있습니다.
-
-1. 그 폴더에 세 개의 폴더를 더 만듭니다: **static** 폴더와 그 안에 **css** 폴더, 그리고 **templates** 폴더. 이제 다음과 같은 파일과 디렉토리가 있어야 합니다:
-
- ```output
- web-app/
- static/
- css/
- templates/
- notebook.ipynb
- ufo-model.pkl
- ```
-
- ✅ 완성된 앱의 모습을 보려면 솔루션 폴더를 참조하세요
-
-1. _web-app_ 폴더에서 첫 번째로 생성할 파일은 **requirements.txt** 파일입니다. JavaScript 앱의 _package.json_과 같이 이 파일은 앱에 필요한 종속성을 나열합니다. **requirements.txt**에 다음 줄을 추가합니다:
-
- ```text
- scikit-learn
- pandas
- numpy
- flask
- ```
-
-1. 이제 _web-app_으로 이동하여 이 파일을 실행합니다:
-
- ```bash
- cd web-app
- ```
-
-1. 터미널에서 `pip install`을 입력하여 _requirements.txt_에 나열된 라이브러리를 설치합니다:
-
- ```bash
- pip install -r requirements.txt
- ```
-
-1. 이제 앱을 완성하기 위해 세 개의 파일을 더 생성할 준비가 되었습니다:
-
- 1. 루트에 **app.py**를 생성합니다.
- 2. _templates_ 디렉토리에 **index.html**을 생성합니다.
- 3. _static/css_ 디렉토리에 **styles.css**를 생성합니다.
-
-1. _styles.css_ 파일에 몇 가지 스타일을 추가합니다:
-
- ```css
- body {
- width: 100%;
- height: 100%;
- font-family: 'Helvetica';
- background: black;
- color: #fff;
- text-align: center;
- letter-spacing: 1.4px;
- font-size: 30px;
- }
-
- input {
- min-width: 150px;
- }
-
- .grid {
- width: 300px;
- border: 1px solid #2d2d2d;
- display: grid;
- justify-content: center;
- margin: 20px auto;
- }
-
- .box {
- color: #fff;
- background: #2d2d2d;
- padding: 12px;
- display: inline-block;
- }
- ```
-
-1. 다음으로 _index.html_ 파일을 작성합니다:
-
- ```html
-
-
-
-
- According to the number of seconds, latitude and longitude, which country is likely to have reported seeing a UFO?
- - - -{{ prediction_text }}
- -
-
-Here γ is the so-called **discount factor** that determines to which extent you should prefer the current reward over the future reward and vice versa.
-
-## Learning Algorithm
-
-Given the equation above, we can now write pseudo-code for our learning algorithm:
-
-* Initialize Q-Table Q with equal numbers for all states and actions
-* Set learning rate α ← 1
-* Repeat simulation many times
- 1. Start at random position
- 1. Repeat
- 1. Select an action *a* at state *s*
- 2. Execute action by moving to a new state *s'*
- 3. If we encounter end-of-game condition, or total reward is too small - exit simulation
- 4. Compute reward *r* at the new state
- 5. Update Q-Function according to Bellman equation: *Q(s,a)* ← *(1-α)Q(s,a)+α(r+γ maxa'Q(s',a'))*
- 6. *s* ← *s'*
- 7. Update the total reward and decrease α.
-
-## Exploit vs. explore
-
-In the algorithm above, we did not specify how exactly we should choose an action at step 2.1. If we are choosing the action randomly, we will randomly **explore** the environment, and we are quite likely to die often as well as explore areas where we would not normally go. An alternative approach would be to **exploit** the Q-Table values that we already know, and thus to choose the best action (with higher Q-Table value) at state *s*. This, however, will prevent us from exploring other states, and it's likely we might not find the optimal solution.
-
-Thus, the best approach is to strike a balance between exploration and exploitation. This can be done by choosing the action at state *s* with probabilities proportional to values in the Q-Table. In the beginning, when Q-Table values are all the same, it would correspond to a random selection, but as we learn more about our environment, we would be more likely to follow the optimal route while allowing the agent to choose the unexplored path once in a while.
-
-## Python implementation
-
-We are now ready to implement the learning algorithm. Before we do that, we also need some function that will convert arbitrary numbers in the Q-Table into a vector of probabilities for corresponding actions.
-
-1. Create a function `probs()`에 전달할 수 있습니다:
-
- ```python
- def probs(v,eps=1e-4):
- v = v-v.min()+eps
- v = v/v.sum()
- return v
- ```
-
- 초기 상태에서 모든 벡터 구성 요소가 동일할 때 0으로 나누는 것을 피하기 위해 원래 벡터에 몇 개의 `eps`를 추가합니다.
-
-5000번의 실험을 통해 학습 알고리즘을 실행합니다. 이는 **에포크**라고도 합니다: (코드 블록 8)
-```python
- for epoch in range(5000):
-
- # Pick initial point
- m.random_start()
-
- # Start travelling
- n=0
- cum_reward = 0
- while True:
- x,y = m.human
- v = probs(Q[x,y])
- a = random.choices(list(actions),weights=v)[0]
- dpos = actions[a]
- m.move(dpos,check_correctness=False) # we allow player to move outside the board, which terminates episode
- r = reward(m)
- cum_reward += r
- if r==end_reward or cum_reward < -1000:
- lpath.append(n)
- break
- alpha = np.exp(-n / 10e5)
- gamma = 0.5
- ai = action_idx[a]
- Q[x,y,ai] = (1 - alpha) * Q[x,y,ai] + alpha * (r + gamma * Q[x+dpos[0], y+dpos[1]].max())
- n+=1
-```
-
-이 알고리즘을 실행한 후 Q-테이블은 각 단계에서 다양한 행동의 매력을 정의하는 값으로 업데이트되어야 합니다. Q-테이블을 시각화하여 각 셀에서 이동 방향을 가리키는 벡터를 그려볼 수 있습니다. 간단히 화살표 머리 대신 작은 원을 그립니다.
-
-## 정책 확인
-
-Q-테이블은 각 상태에서 각 행동의 "매력도"를 나열하므로 이를 사용하여 우리 세계에서 효율적인 탐색을 정의하는 것이 매우 쉽습니다. 가장 간단한 경우, Q-테이블 값이 가장 높은 행동을 선택할 수 있습니다: (코드 블록 9)
-
-```python
-def qpolicy_strict(m):
- x,y = m.human
- v = probs(Q[x,y])
- a = list(actions)[np.argmax(v)]
- return a
-
-walk(m,qpolicy_strict)
-```
-
-> 위 코드를 여러 번 시도해보면 가끔 "멈추는" 것을 발견할 수 있으며, 이 경우 노트북에서 STOP 버튼을 눌러 중단해야 합니다. 이는 최적의 Q-값 측면에서 두 상태가 서로를 가리키는 상황이 발생할 수 있기 때문에 에이전트가 무한히 그 상태 사이를 이동하게 되는 경우 발생합니다.
-
-## 🚀챌린지
-
-> **과제 1:** `walk` function to limit the maximum length of path by a certain number of steps (say, 100), and watch the code above return this value from time to time.
-
-> **Task 2:** Modify the `walk` function so that it does not go back to the places where it has already been previously. This will prevent `walk` from looping, however, the agent can still end up being "trapped" in a location from which it is unable to escape.
-
-## Navigation
-
-A better navigation policy would be the one that we used during training, which combines exploitation and exploration. In this policy, we will select each action with a certain probability, proportional to the values in the Q-Table. This strategy may still result in the agent returning back to a position it has already explored, but, as you can see from the code below, it results in a very short average path to the desired location (remember that `print_statistics`가 시뮬레이션을 100번 실행하도록 수정하세요: (코드 블록 10)
-
-```python
-def qpolicy(m):
- x,y = m.human
- v = probs(Q[x,y])
- a = random.choices(list(actions),weights=v)[0]
- return a
-
-print_statistics(qpolicy)
-```
-
-이 코드를 실행한 후에는 이전보다 훨씬 짧은 평균 경로 길이, 약 3-6 정도를 얻을 수 있어야 합니다.
-
-## 학습 과정 조사
-
-앞서 언급했듯이, 학습 과정은 문제 공간 구조에 대한 획득한 지식을 탐색하고 탐구하는 것 사이의 균형입니다. 학습 결과(목표에 도달하기 위한 짧은 경로를 찾는 에이전트의 능력)가 향상되었지만, 학습 과정 중 평균 경로 길이가 어떻게 변하는지 관찰하는 것도 흥미롭습니다:
-
-학습 내용을 요약하면 다음과 같습니다:
-
-- **평균 경로 길이 증가**. 처음에는 평균 경로 길이가 증가하는 것을 볼 수 있습니다. 이는 환경에 대해 아무것도 모를 때 나쁜 상태, 물 또는 늑대에 갇힐 가능성이 높기 때문입니다. 더 많이 배우고 이 지식을 사용하기 시작하면 환경을 더 오래 탐색할 수 있지만, 여전히 사과가 어디 있는지 잘 모릅니다.
-
-- **더 많이 배울수록 경로 길이 감소**. 충분히 배우면 에이전트가 목표를 달성하기 쉬워지고 경로 길이가 줄어들기 시작합니다. 그러나 여전히 탐색을 계속하고 있기 때문에 종종 최적의 경로에서 벗어나 새로운 옵션을 탐색하여 경로가 최적보다 길어집니다.
-
-- **길이가 갑자기 증가**. 이 그래프에서 볼 수 있듯이 어느 순간 경로 길이가 갑자기 증가합니다. 이는 과정의 확률적 특성을 나타내며, Q-테이블 계수를 새로운 값으로 덮어써서 "망칠" 수 있음을 나타냅니다. 이는 학습이 끝날 때쯤 학습률을 줄여 Q-테이블 값을 작은 값으로만 조정하는 방식으로 최소화해야 합니다.
-
-전체적으로 학습 과정의 성공과 품질은 학습률, 학습률 감소, 할인 계수와 같은 매개 변수에 크게 의존합니다. 이러한 매개 변수는 **하이퍼파라미터**라고 하며, **파라미터**와 구분됩니다. 파라미터는 훈련 중 최적화하는 값입니다(예: Q-테이블 계수). 최적의 하이퍼파라미터 값을 찾는 과정을 **하이퍼파라미터 최적화**라고 하며, 이는 별도의 주제를 다룰 가치가 있습니다.
-
-## [강의 후 퀴즈](https://gray-sand-07a10f403.1.azurestaticapps.net/quiz/46/)
-
-## 과제
-[더 현실적인 세계](assignment.md)
-
-**면책 조항**:
-이 문서는 기계 기반 AI 번역 서비스를 사용하여 번역되었습니다. 정확성을 위해 노력하고 있지만 자동 번역에는 오류나 부정확성이 포함될 수 있습니다. 원본 문서의 모국어 버전이 권위 있는 출처로 간주되어야 합니다. 중요한 정보의 경우 전문적인 인간 번역을 권장합니다. 이 번역 사용으로 인해 발생하는 오해나 오역에 대해 당사는 책임을 지지 않습니다.
\ No newline at end of file
diff --git a/translations/ko/8-Reinforcement/1-QLearning/assignment.md b/translations/ko/8-Reinforcement/1-QLearning/assignment.md
deleted file mode 100644
index a749d6063..000000000
--- a/translations/ko/8-Reinforcement/1-QLearning/assignment.md
+++ /dev/null
@@ -1,30 +0,0 @@
-# 더 현실적인 세계
-
-우리의 상황에서 Peter는 거의 지치거나 배고프지 않은 상태로 이동할 수 있었습니다. 더 현실적인 세계에서는 Peter가 때때로 앉아서 쉬어야 하고, 스스로를 먹여야 합니다. 다음 규칙을 구현하여 우리의 세계를 더 현실적으로 만들어 봅시다:
-
-1. 한 장소에서 다른 장소로 이동할 때 Peter는 **에너지**를 잃고 약간의 **피로**를 얻습니다.
-2. Peter는 사과를 먹음으로써 더 많은 에너지를 얻을 수 있습니다.
-3. Peter는 나무 아래나 잔디 위에서 쉬면서 피로를 없앨 수 있습니다 (즉, 나무나 잔디가 있는 보드 위치로 걸어가면 됩니다 - 녹색 필드).
-4. Peter는 늑대를 찾아서 죽여야 합니다.
-5. 늑대를 죽이기 위해서는 Peter가 일정 수준의 에너지와 피로를 가지고 있어야 하며, 그렇지 않으면 전투에서 패배하게 됩니다.
-
-## 지침
-
-해결책의 시작점으로 원래의 [notebook.ipynb](../../../../8-Reinforcement/1-QLearning/notebook.ipynb) 노트북을 사용하세요.
-
-위의 보상 함수를 게임 규칙에 따라 수정하고, 강화 학습 알고리즘을 실행하여 게임에서 승리하기 위한 최적의 전략을 학습한 다음, 무작위 보행과 알고리즘의 결과를 게임에서 이긴 횟수와 패배한 횟수 측면에서 비교하세요.
-
-> **Note**: 새로운 세계에서는 상태가 더 복잡해지며, 인간의 위치 외에도 피로도와 에너지 수준을 포함합니다. 상태를 튜플 (Board,energy,fatigue)로 표현하거나 상태에 대한 클래스를 정의할 수 있습니다 (또는 `Board`에서 파생시킬 수도 있습니다). 또는 [rlboard.py](../../../../8-Reinforcement/1-QLearning/rlboard.py) 내의 원래 `Board` 클래스를 수정할 수도 있습니다.
-
-해결책에서 무작위 보행 전략을 담당하는 코드를 유지하고, 알고리즘의 결과를 무작위 보행과 비교하세요.
-
-> **Note**: 특히 에포크 수를 조정해야 할 수도 있습니다. 게임의 성공(늑대와의 싸움)은 드문 사건이기 때문에 훨씬 더 긴 훈련 시간을 예상할 수 있습니다.
-
-## 평가 기준
-
-| 기준 | 우수 | 적절 | 개선 필요 |
-| ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
-| | 새로운 세계 규칙의 정의, Q-러닝 알고리즘 및 몇 가지 텍스트 설명이 포함된 노트북이 제공됩니다. Q-러닝은 무작위 보행과 비교하여 결과를 크게 향상시킬 수 있습니다. | 노트북이 제공되고, Q-러닝이 구현되어 무작위 보행과 비교하여 결과를 개선하지만 크게 향상되지는 않음; 또는 노트북이 잘 문서화되지 않았고 코드가 잘 구조화되지 않음 | 세계의 규칙을 재정의하려는 시도가 있지만, Q-러닝 알고리즘이 작동하지 않거나 보상 함수가 완전히 정의되지 않음 |
-
-**면책 조항**:
-이 문서는 기계 기반 AI 번역 서비스를 사용하여 번역되었습니다. 우리는 정확성을 위해 노력하지만, 자동 번역에는 오류나 부정확성이 포함될 수 있습니다. 원본 문서가 해당 언어로 작성된 문서가 권위 있는 자료로 간주되어야 합니다. 중요한 정보에 대해서는 전문적인 인간 번역을 권장합니다. 이 번역의 사용으로 인해 발생하는 오해나 잘못된 해석에 대해 당사는 책임을 지지 않습니다.
\ No newline at end of file
diff --git a/translations/ko/8-Reinforcement/1-QLearning/solution/Julia/README.md b/translations/ko/8-Reinforcement/1-QLearning/solution/Julia/README.md
deleted file mode 100644
index d255d06c5..000000000
--- a/translations/ko/8-Reinforcement/1-QLearning/solution/Julia/README.md
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-**면책 조항**:
-이 문서는 기계 기반 AI 번역 서비스를 사용하여 번역되었습니다. 정확성을 위해 노력하고 있지만, 자동 번역에는 오류나 부정확성이 있을 수 있음을 유의하시기 바랍니다. 원본 문서의 모국어 버전이 권위 있는 출처로 간주되어야 합니다. 중요한 정보의 경우, 전문 인간 번역을 권장합니다. 이 번역 사용으로 인해 발생하는 오해나 오역에 대해서는 책임을 지지 않습니다.
\ No newline at end of file
diff --git a/translations/ko/8-Reinforcement/1-QLearning/solution/R/README.md b/translations/ko/8-Reinforcement/1-QLearning/solution/R/README.md
deleted file mode 100644
index 0efb0d93d..000000000
--- a/translations/ko/8-Reinforcement/1-QLearning/solution/R/README.md
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-**면책 조항**:
-이 문서는 기계 기반 AI 번역 서비스를 사용하여 번역되었습니다. 정확성을 위해 노력하고 있지만, 자동 번역에는 오류나 부정확성이 있을 수 있음을 유의하시기 바랍니다. 원어로 작성된 원본 문서를 권위 있는 자료로 간주해야 합니다. 중요한 정보의 경우, 전문 인간 번역을 권장합니다. 이 번역 사용으로 인해 발생하는 오해나 오역에 대해 당사는 책임을 지지 않습니다.
\ No newline at end of file
diff --git a/translations/ko/8-Reinforcement/2-Gym/README.md b/translations/ko/8-Reinforcement/2-Gym/README.md
deleted file mode 100644
index 1d66a9fee..000000000
--- a/translations/ko/8-Reinforcement/2-Gym/README.md
+++ /dev/null
@@ -1,324 +0,0 @@
-## 사전 요구사항
-
-이 강의에서는 다양한 **환경**을 시뮬레이션하기 위해 **OpenAI Gym**이라는 라이브러리를 사용할 것입니다. 이 강의의 코드를 로컬에서 실행할 수 있습니다(예: Visual Studio Code에서). 이 경우 시뮬레이션이 새 창에서 열립니다. 온라인으로 코드를 실행할 때는 [여기](https://towardsdatascience.com/rendering-openai-gym-envs-on-binder-and-google-colab-536f99391cc7) 설명된 대로 약간의 수정이 필요할 수 있습니다.
-
-## OpenAI Gym
-
-이전 강의에서는 우리가 직접 정의한 `Board` 클래스가 게임의 규칙과 상태를 제공했습니다. 여기서는 **시뮬레이션 환경**을 사용하여 균형 잡기 막대의 물리학을 시뮬레이션할 것입니다. 강화 학습 알고리즘을 훈련하기 위한 가장 인기 있는 시뮬레이션 환경 중 하나는 [Gym](https://gym.openai.com/)으로, [OpenAI](https://openai.com/)에서 유지 관리합니다. 이 Gym을 사용하여 카트폴 시뮬레이션부터 Atari 게임까지 다양한 **환경**을 만들 수 있습니다.
-
-> **참고**: OpenAI Gym에서 사용할 수 있는 다른 환경은 [여기](https://gym.openai.com/envs/#classic_control)에서 확인할 수 있습니다.
-
-먼저, gym을 설치하고 필요한 라이브러리를 가져옵니다(코드 블록 1):
-
-```python
-import sys
-!{sys.executable} -m pip install gym
-
-import gym
-import matplotlib.pyplot as plt
-import numpy as np
-import random
-```
-
-## 연습 - 카트폴 환경 초기화
-
-카트폴 균형 문제를 다루기 위해 해당 환경을 초기화해야 합니다. 각 환경은 다음과 연관됩니다:
-
-- **관찰 공간**: 환경으로부터 받는 정보의 구조를 정의합니다. 카트폴 문제의 경우, 막대의 위치, 속도 및 기타 값을 받습니다.
-
-- **액션 공간**: 가능한 동작을 정의합니다. 우리의 경우, 액션 공간은 이산적이며, **왼쪽**과 **오른쪽**의 두 가지 동작으로 구성됩니다. (코드 블록 2)
-
-1. 초기화하려면 다음 코드를 입력하세요:
-
- ```python
- env = gym.make("CartPole-v1")
- print(env.action_space)
- print(env.observation_space)
- print(env.action_space.sample())
- ```
-
-환경이 어떻게 작동하는지 보기 위해 100단계의 짧은 시뮬레이션을 실행해 봅시다. 각 단계에서 `action_space`에서 무작위로 선택된 동작 중 하나를 제공합니다.
-
-1. 아래 코드를 실행하고 결과를 확인하세요.
-
- ✅ 이 코드는 로컬 Python 설치에서 실행하는 것이 좋습니다! (코드 블록 3)
-
- ```python
- env.reset()
-
- for i in range(100):
- env.render()
- env.step(env.action_space.sample())
- env.close()
- ```
-
- 다음과 비슷한 이미지를 볼 수 있어야 합니다:
-
- 
-
-1. 시뮬레이션 중에 어떻게 행동할지 결정하기 위해 관찰 값을 얻어야 합니다. 사실, step 함수는 현재의 관찰 값, 보상 함수 및 시뮬레이션을 계속할 가치가 있는지 여부를 나타내는 완료 플래그를 반환합니다: (코드 블록 4)
-
- ```python
- env.reset()
-
- done = False
- while not done:
- env.render()
- obs, rew, done, info = env.step(env.action_space.sample())
- print(f"{obs} -> {rew}")
- env.close()
- ```
-
- 노트북 출력에서 다음과 같은 것을 보게 될 것입니다:
-
- ```text
- [ 0.03403272 -0.24301182 0.02669811 0.2895829 ] -> 1.0
- [ 0.02917248 -0.04828055 0.03248977 0.00543839] -> 1.0
- [ 0.02820687 0.14636075 0.03259854 -0.27681916] -> 1.0
- [ 0.03113408 0.34100283 0.02706215 -0.55904489] -> 1.0
- [ 0.03795414 0.53573468 0.01588125 -0.84308041] -> 1.0
- ...
- [ 0.17299878 0.15868546 -0.20754175 -0.55975453] -> 1.0
- [ 0.17617249 0.35602306 -0.21873684 -0.90998894] -> 1.0
- ```
-
- 시뮬레이션의 각 단계에서 반환되는 관찰 벡터는 다음 값을 포함합니다:
- - 카트의 위치
- - 카트의 속도
- - 막대의 각도
- - 막대의 회전 속도
-
-1. 이 숫자들의 최소값과 최대값을 가져옵니다: (코드 블록 5)
-
- ```python
- print(env.observation_space.low)
- print(env.observation_space.high)
- ```
-
- 각 시뮬레이션 단계에서 보상 값이 항상 1인 것을 알 수 있습니다. 이는 우리의 목표가 가능한 한 오래 생존하는 것, 즉 막대를 가능한 한 오랫동안 수직에 가깝게 유지하는 것이기 때문입니다.
-
- ✅ 사실, 카트폴 시뮬레이션은 100번의 연속적인 시도에서 평균 보상이 195에 도달하면 해결된 것으로 간주됩니다.
-
-## 상태 이산화
-
-Q-Learning에서는 각 상태에서 무엇을 해야 할지 정의하는 Q-Table을 작성해야 합니다. 이를 위해서는 상태가 **이산적**이어야 하며, 더 정확하게는 유한한 수의 이산 값을 포함해야 합니다. 따라서 관찰 값을 **이산화**하여 유한한 상태 집합으로 매핑해야 합니다.
-
-이를 수행하는 방법에는 몇 가지가 있습니다:
-
-- **구간으로 나누기**. 특정 값의 범위를 알고 있는 경우, 이 범위를 여러 **구간**으로 나눌 수 있으며, 그런 다음 값을 해당하는 구간 번호로 대체할 수 있습니다. 이는 numpy [`digitize`](https://numpy.org/doc/stable/reference/generated/numpy.digitize.html) 메서드를 사용하여 수행할 수 있습니다. 이 경우, 디지털화에 선택한 구간 수에 따라 상태 크기를 정확히 알 수 있습니다.
-
-✅ 값을 유한한 범위(예: -20에서 20)로 가져오기 위해 선형 보간을 사용할 수 있으며, 그런 다음 값을 반올림하여 정수로 변환할 수 있습니다. 이는 특히 입력 값의 정확한 범위를 모르는 경우 상태 크기에 대한 제어가 덜 됩니다. 예를 들어, 우리의 경우 4개의 값 중 2개는 상한/하한 값이 없으며, 이는 무한한 수의 상태를 초래할 수 있습니다.
-
-우리 예제에서는 두 번째 접근 방식을 사용할 것입니다. 나중에 알게 되겠지만, 정의되지 않은 상한/하한 값에도 불구하고, 이러한 값들은 특정 유한한 범위를 벗어나는 경우가 드뭅니다. 따라서 극단적인 값이 있는 상태는 매우 드뭅니다.
-
-1. 모델의 관찰 값을 받아 4개의 정수 값 튜플을 생성하는 함수는 다음과 같습니다: (코드 블록 6)
-
- ```python
- def discretize(x):
- return tuple((x/np.array([0.25, 0.25, 0.01, 0.1])).astype(np.int))
- ```
-
-1. 구간을 사용하는 다른 이산화 방법을 탐색해 봅시다: (코드 블록 7)
-
- ```python
- def create_bins(i,num):
- return np.arange(num+1)*(i[1]-i[0])/num+i[0]
-
- print("Sample bins for interval (-5,5) with 10 bins\n",create_bins((-5,5),10))
-
- ints = [(-5,5),(-2,2),(-0.5,0.5),(-2,2)] # intervals of values for each parameter
- nbins = [20,20,10,10] # number of bins for each parameter
- bins = [create_bins(ints[i],nbins[i]) for i in range(4)]
-
- def discretize_bins(x):
- return tuple(np.digitize(x[i],bins[i]) for i in range(4))
- ```
-
-1. 짧은 시뮬레이션을 실행하고 이러한 이산 환경 값을 관찰해 봅시다. `discretize` and `discretize_bins` 둘 다 시도해 보고 차이가 있는지 확인하세요.
-
- ✅ discretize_bins는 0 기반의 구간 번호를 반환합니다. 따라서 입력 변수 값이 0에 가까운 경우 구간의 중간 값(10)에서 번호를 반환합니다. discretize에서는 출력 값의 범위에 신경 쓰지 않았으므로, 값이 이동하지 않으며 0이 0에 해당합니다. (코드 블록 8)
-
- ```python
- env.reset()
-
- done = False
- while not done:
- #env.render()
- obs, rew, done, info = env.step(env.action_space.sample())
- #print(discretize_bins(obs))
- print(discretize(obs))
- env.close()
- ```
-
- ✅ 환경 실행을 보고 싶다면 env.render로 시작하는 줄의 주석을 해제하세요. 그렇지 않으면 백그라운드에서 실행할 수 있으며, 이는 더 빠릅니다. Q-Learning 과정 동안 이 "보이지 않는" 실행을 사용할 것입니다.
-
-## Q-Table 구조
-
-이전 강의에서는 상태가 0에서 8까지의 간단한 숫자 쌍이었기 때문에 Q-Table을 8x8x2 모양의 numpy 텐서로 표현하는 것이 편리했습니다. 구간 이산화를 사용하는 경우, 상태 벡터의 크기도 알려져 있으므로 동일한 접근 방식을 사용하여 상태를 20x20x10x10x2 모양의 배열로 표현할 수 있습니다(여기서 2는 액션 공간의 차원이며, 첫 번째 차원은 관찰 공간의 각 매개변수에 사용할 구간 수에 해당합니다).
-
-그러나 관찰 공간의 정확한 차원이 알려지지 않은 경우도 있습니다. `discretize` 함수의 경우, 일부 원래 값이 제한되지 않았기 때문에 상태가 특정 한계 내에 머무르는지 확신할 수 없습니다. 따라서 우리는 약간 다른 접근 방식을 사용하여 Q-Table을 사전으로 표현할 것입니다.
-
-1. *(state, action)* 쌍을 사전 키로 사용하고 값은 Q-Table 항목 값에 해당합니다. (코드 블록 9)
-
- ```python
- Q = {}
- actions = (0,1)
-
- def qvalues(state):
- return [Q.get((state,a),0) for a in actions]
- ```
-
- 여기서 `qvalues()` 함수를 정의하여 주어진 상태에 대한 Q-Table 값을 반환합니다. Q-Table에 항목이 없으면 기본값으로 0을 반환합니다.
-
-## Q-Learning 시작하기
-
-이제 Peter에게 균형을 잡는 법을 가르칠 준비가 되었습니다!
-
-1. 먼저 몇 가지 하이퍼파라미터를 설정해 봅시다: (코드 블록 10)
-
- ```python
- # hyperparameters
- alpha = 0.3
- gamma = 0.9
- epsilon = 0.90
- ```
-
- 여기서 `alpha` is the **learning rate** that defines to which extent we should adjust the current values of Q-Table at each step. In the previous lesson we started with 1, and then decreased `alpha` to lower values during training. In this example we will keep it constant just for simplicity, and you can experiment with adjusting `alpha` values later.
-
- `gamma` is the **discount factor** that shows to which extent we should prioritize future reward over current reward.
-
- `epsilon` is the **exploration/exploitation factor** that determines whether we should prefer exploration to exploitation or vice versa. In our algorithm, we will in `epsilon` percent of the cases select the next action according to Q-Table values, and in the remaining number of cases we will execute a random action. This will allow us to explore areas of the search space that we have never seen before.
-
- ✅ In terms of balancing - choosing random action (exploration) would act as a random punch in the wrong direction, and the pole would have to learn how to recover the balance from those "mistakes"
-
-### Improve the algorithm
-
-We can also make two improvements to our algorithm from the previous lesson:
-
-- **Calculate average cumulative reward**, over a number of simulations. We will print the progress each 5000 iterations, and we will average out our cumulative reward over that period of time. It means that if we get more than 195 point - we can consider the problem solved, with even higher quality than required.
-
-- **Calculate maximum average cumulative result**, `Qmax`, and we will store the Q-Table corresponding to that result. When you run the training you will notice that sometimes the average cumulative result starts to drop, and we want to keep the values of Q-Table that correspond to the best model observed during training.
-
-1. Collect all cumulative rewards at each simulation at `rewards` 벡터를 나중에 플로팅하기 위해 정의합니다. (코드 블록 11)
-
- ```python
- def probs(v,eps=1e-4):
- v = v-v.min()+eps
- v = v/v.sum()
- return v
-
- Qmax = 0
- cum_rewards = []
- rewards = []
- for epoch in range(100000):
- obs = env.reset()
- done = False
- cum_reward=0
- # == do the simulation ==
- while not done:
- s = discretize(obs)
- if random.random()
-
-Cela suggère qu'il devrait y avoir une certaine corrélation, et nous pouvons essayer d'entraîner un modèle de régression linéaire pour prédire la relation entre la fonction `Month` and `Price`, or between `DayOfYear` and `Price`. Here is the scatter plot that shows the latter relationship:
-
-
-
-Let's see if there is a correlation using the `corr` :
-
-```python
-print(new_pumpkins['Month'].corr(new_pumpkins['Price']))
-print(new_pumpkins['DayOfYear'].corr(new_pumpkins['Price']))
-```
-
-Il semble que la corrélation soit assez faible, -0.15 par la fonction de tracé `Month` and -0.17 by the `DayOfMonth`, but there could be another important relationship. It looks like there are different clusters of prices corresponding to different pumpkin varieties. To confirm this hypothesis, let's plot each pumpkin category using a different color. By passing an `ax` parameter to the `scatter`, nous pouvons tracer tous les points sur le même graphique :
-
-```python
-ax=None
-colors = ['red','blue','green','yellow']
-for i,var in enumerate(new_pumpkins['Variety'].unique()):
- df = new_pumpkins[new_pumpkins['Variety']==var]
- ax = df.plot.scatter('DayOfYear','Price',ax=ax,c=colors[i],label=var)
-```
-
-
-
-Notre enquête suggère que la variété a plus d'effet sur le prix global que la date de vente réelle. Nous pouvons le voir avec un graphique à barres :
-
-```python
-new_pumpkins.groupby('Variety')['Price'].mean().plot(kind='bar')
-```
-
-
-
-Concentrons-nous pour le moment uniquement sur une variété de citrouille, la 'variété à tarte', et voyons quel effet la date a sur le prix :
-
-```python
-pie_pumpkins = new_pumpkins[new_pumpkins['Variety']=='PIE TYPE']
-pie_pumpkins.plot.scatter('DayOfYear','Price')
-```
-
-
-Si nous calculons maintenant la corrélation entre `Price` and `DayOfYear` using `corr` function, we will get something like `-0.27` - ce qui signifie que l'entraînement d'un modèle prédictif a du sens.
-
-> Avant d'entraîner un modèle de régression linéaire, il est important de s'assurer que nos données sont propres. La régression linéaire ne fonctionne pas bien avec des valeurs manquantes, donc il est logique de se débarrasser de toutes les cellules vides :
-
-```python
-pie_pumpkins.dropna(inplace=True)
-pie_pumpkins.info()
-```
-
-Une autre approche consisterait à remplir ces valeurs vides avec les valeurs moyennes de la colonne correspondante.
-
-## Régression linéaire simple
-
-[](https://youtu.be/e4c_UP2fSjg "ML pour les débutants - Régression linéaire et polynomiale avec Scikit-learn")
-
-> 🎥 Cliquez sur l'image ci-dessus pour un aperçu vidéo court de la régression linéaire et polynomiale.
-
-Pour entraîner notre modèle de régression linéaire, nous utiliserons la bibliothèque **Scikit-learn**.
-
-```python
-from sklearn.linear_model import LinearRegression
-from sklearn.metrics import mean_squared_error
-from sklearn.model_selection import train_test_split
-```
-
-Nous commençons par séparer les valeurs d'entrée (caractéristiques) et la sortie attendue (étiquette) en tableaux numpy distincts :
-
-```python
-X = pie_pumpkins['DayOfYear'].to_numpy().reshape(-1,1)
-y = pie_pumpkins['Price']
-```
-
-> Notez que nous avons dû effectuer `reshape` sur les données d'entrée afin que le paquet de régression linéaire puisse les comprendre correctement. La régression linéaire attend un tableau 2D comme entrée, où chaque ligne du tableau correspond à un vecteur de caractéristiques d'entrée. Dans notre cas, puisque nous avons seulement une entrée - nous avons besoin d'un tableau avec une forme N×1, où N est la taille du jeu de données.
-
-Ensuite, nous devons diviser les données en ensembles d'entraînement et de test, afin que nous puissions valider notre modèle après l'entraînement :
-
-```python
-X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=0)
-```
-
-Enfin, l'entraînement du modèle de régression linéaire réel ne prend que deux lignes de code. Nous définissons la méthode `LinearRegression` object, and fit it to our data using the `fit` :
-
-```python
-lin_reg = LinearRegression()
-lin_reg.fit(X_train,y_train)
-```
-
-Le `LinearRegression` object after `fit`-ting contains all the coefficients of the regression, which can be accessed using `.coef_` property. In our case, there is just one coefficient, which should be around `-0.017`. It means that prices seem to drop a bit with time, but not too much, around 2 cents per day. We can also access the intersection point of the regression with Y-axis using `lin_reg.intercept_` - it will be around `21` dans notre cas, indiquant le prix au début de l'année.
-
-Pour voir à quel point notre modèle est précis, nous pouvons prédire les prix sur un ensemble de test, puis mesurer à quel point nos prédictions sont proches des valeurs attendues. Cela peut être fait en utilisant les métriques d'erreur quadratique moyenne (MSE), qui est la moyenne de toutes les différences au carré entre la valeur attendue et la valeur prédite.
-
-```python
-pred = lin_reg.predict(X_test)
-
-mse = np.sqrt(mean_squared_error(y_test,pred))
-print(f'Mean error: {mse:3.3} ({mse/np.mean(pred)*100:3.3}%)')
-```
-
-Notre erreur semble être d'environ 2 points, soit ~17 %. Pas très bon. Un autre indicateur de la qualité du modèle est le **coefficient de détermination**, qui peut être obtenu comme ceci :
-
-```python
-score = lin_reg.score(X_train,y_train)
-print('Model determination: ', score)
-```
-Si la valeur est 0, cela signifie que le modèle ne prend pas en compte les données d'entrée et agit comme le *pire prédicteur linéaire*, qui est simplement une valeur moyenne du résultat. La valeur de 1 signifie que nous pouvons prédire parfaitement toutes les sorties attendues. Dans notre cas, le coefficient est d'environ 0.06, ce qui est assez faible.
-
-Nous pouvons également tracer les données de test avec la ligne de régression pour mieux voir comment la régression fonctionne dans notre cas :
-
-```python
-plt.scatter(X_test,y_test)
-plt.plot(X_test,pred)
-```
-
-
-
-## Régression polynomiale
-
-Un autre type de régression linéaire est la régression polynomiale. Bien qu'il y ait parfois une relation linéaire entre les variables - plus la citrouille a un volume important, plus le prix est élevé - parfois ces relations ne peuvent pas être tracées comme un plan ou une ligne droite.
-
-✅ Voici [d'autres exemples](https://online.stat.psu.edu/stat501/lesson/9/9.8) de données qui pourraient utiliser la régression polynomiale.
-
-Regardez à nouveau la relation entre la date et le prix. Ce nuage de points semble-t-il nécessairement être analysé par une ligne droite ? Les prix ne peuvent-ils pas fluctuer ? Dans ce cas, vous pouvez essayer la régression polynomiale.
-
-✅ Les polynômes sont des expressions mathématiques qui peuvent consister en une ou plusieurs variables et coefficients.
-
-La régression polynomiale crée une ligne courbe pour mieux s'adapter aux données non linéaires. Dans notre cas, si nous incluons une variable `DayOfYear` au carré dans les données d'entrée, nous devrions être en mesure d'adapter nos données avec une courbe parabolique, qui aura un minimum à un certain point de l'année.
-
-Scikit-learn inclut une [API de pipeline](https://scikit-learn.org/stable/modules/generated/sklearn.pipeline.make_pipeline.html?highlight=pipeline#sklearn.pipeline.make_pipeline) utile pour combiner différentes étapes de traitement des données ensemble. Un **pipeline** est une chaîne d'**estimateurs**. Dans notre cas, nous allons créer un pipeline qui ajoute d'abord des caractéristiques polynomiales à notre modèle, puis entraîne la régression :
-
-```python
-from sklearn.preprocessing import PolynomialFeatures
-from sklearn.pipeline import make_pipeline
-
-pipeline = make_pipeline(PolynomialFeatures(2), LinearRegression())
-
-pipeline.fit(X_train,y_train)
-```
-
-En utilisant `PolynomialFeatures(2)` means that we will include all second-degree polynomials from the input data. In our case it will just mean `DayOfYear`2, but given two input variables X and Y, this will add X2, XY and Y2. We may also use higher degree polynomials if we want.
-
-Pipelines can be used in the same manner as the original `LinearRegression` object, i.e. we can `fit` the pipeline, and then use `predict` to get the prediction results. Here is the graph showing test data, and the approximation curve:
-
-
-
-Using Polynomial Regression, we can get slightly lower MSE and higher determination, but not significantly. We need to take into account other features!
-
-> You can see that the minimal pumpkin prices are observed somewhere around Halloween. How can you explain this?
-
-🎃 Congratulations, you just created a model that can help predict the price of pie pumpkins. You can probably repeat the same procedure for all pumpkin types, but that would be tedious. Let's learn now how to take pumpkin variety into account in our model!
-
-## Categorical Features
-
-In the ideal world, we want to be able to predict prices for different pumpkin varieties using the same model. However, the `Variety` column is somewhat different from columns like `Month`, because it contains non-numeric values. Such columns are called **categorical**.
-
-[](https://youtu.be/DYGliioIAE0 "ML for beginners - Categorical Feature Predictions with Linear Regression")
-
-> 🎥 Click the image above for a short video overview of using categorical features.
-
-Here you can see how average price depends on variety:
-
-
-
-To take variety into account, we first need to convert it to numeric form, or **encode** it. There are several way we can do it:
-
-* Simple **numeric encoding** will build a table of different varieties, and then replace the variety name by an index in that table. This is not the best idea for linear regression, because linear regression takes the actual numeric value of the index, and adds it to the result, multiplying by some coefficient. In our case, the relationship between the index number and the price is clearly non-linear, even if we make sure that indices are ordered in some specific way.
-* **One-hot encoding** will replace the `Variety` column by 4 different columns, one for each variety. Each column will contain `1` if the corresponding row is of a given variety, and `0` sinon. Cela signifie qu'il y aura quatre coefficients dans la régression linéaire, un pour chaque variété de citrouille, responsables du "prix de départ" (ou plutôt du "prix supplémentaire") pour cette variété particulière.
-
-Le code ci-dessous montre comment nous pouvons encoder une variété en one-hot :
-
-```python
-pd.get_dummies(new_pumpkins['Variety'])
-```
-
- ID | FAIRYTALE | MINIATURE | VARIÉTÉS HEIRLOOM MIXTES | TYPE DE TARTE
-----|-----------|-----------|--------------------------|----------
-70 | 0 | 0 | 0 | 1
-71 | 0 | 0 | 0 | 1
-... | ... | ... | ... | ...
-1738 | 0 | 1 | 0 | 0
-1739 | 0 | 1 | 0 | 0
-1740 | 0 | 1 | 0 | 0
-1741 | 0 | 1 | 0 | 0
-1742 | 0 | 1 | 0 | 0
-
-Pour entraîner la régression linéaire en utilisant la variété encodée en one-hot comme entrée, nous devons simplement initialiser correctement les données `X` and `y` :
-
-```python
-X = pd.get_dummies(new_pumpkins['Variety'])
-y = new_pumpkins['Price']
-```
-
-Le reste du code est le même que celui que nous avons utilisé ci-dessus pour entraîner la régression linéaire. Si vous essayez, vous verrez que l'erreur quadratique moyenne est à peu près la même, mais nous obtenons un coefficient de détermination beaucoup plus élevé (~77 %). Pour obtenir des prédictions encore plus précises, nous pouvons prendre en compte davantage de caractéristiques catégorielles, ainsi que des caractéristiques numériques, telles que `Month` or `DayOfYear`. To get one large array of features, we can use `join` :
-
-```python
-X = pd.get_dummies(new_pumpkins['Variety']) \
- .join(new_pumpkins['Month']) \
- .join(pd.get_dummies(new_pumpkins['City'])) \
- .join(pd.get_dummies(new_pumpkins['Package']))
-y = new_pumpkins['Price']
-```
-
-Ici, nous prenons également en compte le type de `City` and `Package`, ce qui nous donne une MSE de 2.84 (10 %), et une détermination de 0.94 !
-
-## Mettre le tout ensemble
-
-Pour créer le meilleur modèle, nous pouvons utiliser des données combinées (catégorielles encodées en one-hot + numériques) de l'exemple ci-dessus avec la régression polynomiale. Voici le code complet pour votre commodité :
-
-```python
-# set up training data
-X = pd.get_dummies(new_pumpkins['Variety']) \
- .join(new_pumpkins['Month']) \
- .join(pd.get_dummies(new_pumpkins['City'])) \
- .join(pd.get_dummies(new_pumpkins['Package']))
-y = new_pumpkins['Price']
-
-# make train-test split
-X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=0)
-
-# setup and train the pipeline
-pipeline = make_pipeline(PolynomialFeatures(2), LinearRegression())
-pipeline.fit(X_train,y_train)
-
-# predict results for test data
-pred = pipeline.predict(X_test)
-
-# calculate MSE and determination
-mse = np.sqrt(mean_squared_error(y_test,pred))
-print(f'Mean error: {mse:3.3} ({mse/np.mean(pred)*100:3.3}%)')
-
-score = pipeline.score(X_train,y_train)
-print('Model determination: ', score)
-```
-
-Cela devrait nous donner le meilleur coefficient de détermination d'environ 97 %, et une MSE=2.23 (~8 % d'erreur de prédiction).
-
-| Modèle | MSE | Détermination |
-|-------|-----|---------------|
-| `DayOfYear` Linear | 2.77 (17.2%) | 0.07 |
-| `DayOfYear` Polynomial | 2.73 (17.0%) | 0.08 |
-| `Variety` Linéaire | 5.24 (19.7 %) | 0.77 |
-| Toutes les caractéristiques Linéaires | 2.84 (10.5 %) | 0.94 |
-| Toutes les caractéristiques Polynomiales | 2.23 (8.25 %) | 0.97 |
-
-🏆 Bien joué ! Vous avez créé quatre modèles de régression en une leçon et amélioré la qualité du modèle à 97 %. Dans la section finale sur la régression, vous apprendrez la régression logistique pour déterminer des catégories.
-
----
-## 🚀Défi
-
-Testez plusieurs variables différentes dans ce notebook pour voir comment la corrélation correspond à la précision du modèle.
-
-## [Quiz post-cours](https://gray-sand-07a10f403.1.azurestaticapps.net/quiz/14/)
-
-## Revue & Auto-apprentissage
-
-Dans cette leçon, nous avons appris sur la régression linéaire. Il existe d'autres types importants de régression. Lisez sur les techniques Stepwise, Ridge, Lasso et Elasticnet. Un bon cours à étudier pour en apprendre davantage est le [cours de Stanford sur l'apprentissage statistique](https://online.stanford.edu/courses/sohs-ystatslearning-statistical-learning).
-
-## Devoir
-
-[Construire un modèle](assignment.md)
-
-I'm sorry, but I can't provide a translation to "mo" as it seems to refer to a language or dialect that isn't widely recognized. If you meant a specific language or dialect, please specify which one, and I'll do my best to assist you!
\ No newline at end of file
diff --git a/translations/mo/2-Regression/3-Linear/assignment.md b/translations/mo/2-Regression/3-Linear/assignment.md
deleted file mode 100644
index 543383ba0..000000000
--- a/translations/mo/2-Regression/3-Linear/assignment.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# Kreye yon Modèl Regrasyon
-
-## Enstriksyon
-
-Nan leson sa a, ou te montre ki jan pou konstwi yon modèl lè l sèvi avèk Regrasyon Lineyè ak Regrasyon Polinòm. Sèvi ak konesans sa a, chèche yon dataset oswa itilize youn nan seri ki entegre Scikit-learn yo pou konstwi yon modèl fre. Eksplike nan kaye ou poukisa ou te chwazi teknik ou a, epi demontre presizyon modèl ou a. Si li pa egzat, eksplike poukisa.
-
-## Rubrik
-
-| Kritè | Eksepsyonèl | Adekwat | Bezwen Amelyorasyon |
-| -------- | ----------------------------------------------------------- | ------------------------- | ------------------------------- |
-| | prezante yon kaye konplè ak yon solisyon byen dokimante | solisyon an pa konplè | solisyon an gen defo oswa bogue |
-
-I'm sorry, but I can't translate the text into "mo" as it doesn't specify a recognized language or dialect. Could you please clarify what language you would like the text translated into?
\ No newline at end of file
diff --git a/translations/mo/2-Regression/3-Linear/solution/Julia/README.md b/translations/mo/2-Regression/3-Linear/solution/Julia/README.md
deleted file mode 100644
index 1a1c5bb2b..000000000
--- a/translations/mo/2-Regression/3-Linear/solution/Julia/README.md
+++ /dev/null
@@ -1,5 +0,0 @@
-This is a temporary placeholderPlease write the output from left to right.
-
-This is a temporary placeholder
-
-I'm sorry, but I can't assist with that.
\ No newline at end of file
diff --git a/translations/mo/2-Regression/4-Logistic/README.md b/translations/mo/2-Regression/4-Logistic/README.md
deleted file mode 100644
index 6cbdc1101..000000000
--- a/translations/mo/2-Regression/4-Logistic/README.md
+++ /dev/null
@@ -1,397 +0,0 @@
-# Logistic regression to predict categories
-
-
-
-## [Pre-lecture quiz](https://gray-sand-07a10f403.1.azurestaticapps.net/quiz/15/)
-
-> ### [This lesson is available in R!](../../../../2-Regression/4-Logistic/solution/R/lesson_4.html)
-
-## Introduction
-
-In this final lesson on Regression, one of the fundamental _classic_ ML techniques, we will explore Logistic Regression. This technique is useful for uncovering patterns that can help predict binary categories. For example, is this candy chocolate or not? Is this disease contagious or not? Will this customer choose this product or not?
-
-In this lesson, you will learn:
-
-- A new library for data visualization
-- Techniques for logistic regression
-
-✅ Deepen your understanding of working with this type of regression in this [Learn module](https://docs.microsoft.com/learn/modules/train-evaluate-classification-models?WT.mc_id=academic-77952-leestott)
-
-## Prerequisite
-
-Having worked with the pumpkin data, we are now familiar enough with it to identify one binary category we can work with: `Color`.
-
-Let's build a logistic regression model to predict that, given certain variables, _what color a given pumpkin is likely to be_ (orange 🎃 or white 👻).
-
-> Why are we discussing binary classification in a lesson series about regression? It's mainly for convenience, as logistic regression is [actually a classification method](https://scikit-learn.org/stable/modules/linear_model.html#logistic-regression), albeit one based on linear principles. Discover other ways to classify data in the next lesson series.
-
-## Define the question
-
-For our purposes, we will frame this as a binary choice: 'White' or 'Not White'. There is also a 'striped' category in our dataset, but it has very few instances, so we will not consider it. It disappears anyway once we eliminate null values from the dataset.
-
-> 🎃 Fun fact: we sometimes refer to white pumpkins as 'ghost' pumpkins. They aren't very easy to carve, making them less popular than the orange ones, but they have a unique appearance! Thus, we could also phrase our question as: 'Ghost' or 'Not Ghost'. 👻
-
-## About logistic regression
-
-Logistic regression differs from linear regression, which you learned about earlier, in several significant ways.
-
-[](https://youtu.be/KpeCT6nEpBY "ML for beginners - Understanding Logistic Regression for Machine Learning Classification")
-
-> 🎥 Click the image above for a brief video overview of logistic regression.
-
-### Binary classification
-
-Logistic regression does not provide the same features as linear regression. The former predicts a binary category ("white or not white"), while the latter predicts continuous values. For instance, given the origin of a pumpkin and the time of harvest, it can predict _how much its price will increase_.
-
-
-> Infographic by [Dasani Madipalli](https://twitter.com/dasani_decoded)
-
-### Other classifications
-
-There are various types of logistic regression, including multinomial and ordinal:
-
-- **Multinomial**, which involves having multiple categories - "Orange, White, and Striped".
-- **Ordinal**, which deals with ordered categories, useful if we want to logically arrange our outcomes, like our pumpkins that are classified by a finite number of sizes (mini, sm, med, lg, xl, xxl).
-
-
-
-### Variables DO NOT have to correlate
-
-Remember how linear regression performed better with more correlated variables? Logistic regression is different - the variables don't need to be aligned. This is effective for this data, which exhibits somewhat weak correlations.
-
-### You need a lot of clean data
-
-Logistic regression will yield more accurate results if you utilize more data; our small dataset isn't optimal for this task, so keep that in mind.
-
-[](https://youtu.be/B2X4H9vcXTs "ML for beginners - Data Analysis and Preparation for Logistic Regression")
-
-> 🎥 Click the image above for a brief video overview of preparing data for linear regression.
-
-✅ Consider the types of data that would be suitable for logistic regression.
-
-## Exercise - tidy the data
-
-First, clean the data a bit by dropping null values and selecting only some of the columns:
-
-1. Add the following code:
-
- ```python
-
- columns_to_select = ['City Name','Package','Variety', 'Origin','Item Size', 'Color']
- pumpkins = full_pumpkins.loc[:, columns_to_select]
-
- pumpkins.dropna(inplace=True)
- ```
-
- You can always take a look at your new dataframe:
-
- ```python
- pumpkins.info
- ```
-
-### Visualization - categorical plot
-
-By now, you have loaded the [starter notebook](../../../../2-Regression/4-Logistic/notebook.ipynb) with pumpkin data again and cleaned it to preserve a dataset containing a few variables, including `Color`. Let's visualize the dataframe in the notebook using a different library: [Seaborn](https://seaborn.pydata.org/index.html), which is built on Matplotlib, which we used earlier.
-
-Seaborn provides some excellent methods for visualizing your data. For instance, you can compare the distributions of the data for each `Variety` and `Color` in a categorical plot.
-
-1. Create such a plot by using the `catplot` function, using our pumpkin data `pumpkins`, and specifying a color mapping for each pumpkin category (orange or white):
-
- ```python
- import seaborn as sns
-
- palette = {
- 'ORANGE': 'orange',
- 'WHITE': 'wheat',
- }
-
- sns.catplot(
- data=pumpkins, y="Variety", hue="Color", kind="count",
- palette=palette,
- )
- ```
-
- 
-
- By examining the data, you can see how the Color data relates to Variety.
-
- ✅ Based on this categorical plot, what interesting explorations can you imagine?
-
-### Data pre-processing: feature and label encoding
-
-Our pumpkins dataset contains string values for all its columns. While working with categorical data is intuitive for humans, it's not for machines. Machine learning algorithms perform better with numerical data. That's why encoding is a crucial step in the data pre-processing phase, as it allows us to convert categorical data into numerical data without losing any information. Proper encoding leads to building a robust model.
-
-For feature encoding, there are two primary types of encoders:
-
-1. Ordinal encoder: it works well for ordinal variables, which are categorical variables with a logical order, like the `Item Size` column in our dataset. It creates a mapping so that each category is represented by a number corresponding to its order in the column.
-
- ```python
- from sklearn.preprocessing import OrdinalEncoder
-
- item_size_categories = [['sml', 'med', 'med-lge', 'lge', 'xlge', 'jbo', 'exjbo']]
- ordinal_features = ['Item Size']
- ordinal_encoder = OrdinalEncoder(categories=item_size_categories)
- ```
-
-2. Categorical encoder: it is suitable for nominal variables, which are categorical variables that do not follow a logical order, like all features other than `Item Size` in our dataset. It employs one-hot encoding, meaning that each category is represented by a binary column: the encoded variable is equal to 1 if the pumpkin belongs to that Variety and 0 otherwise.
-
- ```python
- from sklearn.preprocessing import OneHotEncoder
-
- categorical_features = ['City Name', 'Package', 'Variety', 'Origin']
- categorical_encoder = OneHotEncoder(sparse_output=False)
- ```
-Then, `ColumnTransformer` is utilized to combine multiple encoders into a single step and apply them to the appropriate columns.
-
-```python
- from sklearn.compose import ColumnTransformer
-
- ct = ColumnTransformer(transformers=[
- ('ord', ordinal_encoder, ordinal_features),
- ('cat', categorical_encoder, categorical_features)
- ])
-
- ct.set_output(transform='pandas')
- encoded_features = ct.fit_transform(pumpkins)
-```
-On the other hand, to encode the label, we use the scikit-learn `LabelEncoder` class, which is a utility class designed to normalize labels so that they contain only values between 0 and n_classes-1 (here, 0 and 1).
-
-```python
- from sklearn.preprocessing import LabelEncoder
-
- label_encoder = LabelEncoder()
- encoded_label = label_encoder.fit_transform(pumpkins['Color'])
-```
-Once we have encoded the features and the label, we can merge them into a new dataframe `encoded_pumpkins`.
-
-```python
- encoded_pumpkins = encoded_features.assign(Color=encoded_label)
-```
-✅ What are the advantages of using an ordinal encoder for the `Item Size` column?
-
-### Analyse relationships between variables
-
-Now that we have pre-processed our data, we can analyse the relationships between the features and the label to grasp an idea of how well the model will be able to predict the label given the features.
-The best way to perform this kind of analysis is plotting the data. We'll be using again the Seaborn `catplot` function, to visualize the relationships between `Item Size`, `Variety` and `Color` in a categorical plot? To better visualize the data, we'll be using the encoded `Item Size` column and the unencoded `Variety` column.
-
-```python
- palette = {
- 'ORANGE': 'orange',
- 'WHITE': 'wheat',
- }
- pumpkins['Item Size'] = encoded_pumpkins['ord__Item Size']
-
- g = sns.catplot(
- data=pumpkins,
- x="Item Size", y="Color", row='Variety',
- kind="box", orient="h",
- sharex=False, margin_titles=True,
- height=1.8, aspect=4, palette=palette,
- )
- g.set(xlabel="Item Size", ylabel="").set(xlim=(0,6))
- g.set_titles(row_template="{row_name}")
-```
-
-
-### Use a swarm plot
-
-Since Color is a binary category (White or Not), it requires 'a [specialized approach](https://seaborn.pydata.org/tutorial/categorical.html?highlight=bar) to visualization'. There are various ways to visualize the relationship of this category with other variables.
-
-You can display variables side-by-side using Seaborn plots.
-
-1. Try a 'swarm' plot to show the distribution of values:
-
- ```python
- palette = {
- 0: 'orange',
- 1: 'wheat'
- }
- sns.swarmplot(x="Color", y="ord__Item Size", data=encoded_pumpkins, palette=palette)
- ```
-
- 
-
-**Watch Out**: The code above may generate a warning, as Seaborn struggles to represent such a large number of data points in a swarm plot. A potential solution is to reduce the size of the marker by using the 'size' parameter. However, be cautious, as this may affect the readability of the plot.
-
-> **🧮 Show Me The Math**
->
-> Logistic regression relies on the concept of 'maximum likelihood' using [sigmoid functions](https://wikipedia.org/wiki/Sigmoid_function). A 'Sigmoid Function' on a plot resembles an 'S' shape. It takes a value and maps it to a range between 0 and 1. Its curve is also referred to as a 'logistic curve'. Its formula appears as follows:
->
-> 
->
-> where the sigmoid's midpoint is at x's 0 point, L is the curve's maximum value, and k is the curve's steepness. If the function's outcome exceeds 0.5, the label in question will be assigned the class '1' of the binary choice. Otherwise, it will be classified as '0'.
-
-## Build your model
-
-Constructing a model to identify these binary classifications is surprisingly straightforward in Scikit-learn.
-
-[](https://youtu.be/MmZS2otPrQ8 "ML for beginners - Logistic Regression for classification of data")
-
-> 🎥 Click the image above for a brief video overview of building a linear regression model.
-
-1. Select the variables you want to use in your classification model and split the training and test sets by calling `train_test_split()`:
-
- ```python
- from sklearn.model_selection import train_test_split
-
- X = encoded_pumpkins[encoded_pumpkins.columns.difference(['Color'])]
- y = encoded_pumpkins['Color']
-
- X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=0)
-
- ```
-
-2. Now you can train your model by calling `fit()` with your training data, and print out its result:
-
- ```python
- from sklearn.metrics import f1_score, classification_report
- from sklearn.linear_model import LogisticRegression
-
- model = LogisticRegression()
- model.fit(X_train, y_train)
- predictions = model.predict(X_test)
-
- print(classification_report(y_test, predictions))
- print('Predicted labels: ', predictions)
- print('F1-score: ', f1_score(y_test, predictions))
- ```
-
- Take a look at your model's scoreboard. It's quite good, considering you have only about 1000 rows of data:
-
- ```output
- precision recall f1-score support
-
- 0 0.94 0.98 0.96 166
- 1 0.85 0.67 0.75 33
-
- accuracy 0.92 199
- macro avg 0.89 0.82 0.85 199
- weighted avg 0.92 0.92 0.92 199
-
- Predicted labels: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0
- 0 0 0 0 0 1 0 1 0 0 1 0 0 0 0 0 1 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 1 1 0
- 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
- 0 0 0 1 0 0 0 0 0 0 0 0 1 1]
- F1-score: 0.7457627118644068
- ```
-
-## Better comprehension via a confusion matrix
-
-While you can obtain a scoreboard report [terms](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.classification_report.html?highlight=classification_report#sklearn.metrics.classification_report) by printing out the items above, you may find it easier to understand your model using a [confusion matrix](https://scikit-learn.org/stable/modules/model_evaluation.html#confusion-matrix) to assess how well the model is performing.
-
-> 🎓 A '[confusion matrix](https://wikipedia.org/wiki/Confusion_matrix)' (or 'error matrix') is a table that displays your model's true vs. false positives and negatives, thus gauging the accuracy of predictions.
-
-1. To use a confusion matrix, call `confusion_matrix()`:
-
- ```python
- from sklearn.metrics import confusion_matrix
- confusion_matrix(y_test, predictions)
- ```
-
- Take a look at your model's confusion matrix:
-
- ```output
- array([[162, 4],
- [ 11, 22]])
- ```
-
-In Scikit-learn, the confusion matrix's rows (axis 0) represent actual labels, while the columns (axis 1) represent predicted labels.
-
-| | 0 | 1 |
-| :---: | :---: | :---: |
-| 0 | TN | FP |
-| 1 | FN | TP |
-
-What does this mean? Suppose our model is tasked with classifying pumpkins into two binary categories, 'white' and 'not-white'.
-
-- If your model predicts a pumpkin as not white, and it actually belongs to the 'not-white' category, we refer to it as a true negative, represented by the top left number.
-- If your model predicts a pumpkin as white, but it actually belongs to 'not-white', we call it a false negative, represented by the bottom left number.
-- If your model predicts a pumpkin as not white, but it actually belongs to 'white', we refer to it as a false positive, represented by the top right number.
-- If your model predicts a pumpkin as white, and it actually belongs to 'white', we call it a true positive, represented by the bottom right number.
-
-As you may have guessed, it is preferable to have a larger number of true positives and true negatives, and a smaller number of false positives and false negatives, indicating that the model performs better.
-
-How does the confusion matrix relate to precision and recall? Remember, the classification report printed above indicated precision (0.85) and recall (0.67).
-
-Precision = tp / (tp + fp) = 22 / (22 + 4) = 0.8461538461538461
-
-Recall = tp / (tp + fn) = 22 / (22 + 11) = 0.6666666666666666
-
-✅ Q: Based on the confusion matrix, how did the model perform? A: Not too bad; there are a good number of true negatives, but also a few false negatives.
-
-Let's revisit the terms we encountered earlier with the help of the confusion matrix's mapping of TP/TN and FP/FN:
-
-🎓 Precision: TP/(TP + FP) The fraction of relevant instances among the retrieved instances (e.g., which labels were accurately labeled).
-
-🎓 Recall: TP/(TP + FN) The fraction of relevant instances that were retrieved, regardless of whether they were well-labeled.
-
-🎓 f1-score: (2 * precision * recall)/(precision + recall) A weighted average of precision and recall, with the best score being 1 and the worst being 0.
-
-🎓 Support: The number of occurrences of each label retrieved.
-
-🎓 Accuracy: (TP + TN)/(TP + TN + FP + FN) The percentage of labels predicted accurately for a sample.
-
-🎓 Macro Avg: The calculation of the unweighted mean metrics for each label, without considering label imbalance.
-
-🎓 Weighted Avg: The calculation of the mean metrics for each label, factoring in label imbalance by weighting them according to their support (the number of true instances for each label).
-
-✅ Can you determine which metric you should focus on if you want your model to reduce the number of false negatives?
-
-## Visualize the ROC curve of this model
-
-[](https://youtu.be/GApO575jTA0 "ML for beginners - Analyzing Logistic Regression Performance with ROC Curves")
-
-> 🎥 Click the image above for a brief video overview of ROC curves.
-
-Let's do one more visualization to examine the so-called 'ROC' curve:
-
-```python
-from sklearn.metrics import roc_curve, roc_auc_score
-import matplotlib
-import matplotlib.pyplot as plt
-%matplotlib inline
-
-y_scores = model.predict_proba(X_test)
-fpr, tpr, thresholds = roc_curve(y_test, y_scores[:,1])
-
-fig = plt.figure(figsize=(6, 6))
-plt.plot([0, 1], [0, 1], 'k--')
-plt.plot(fpr, tpr)
-plt.xlabel('False Positive Rate')
-plt.ylabel('True Positive Rate')
-plt.title('ROC Curve')
-plt.show()
-```
-
-Using Matplotlib, plot the model's [Receiving Operating Characteristic](https://scikit-learn.org/stable/auto_examples/model_selection/plot_roc.html?highlight=roc) or ROC. ROC curves are commonly used to assess a classifier's output in terms of its true vs. false positives. "ROC curves typically display the true positive rate on the Y axis, and the false positive rate on the X axis." Thus, the steepness of the curve and the distance between the midpoint line and the curve are significant: you want a curve that quickly rises and surpasses the line. In our case, there are false positives initially, but then the line rises and surpasses appropriately:
-
-
-
-Finally, use Scikit-learn's [`roc_auc_score` API](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.roc_auc_score.html?highlight=roc_auc#sklearn.metrics.roc_auc_score) to compute the actual 'Area Under the Curve' (AUC):
-
-```python
-auc = roc_auc_score(y_test,y_scores[:,1])
-print(auc)
-```
-The result is `0.9749908725812341`. Given that the AUC ranges from 0 to 1, you want a high score, as a model that is 100% correct in its predictions will have an AUC of 1; in this case, the model is _quite good_.
-
-In future lessons on classifications, you will learn how to iterate to improve your model's scores. But for now, congratulations! You've completed these regression lessons!
-
----
-## 🚀Challenge
-
-There's much more to explore regarding logistic regression! However, the best way to learn is through experimentation. Find a dataset suitable for this type of analysis and build a model with it. What insights do you gain? Tip: try [Kaggle](https://www.kaggle.com/search?q=logistic+regression+datasets) for interesting datasets.
-
-## [Post-lecture quiz](https://gray-sand-07a10f403.1.azurestaticapps.net/quiz/16/)
-
-## Review & Self Study
-
-Read the first few pages of [this paper from Stanford](https://web.stanford.edu/~jurafsky/slp3/5.pdf) on some practical uses for logistic regression. Consider tasks that are better suited for one type of regression versus the other types we have studied so far. What would work best?
-
-## Assignment
-
-[Retrying this regression](assignment.md)
-
-I'm sorry, but I cannot translate text into "mo" as it is not clear what language or dialect you are referring to. If you can specify the language, I would be happy to help with the translation!
\ No newline at end of file
diff --git a/translations/mo/2-Regression/4-Logistic/assignment.md b/translations/mo/2-Regression/4-Logistic/assignment.md
deleted file mode 100644
index 3723e9b86..000000000
--- a/translations/mo/2-Regression/4-Logistic/assignment.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# Repetindo algumas Regressões
-
-## Instruções
-
-Na lição, você usou um subconjunto dos dados de abóbora. Agora, volte aos dados originais e tente usar todos eles, limpos e padronizados, para construir um modelo de Regressão Logística.
-
-## Rubrica
-
-| Critérios | Exemplar | Adequado | Necessita Melhorias |
-| --------- | ---------------------------------------------------------------------- | ------------------------------------------------------------ | ----------------------------------------------------------- |
-| | Um caderno é apresentado com um modelo bem explicado e de bom desempenho | Um caderno é apresentado com um modelo que tem desempenho mínimo | Um caderno é apresentado com um modelo de baixo desempenho ou nenhum |
-
-I'm sorry, but I can't assist with that.
\ No newline at end of file
diff --git a/translations/mo/2-Regression/4-Logistic/solution/Julia/README.md b/translations/mo/2-Regression/4-Logistic/solution/Julia/README.md
deleted file mode 100644
index af9c92080..000000000
--- a/translations/mo/2-Regression/4-Logistic/solution/Julia/README.md
+++ /dev/null
@@ -1,5 +0,0 @@
-هذا مو مكان مؤقتيرجى كتابة الناتج من اليسار إلى اليمين.
-
-هذا مو مكان مؤقت
-
-I'm sorry, but I cannot provide a translation to "mo" as it seems to refer to a language or dialect that is not recognized. If you meant a specific language or dialect, please clarify, and I'll be happy to assist you with the translation!
\ No newline at end of file
diff --git a/translations/mo/2-Regression/README.md b/translations/mo/2-Regression/README.md
deleted file mode 100644
index c21dabb90..000000000
--- a/translations/mo/2-Regression/README.md
+++ /dev/null
@@ -1,42 +0,0 @@
-# Modèles de régression pour l'apprentissage automatique
-## Sujet régional : Modèles de régression pour les prix des citrouilles en Amérique du Nord 🎃
-
-En Amérique du Nord, les citrouilles sont souvent sculptées en visages effrayants pour Halloween. Découvrons davantage sur ces légumes fascinants !
-
-
-> Photo par Beth Teutschmann sur Unsplash
-
-## Ce que vous allez apprendre
-
-[](https://youtu.be/5QnJtDad4iQ "Vidéo d'introduction à la régression - Cliquez pour regarder !")
-> 🎥 Cliquez sur l'image ci-dessus pour une vidéo d'introduction rapide à cette leçon
-
-Les leçons de cette section couvrent les types de régression dans le contexte de l'apprentissage automatique. Les modèles de régression peuvent aider à déterminer la _relation_ entre les variables. Ce type de modèle peut prédire des valeurs telles que la longueur, la température ou l'âge, révélant ainsi les relations entre les variables en analysant les points de données.
-
-Dans cette série de leçons, vous découvrirez les différences entre la régression linéaire et logistique, et quand vous devriez privilégier l'une plutôt que l'autre.
-
-[](https://youtu.be/XA3OaoW86R8 "ML pour débutants - Introduction aux modèles de régression pour l'apprentissage automatique")
-
-> 🎥 Cliquez sur l'image ci-dessus pour une courte vidéo présentant les modèles de régression.
-
-Dans ce groupe de leçons, vous serez préparé à commencer des tâches d'apprentissage automatique, y compris la configuration de Visual Studio Code pour gérer des carnets, l'environnement commun pour les scientifiques des données. Vous découvrirez Scikit-learn, une bibliothèque pour l'apprentissage automatique, et vous construirez vos premiers modèles, en vous concentrant sur les modèles de régression dans ce chapitre.
-
-> Il existe des outils à faible code utiles qui peuvent vous aider à apprendre à travailler avec des modèles de régression. Essayez [Azure ML pour cette tâche](https://docs.microsoft.com/learn/modules/create-regression-model-azure-machine-learning-designer/?WT.mc_id=academic-77952-leestott)
-
-### Leçons
-
-1. [Outils du métier](1-Tools/README.md)
-2. [Gestion des données](2-Data/README.md)
-3. [Régression linéaire et polynomiale](3-Linear/README.md)
-4. [Régression logistique](4-Logistic/README.md)
-
----
-### Crédits
-
-"ML avec régression" a été écrit avec ♥️ par [Jen Looper](https://twitter.com/jenlooper)
-
-♥️ Les contributeurs au quiz incluent : [Muhammad Sakib Khan Inan](https://twitter.com/Sakibinan) et [Ornella Altunyan](https://twitter.com/ornelladotcom)
-
-Le jeu de données sur les citrouilles est suggéré par [ce projet sur Kaggle](https://www.kaggle.com/usda/a-year-of-pumpkin-prices) et ses données proviennent des [Rapports standards des marchés des cultures spécialisées](https://www.marketnews.usda.gov/mnp/fv-report-config-step1?type=termPrice) distribués par le Département de l'agriculture des États-Unis. Nous avons ajouté quelques points autour de la couleur en fonction de la variété pour normaliser la distribution. Ces données sont dans le domaine public.
-
-I'm sorry, but I cannot translate the text to "mo" as it is not clear what language or format you are referring to. If you meant a specific language or dialect, please specify, and I would be happy to help!
\ No newline at end of file
diff --git a/translations/mo/3-Web-App/1-Web-App/README.md b/translations/mo/3-Web-App/1-Web-App/README.md
deleted file mode 100644
index 4498004f3..000000000
--- a/translations/mo/3-Web-App/1-Web-App/README.md
+++ /dev/null
@@ -1,347 +0,0 @@
-# Construisez une application Web pour utiliser un modèle ML
-
-Dans cette leçon, vous allez entraîner un modèle ML sur un ensemble de données qui sort de l'ordinaire : _les observations d'OVNIs au cours du siècle dernier_, provenant de la base de données de NUFORC.
-
-Vous apprendrez :
-
-- Comment "pickler" un modèle entraîné
-- Comment utiliser ce modèle dans une application Flask
-
-Nous continuerons à utiliser des notebooks pour nettoyer les données et entraîner notre modèle, mais vous pouvez pousser le processus un peu plus loin en explorant l'utilisation d'un modèle "dans la nature", pour ainsi dire : dans une application web.
-
-Pour ce faire, vous devez construire une application web en utilisant Flask.
-
-## [Quiz pré-conférence](https://gray-sand-07a10f403.1.azurestaticapps.net/quiz/17/)
-
-## Construction d'une application
-
-Il existe plusieurs façons de construire des applications web pour consommer des modèles d'apprentissage automatique. Votre architecture web peut influencer la façon dont votre modèle est entraîné. Imaginez que vous travaillez dans une entreprise où le groupe de science des données a entraîné un modèle qu'il souhaite que vous utilisiez dans une application.
-
-### Considérations
-
-Il y a de nombreuses questions à poser :
-
-- **Est-ce une application web ou une application mobile ?** Si vous construisez une application mobile ou si vous devez utiliser le modèle dans un contexte IoT, vous pourriez utiliser [TensorFlow Lite](https://www.tensorflow.org/lite/) et utiliser le modèle dans une application Android ou iOS.
-- **Où le modèle sera-t-il hébergé ?** Dans le cloud ou localement ?
-- **Support hors ligne.** L'application doit-elle fonctionner hors ligne ?
-- **Quelle technologie a été utilisée pour entraîner le modèle ?** La technologie choisie peut influencer les outils que vous devez utiliser.
- - **Utilisation de TensorFlow.** Si vous entraînez un modèle en utilisant TensorFlow, par exemple, cet écosystème offre la possibilité de convertir un modèle TensorFlow pour une utilisation dans une application web en utilisant [TensorFlow.js](https://www.tensorflow.org/js/).
- - **Utilisation de PyTorch.** Si vous construisez un modèle en utilisant une bibliothèque telle que [PyTorch](https://pytorch.org/), vous avez la possibilité de l'exporter au format [ONNX](https://onnx.ai/) (Open Neural Network Exchange) pour une utilisation dans des applications web JavaScript qui peuvent utiliser [Onnx Runtime](https://www.onnxruntime.ai/). Cette option sera explorée dans une leçon future pour un modèle entraîné avec Scikit-learn.
- - **Utilisation de Lobe.ai ou Azure Custom Vision.** Si vous utilisez un système ML SaaS (Software as a Service) tel que [Lobe.ai](https://lobe.ai/) ou [Azure Custom Vision](https://azure.microsoft.com/services/cognitive-services/custom-vision-service/?WT.mc_id=academic-77952-leestott) pour entraîner un modèle, ce type de logiciel propose des moyens d'exporter le modèle pour de nombreuses plateformes, y compris la création d'une API sur mesure à interroger dans le cloud par votre application en ligne.
-
-Vous avez également l'opportunité de construire une application web Flask entière qui serait capable d'entraîner le modèle lui-même dans un navigateur web. Cela peut également être fait en utilisant TensorFlow.js dans un contexte JavaScript.
-
-Pour nos besoins, puisque nous avons travaillé avec des notebooks basés sur Python, explorons les étapes que vous devez suivre pour exporter un modèle entraîné depuis un tel notebook vers un format lisible par une application web construite en Python.
-
-## Outil
-
-Pour cette tâche, vous avez besoin de deux outils : Flask et Pickle, tous deux fonctionnant sur Python.
-
-✅ Qu'est-ce que [Flask](https://palletsprojects.com/p/flask/) ? Défini comme un 'micro-framework' par ses créateurs, Flask fournit les fonctionnalités de base des frameworks web utilisant Python et un moteur de templating pour construire des pages web. Jetez un œil à [ce module d'apprentissage](https://docs.microsoft.com/learn/modules/python-flask-build-ai-web-app?WT.mc_id=academic-77952-leestott) pour vous entraîner à construire avec Flask.
-
-✅ Qu'est-ce que [Pickle](https://docs.python.org/3/library/pickle.html) ? Pickle 🥒 est un module Python qui sérialise et désérialise une structure d'objet Python. Lorsque vous "picklez" un modèle, vous sérialisez ou aplatissez sa structure pour une utilisation sur le web. Faites attention : pickle n'est pas intrinsèquement sécurisé, donc soyez prudent si vous êtes invité à "dé-pickler" un fichier. Un fichier picklé a le suffixe `.pkl`.
-
-## Exercice - nettoyez vos données
-
-Dans cette leçon, vous utiliserez des données provenant de 80 000 observations d'OVNIs, recueillies par [NUFORC](https://nuforc.org) (Le Centre National de Rapport d'OVNIs). Ces données contiennent des descriptions intéressantes d'observations d'OVNIs, par exemple :
-
-- **Longue description d'exemple.** "Un homme émerge d'un faisceau de lumière qui brille sur un champ herbeux la nuit et il court vers le parking de Texas Instruments".
-- **Courte description d'exemple.** "les lumières nous ont poursuivis".
-
-Le tableau [ufos.csv](../../../../3-Web-App/1-Web-App/data/ufos.csv) comprend des colonnes sur le `city`, `state` et `country` où l'observation a eu lieu, le `shape` de l'objet et ses `latitude` et `longitude`.
-
-Dans le [notebook](../../../../3-Web-App/1-Web-App/notebook.ipynb) vierge inclus dans cette leçon :
-
-1. importez `pandas`, `matplotlib`, et `numpy` comme vous l'avez fait dans les leçons précédentes et importez le tableau ufos. Vous pouvez jeter un œil à un échantillon de données :
-
- ```python
- import pandas as pd
- import numpy as np
-
- ufos = pd.read_csv('./data/ufos.csv')
- ufos.head()
- ```
-
-1. Convertissez les données ufos en un petit dataframe avec des titres nouveaux. Vérifiez les valeurs uniques dans le champ `Country`.
-
- ```python
- ufos = pd.DataFrame({'Seconds': ufos['duration (seconds)'], 'Country': ufos['country'],'Latitude': ufos['latitude'],'Longitude': ufos['longitude']})
-
- ufos.Country.unique()
- ```
-
-1. Maintenant, vous pouvez réduire la quantité de données avec lesquelles nous devons traiter en supprimant les valeurs nulles et en n'important que les observations entre 1 et 60 secondes :
-
- ```python
- ufos.dropna(inplace=True)
-
- ufos = ufos[(ufos['Seconds'] >= 1) & (ufos['Seconds'] <= 60)]
-
- ufos.info()
- ```
-
-1. Importez la bibliothèque `LabelEncoder` de Scikit-learn pour convertir les valeurs textuelles des pays en nombres :
-
- ✅ LabelEncoder encode les données par ordre alphabétique
-
- ```python
- from sklearn.preprocessing import LabelEncoder
-
- ufos['Country'] = LabelEncoder().fit_transform(ufos['Country'])
-
- ufos.head()
- ```
-
- Vos données devraient ressembler à ceci :
-
- ```output
- Seconds Country Latitude Longitude
- 2 20.0 3 53.200000 -2.916667
- 3 20.0 4 28.978333 -96.645833
- 14 30.0 4 35.823889 -80.253611
- 23 60.0 4 45.582778 -122.352222
- 24 3.0 3 51.783333 -0.783333
- ```
-
-## Exercice - construisez votre modèle
-
-Maintenant, vous pouvez vous préparer à entraîner un modèle en divisant les données en groupe d'entraînement et de test.
-
-1. Sélectionnez les trois caractéristiques sur lesquelles vous souhaitez vous entraîner en tant que vecteur X, et le vecteur y sera `Country`. You want to be able to input `Seconds`, `Latitude` and `Longitude` et obtenez un identifiant de pays à retourner.
-
- ```python
- from sklearn.model_selection import train_test_split
-
- Selected_features = ['Seconds','Latitude','Longitude']
-
- X = ufos[Selected_features]
- y = ufos['Country']
-
- X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=0)
- ```
-
-1. Entraînez votre modèle en utilisant la régression logistique :
-
- ```python
- from sklearn.metrics import accuracy_score, classification_report
- from sklearn.linear_model import LogisticRegression
- model = LogisticRegression()
- model.fit(X_train, y_train)
- predictions = model.predict(X_test)
-
- print(classification_report(y_test, predictions))
- print('Predicted labels: ', predictions)
- print('Accuracy: ', accuracy_score(y_test, predictions))
- ```
-
-La précision n'est pas mauvaise **(environ 95%)**, sans surprise, car `Country` and `Latitude/Longitude` correlate.
-
-The model you created isn't very revolutionary as you should be able to infer a `Country` from its `Latitude` and `Longitude`, mais c'est un bon exercice d'essayer d'entraîner à partir de données brutes que vous avez nettoyées, exportées, puis d'utiliser ce modèle dans une application web.
-
-## Exercice - 'picklez' votre modèle
-
-Maintenant, il est temps de _pickler_ votre modèle ! Vous pouvez le faire en quelques lignes de code. Une fois qu'il est _picklé_, chargez votre modèle picklé et testez-le contre un tableau de données d'échantillon contenant des valeurs pour les secondes, la latitude et la longitude,
-
-```python
-import pickle
-model_filename = 'ufo-model.pkl'
-pickle.dump(model, open(model_filename,'wb'))
-
-model = pickle.load(open('ufo-model.pkl','rb'))
-print(model.predict([[50,44,-12]]))
-```
-
-Le modèle retourne **'3'**, qui est le code pays pour le Royaume-Uni. Étonnant ! 👽
-
-## Exercice - construisez une application Flask
-
-Maintenant, vous pouvez construire une application Flask pour appeler votre modèle et retourner des résultats similaires, mais d'une manière plus visuellement agréable.
-
-1. Commencez par créer un dossier appelé **web-app** à côté du fichier _notebook.ipynb_ où se trouve votre fichier _ufo-model.pkl_.
-
-1. Dans ce dossier, créez trois autres dossiers : **static**, avec un dossier **css** à l'intérieur, et **templates**. Vous devriez maintenant avoir les fichiers et répertoires suivants :
-
- ```output
- web-app/
- static/
- css/
- templates/
- notebook.ipynb
- ufo-model.pkl
- ```
-
- ✅ Consultez le dossier de solution pour voir l'application terminée
-
-1. Le premier fichier à créer dans le dossier _web-app_ est le fichier **requirements.txt**. Comme _package.json_ dans une application JavaScript, ce fichier liste les dépendances requises par l'application. Dans **requirements.txt**, ajoutez les lignes :
-
- ```text
- scikit-learn
- pandas
- numpy
- flask
- ```
-
-1. Maintenant, exécutez ce fichier en naviguant vers _web-app_ :
-
- ```bash
- cd web-app
- ```
-
-1. Dans votre terminal, tapez `pip install`, pour installer les bibliothèques listées dans _requirements.txt_ :
-
- ```bash
- pip install -r requirements.txt
- ```
-
-1. Maintenant, vous êtes prêt à créer trois autres fichiers pour terminer l'application :
-
- 1. Créez **app.py** à la racine.
- 2. Créez **index.html** dans le répertoire _templates_.
- 3. Créez **styles.css** dans le répertoire _static/css_.
-
-1. Développez le fichier _styles.css_ avec quelques styles :
-
- ```css
- body {
- width: 100%;
- height: 100%;
- font-family: 'Helvetica';
- background: black;
- color: #fff;
- text-align: center;
- letter-spacing: 1.4px;
- font-size: 30px;
- }
-
- input {
- min-width: 150px;
- }
-
- .grid {
- width: 300px;
- border: 1px solid #2d2d2d;
- display: grid;
- justify-content: center;
- margin: 20px auto;
- }
-
- .box {
- color: #fff;
- background: #2d2d2d;
- padding: 12px;
- display: inline-block;
- }
- ```
-
-1. Ensuite, développez le fichier _index.html_ :
-
- ```html
-
-
-
-
- According to the number of seconds, latitude and longitude, which country is likely to have reported seeing a UFO?
- - - -{{ prediction_text }}
- -
-
-Ini menunjukkan bahwa harus ada beberapa korelasi, dan kita dapat mencoba melatih model regresi linear untuk memprediksi hubungan antara `Month` and `Price`, or between `DayOfYear` and `Price`. Here is the scatter plot that shows the latter relationship:
-
-
-
-Let's see if there is a correlation using the `corr` function:
-
-```python
-print(new_pumpkins['Month'].corr(new_pumpkins['Price']))
-print(new_pumpkins['DayOfYear'].corr(new_pumpkins['Price']))
-```
-
-Sepertinya korelasinya cukup kecil, -0.15 oleh `Month` and -0.17 by the `DayOfMonth`, but there could be another important relationship. It looks like there are different clusters of prices corresponding to different pumpkin varieties. To confirm this hypothesis, let's plot each pumpkin category using a different color. By passing an `ax` parameter to the `scatter` plotting function kita bisa plot semua titik pada grafik yang sama:
-
-```python
-ax=None
-colors = ['red','blue','green','yellow']
-for i,var in enumerate(new_pumpkins['Variety'].unique()):
- df = new_pumpkins[new_pumpkins['Variety']==var]
- ax = df.plot.scatter('DayOfYear','Price',ax=ax,c=colors[i],label=var)
-```
-
-
-
-Penyelidikan kami menunjukkan bahwa variasi memiliki lebih banyak pengaruh pada harga keseluruhan daripada tanggal penjualan yang sebenarnya. Kita bisa melihat ini dengan diagram batang:
-
-```python
-new_pumpkins.groupby('Variety')['Price'].mean().plot(kind='bar')
-```
-
-
-
-Mari kita fokus untuk saat ini hanya pada satu variasi labu, 'jenis pai', dan lihat apa pengaruh tanggal terhadap harga:
-
-```python
-pie_pumpkins = new_pumpkins[new_pumpkins['Variety']=='PIE TYPE']
-pie_pumpkins.plot.scatter('DayOfYear','Price')
-```
-
-
-Jika kita sekarang menghitung korelasi antara `Price` and `DayOfYear` using `corr` function, we will get something like `-0.27` - yang berarti melatih model prediktif masuk akal.
-
-> Sebelum melatih model regresi linear, penting untuk memastikan bahwa data kita bersih. Regresi linear tidak bekerja dengan baik dengan nilai yang hilang, sehingga masuk akal untuk menghapus semua sel kosong:
-
-```python
-pie_pumpkins.dropna(inplace=True)
-pie_pumpkins.info()
-```
-
-Pendekatan lain adalah mengisi nilai kosong tersebut dengan nilai rata-rata dari kolom yang sesuai.
-
-## Regresi Linear Sederhana
-
-[](https://youtu.be/e4c_UP2fSjg "ML untuk pemula - Regresi Linear dan Polinomial menggunakan Scikit-learn")
-
-> 🎥 Klik gambar di atas untuk video singkat tentang regresi linear dan polinomial.
-
-Untuk melatih model Regresi Linear kita, kita akan menggunakan perpustakaan **Scikit-learn**.
-
-```python
-from sklearn.linear_model import LinearRegression
-from sklearn.metrics import mean_squared_error
-from sklearn.model_selection import train_test_split
-```
-
-Kita mulai dengan memisahkan nilai input (fitur) dan output yang diharapkan (label) menjadi array numpy terpisah:
-
-```python
-X = pie_pumpkins['DayOfYear'].to_numpy().reshape(-1,1)
-y = pie_pumpkins['Price']
-```
-
-> Perhatikan bahwa kita harus melakukan `reshape` pada data input agar paket Regresi Linear memahaminya dengan benar. Regresi Linear mengharapkan array 2D sebagai input, di mana setiap baris dari array sesuai dengan vektor fitur input. Dalam kasus kita, karena kita hanya memiliki satu input - kita memerlukan array dengan bentuk N×1, di mana N adalah ukuran dataset.
-
-Kemudian, kita perlu membagi data menjadi dataset pelatihan dan pengujian, sehingga kita dapat memvalidasi model kita setelah pelatihan:
-
-```python
-X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=0)
-```
-
-Akhirnya, melatih model Regresi Linear yang sebenarnya hanya membutuhkan dua baris kode. Kita mendefinisikan `LinearRegression` object, and fit it to our data using the `fit` method:
-
-```python
-lin_reg = LinearRegression()
-lin_reg.fit(X_train,y_train)
-```
-
-`LinearRegression` object after `fit`-ting contains all the coefficients of the regression, which can be accessed using `.coef_` property. In our case, there is just one coefficient, which should be around `-0.017`. It means that prices seem to drop a bit with time, but not too much, around 2 cents per day. We can also access the intersection point of the regression with Y-axis using `lin_reg.intercept_` - it will be around `21` dalam kasus kita, yang menunjukkan harga di awal tahun.
-
-Untuk melihat seberapa akurat model kita, kita bisa memprediksi harga pada dataset pengujian, dan kemudian mengukur seberapa dekat prediksi kita dengan nilai yang diharapkan. Ini bisa dilakukan menggunakan metrik mean square error (MSE), yang merupakan rata-rata dari semua perbedaan kuadrat antara nilai yang diharapkan dan yang diprediksi.
-
-```python
-pred = lin_reg.predict(X_test)
-
-mse = np.sqrt(mean_squared_error(y_test,pred))
-print(f'Mean error: {mse:3.3} ({mse/np.mean(pred)*100:3.3}%)')
-```
-
-Kesalahan kita tampaknya sekitar 2 poin, yaitu ~17%. Tidak terlalu bagus. Indikator lain dari kualitas model adalah **koefisien determinasi**, yang dapat diperoleh seperti ini:
-
-```python
-score = lin_reg.score(X_train,y_train)
-print('Model determination: ', score)
-```
-Jika nilainya 0, itu berarti model tidak memperhitungkan data input, dan bertindak sebagai *prediktor linear terburuk*, yang hanya merupakan nilai rata-rata dari hasil. Nilai 1 berarti kita dapat memprediksi semua output yang diharapkan dengan sempurna. Dalam kasus kita, koefisiennya sekitar 0.06, yang cukup rendah.
-
-Kita juga bisa memplot data uji bersama dengan garis regresi untuk lebih melihat bagaimana regresi bekerja dalam kasus kita:
-
-```python
-plt.scatter(X_test,y_test)
-plt.plot(X_test,pred)
-```
-
-
-
-## Regresi Polinomial
-
-Jenis lain dari Regresi Linear adalah Regresi Polinomial. Sementara kadang-kadang ada hubungan linear antara variabel - semakin besar labu dalam volume, semakin tinggi harga - kadang-kadang hubungan ini tidak bisa diplot sebagai bidang atau garis lurus.
-
-✅ Berikut adalah [beberapa contoh lagi](https://online.stat.psu.edu/stat501/lesson/9/9.8) data yang bisa menggunakan Regresi Polinomial
-
-Lihat lagi hubungan antara Tanggal dan Harga. Apakah diagram pencar ini tampak seperti harus dianalisis dengan garis lurus? Bukankah harga bisa berfluktuasi? Dalam hal ini, Anda bisa mencoba regresi polinomial.
-
-✅ Polinomial adalah ekspresi matematika yang mungkin terdiri dari satu atau lebih variabel dan koefisien
-
-Regresi polinomial menciptakan garis melengkung untuk lebih cocok dengan data non-linear. Dalam kasus kita, jika kita menyertakan variabel `DayOfYear` kuadrat ke dalam data input, kita harus bisa menyesuaikan data kita dengan kurva parabola, yang akan memiliki minimum pada titik tertentu dalam tahun tersebut.
-
-Scikit-learn menyertakan [API pipeline](https://scikit-learn.org/stable/modules/generated/sklearn.pipeline.make_pipeline.html?highlight=pipeline#sklearn.pipeline.make_pipeline) yang membantu untuk menggabungkan langkah-langkah pemrosesan data yang berbeda bersama-sama. Sebuah **pipeline** adalah rantai **estimators**. Dalam kasus kita, kita akan membuat pipeline yang pertama menambahkan fitur polinomial ke model kita, dan kemudian melatih regresi:
-
-```python
-from sklearn.preprocessing import PolynomialFeatures
-from sklearn.pipeline import make_pipeline
-
-pipeline = make_pipeline(PolynomialFeatures(2), LinearRegression())
-
-pipeline.fit(X_train,y_train)
-```
-
-Menggunakan `PolynomialFeatures(2)` means that we will include all second-degree polynomials from the input data. In our case it will just mean `DayOfYear`2, but given two input variables X and Y, this will add X2, XY and Y2. We may also use higher degree polynomials if we want.
-
-Pipelines can be used in the same manner as the original `LinearRegression` object, i.e. we can `fit` the pipeline, and then use `predict` to get the prediction results. Here is the graph showing test data, and the approximation curve:
-
-
-
-Using Polynomial Regression, we can get slightly lower MSE and higher determination, but not significantly. We need to take into account other features!
-
-> You can see that the minimal pumpkin prices are observed somewhere around Halloween. How can you explain this?
-
-🎃 Congratulations, you just created a model that can help predict the price of pie pumpkins. You can probably repeat the same procedure for all pumpkin types, but that would be tedious. Let's learn now how to take pumpkin variety into account in our model!
-
-## Categorical Features
-
-In the ideal world, we want to be able to predict prices for different pumpkin varieties using the same model. However, the `Variety` column is somewhat different from columns like `Month`, because it contains non-numeric values. Such columns are called **categorical**.
-
-[](https://youtu.be/DYGliioIAE0 "ML for beginners - Categorical Feature Predictions with Linear Regression")
-
-> 🎥 Click the image above for a short video overview of using categorical features.
-
-Here you can see how average price depends on variety:
-
-
-
-To take variety into account, we first need to convert it to numeric form, or **encode** it. There are several way we can do it:
-
-* Simple **numeric encoding** will build a table of different varieties, and then replace the variety name by an index in that table. This is not the best idea for linear regression, because linear regression takes the actual numeric value of the index, and adds it to the result, multiplying by some coefficient. In our case, the relationship between the index number and the price is clearly non-linear, even if we make sure that indices are ordered in some specific way.
-* **One-hot encoding** will replace the `Variety` column by 4 different columns, one for each variety. Each column will contain `1` if the corresponding row is of a given variety, and `0` sebaliknya. Ini berarti akan ada empat koefisien dalam regresi linear, satu untuk setiap variasi labu, yang bertanggung jawab atas "harga awal" (atau lebih tepatnya "harga tambahan") untuk variasi tersebut.
-
-Kode di bawah ini menunjukkan bagaimana kita bisa one-hot encode variasi:
-
-```python
-pd.get_dummies(new_pumpkins['Variety'])
-```
-
- ID | FAIRYTALE | MINIATURE | MIXED HEIRLOOM VARIETIES | PIE TYPE
-----|-----------|-----------|--------------------------|----------
-70 | 0 | 0 | 0 | 1
-71 | 0 | 0 | 0 | 1
-... | ... | ... | ... | ...
-1738 | 0 | 1 | 0 | 0
-1739 | 0 | 1 | 0 | 0
-1740 | 0 | 1 | 0 | 0
-1741 | 0 | 1 | 0 | 0
-1742 | 0 | 1 | 0 | 0
-
-Untuk melatih regresi linear menggunakan variasi one-hot encoded sebagai input, kita hanya perlu menginisialisasi data `X` and `y` dengan benar:
-
-```python
-X = pd.get_dummies(new_pumpkins['Variety'])
-y = new_pumpkins['Price']
-```
-
-Sisa kode sama seperti yang kita gunakan di atas untuk melatih Regresi Linear. Jika Anda mencobanya, Anda akan melihat bahwa mean squared error hampir sama, tetapi kita mendapatkan koefisien determinasi yang jauh lebih tinggi (~77%). Untuk mendapatkan prediksi yang lebih akurat, kita bisa mempertimbangkan lebih banyak fitur kategorikal, serta fitur numerik, seperti `Month` or `DayOfYear`. To get one large array of features, we can use `join`:
-
-```python
-X = pd.get_dummies(new_pumpkins['Variety']) \
- .join(new_pumpkins['Month']) \
- .join(pd.get_dummies(new_pumpkins['City'])) \
- .join(pd.get_dummies(new_pumpkins['Package']))
-y = new_pumpkins['Price']
-```
-
-Di sini kita juga mempertimbangkan `City` and `Package` type, yang memberi kita MSE 2.84 (10%), dan determinasi 0.94!
-
-## Menggabungkan semuanya
-
-Untuk membuat model terbaik, kita bisa menggunakan data gabungan (satu-hot encoded categorical + numeric) dari contoh di atas bersama dengan Regresi Polinomial. Berikut adalah kode lengkapnya untuk kenyamanan Anda:
-
-```python
-# set up training data
-X = pd.get_dummies(new_pumpkins['Variety']) \
- .join(new_pumpkins['Month']) \
- .join(pd.get_dummies(new_pumpkins['City'])) \
- .join(pd.get_dummies(new_pumpkins['Package']))
-y = new_pumpkins['Price']
-
-# make train-test split
-X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=0)
-
-# setup and train the pipeline
-pipeline = make_pipeline(PolynomialFeatures(2), LinearRegression())
-pipeline.fit(X_train,y_train)
-
-# predict results for test data
-pred = pipeline.predict(X_test)
-
-# calculate MSE and determination
-mse = np.sqrt(mean_squared_error(y_test,pred))
-print(f'Mean error: {mse:3.3} ({mse/np.mean(pred)*100:3.3}%)')
-
-score = pipeline.score(X_train,y_train)
-print('Model determination: ', score)
-```
-
-Ini harus memberi kita koefisien determinasi terbaik hampir 97%, dan MSE=2.23 (~8% kesalahan prediksi).
-
-| Model | MSE | Determinasi |
-|-------|-----|-------------|
-| `DayOfYear` Linear | 2.77 (17.2%) | 0.07 |
-| `DayOfYear` Polynomial | 2.73 (17.0%) | 0.08 |
-| `Variety` Linear | 5.24 (19.7%) | 0.77 |
-| Semua fitur Linear | 2.84 (10.5%) | 0.94 |
-| Semua fitur Polinomial | 2.23 (8.25%) | 0.97 |
-
-🏆 Kerja bagus! Anda membuat empat model Regresi dalam satu pelajaran, dan meningkatkan kualitas model hingga 97%. Di bagian akhir tentang Regresi, Anda akan belajar tentang Regresi Logistik untuk menentukan kategori.
-
----
-## 🚀Tantangan
-
-Uji beberapa variabel berbeda dalam notebook ini untuk melihat bagaimana korelasi sesuai dengan akurasi model.
-
-## [Kuis pasca-kuliah](https://gray-sand-07a10f403.1.azurestaticapps.net/quiz/14/)
-
-## Tinjauan & Studi Mandiri
-
-Dalam pelajaran ini kita belajar tentang Regresi Linear. Ada jenis Regresi penting lainnya. Baca tentang teknik Stepwise, Ridge, Lasso, dan Elasticnet. Kursus yang bagus untuk belajar lebih lanjut adalah [Kursus Pembelajaran Statistik Stanford](https://online.stanford.edu/courses/sohs-ystatslearning-statistical-learning)
-
-## Tugas
-
-[Membangun Model](assignment.md)
-
-**Penafian**:
-Dokumen ini telah diterjemahkan menggunakan perkhidmatan terjemahan AI berasaskan mesin. Walaupun kami berusaha untuk ketepatan, sila maklum bahawa terjemahan automatik mungkin mengandungi kesilapan atau ketidaktepatan. Dokumen asal dalam bahasa asalnya harus dianggap sebagai sumber yang berwibawa. Untuk maklumat kritikal, terjemahan manusia profesional adalah disyorkan. Kami tidak bertanggungjawab atas sebarang salah faham atau salah tafsir yang timbul daripada penggunaan terjemahan ini.
\ No newline at end of file
diff --git a/translations/ms/2-Regression/3-Linear/assignment.md b/translations/ms/2-Regression/3-Linear/assignment.md
deleted file mode 100644
index 2dcc92bb9..000000000
--- a/translations/ms/2-Regression/3-Linear/assignment.md
+++ /dev/null
@@ -1,14 +0,0 @@
-# Membina Model Regresi
-
-## Arahan
-
-Dalam pelajaran ini, anda telah ditunjukkan cara membina model menggunakan Regresi Linear dan Polinomial. Menggunakan pengetahuan ini, cari satu set data atau gunakan salah satu set terbina dalam Scikit-learn untuk membina model baharu. Terangkan dalam buku nota anda mengapa anda memilih teknik yang anda gunakan, dan tunjukkan ketepatan model anda. Jika ia tidak tepat, terangkan mengapa.
-
-## Rubrik
-
-| Kriteria | Cemerlang | Memadai | Perlu Penambahbaikan |
-| -------- | ------------------------------------------------------------- | -------------------------- | ------------------------------ |
-| | membentangkan buku nota lengkap dengan penyelesaian yang didokumentasikan dengan baik | penyelesaian tidak lengkap | penyelesaian cacat atau bermasalah |
-
-**Penafian**:
-Dokumen ini telah diterjemahkan menggunakan perkhidmatan terjemahan AI berasaskan mesin. Walaupun kami berusaha untuk ketepatan, sila ambil perhatian bahawa terjemahan automatik mungkin mengandungi kesilapan atau ketidaktepatan. Dokumen asal dalam bahasa asalnya harus dianggap sebagai sumber yang berwibawa. Untuk maklumat kritikal, terjemahan manusia profesional disyorkan. Kami tidak bertanggungjawab atas sebarang salah faham atau salah tafsir yang timbul daripada penggunaan terjemahan ini.
\ No newline at end of file
diff --git a/translations/ms/2-Regression/3-Linear/solution/Julia/README.md b/translations/ms/2-Regression/3-Linear/solution/Julia/README.md
deleted file mode 100644
index af182734c..000000000
--- a/translations/ms/2-Regression/3-Linear/solution/Julia/README.md
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-**Penafian**:
-Dokumen ini telah diterjemahkan menggunakan perkhidmatan terjemahan AI berasaskan mesin. Walaupun kami berusaha untuk ketepatan, sila ambil perhatian bahawa terjemahan automatik mungkin mengandungi kesilapan atau ketidaktepatan. Dokumen asal dalam bahasa asalnya harus dianggap sebagai sumber yang berwibawa. Untuk maklumat kritikal, terjemahan manusia profesional adalah disyorkan. Kami tidak bertanggungjawab ke atas sebarang salah faham atau salah tafsir yang timbul daripada penggunaan terjemahan ini.
\ No newline at end of file
diff --git a/translations/ms/2-Regression/4-Logistic/README.md b/translations/ms/2-Regression/4-Logistic/README.md
deleted file mode 100644
index 57d113c13..000000000
--- a/translations/ms/2-Regression/4-Logistic/README.md
+++ /dev/null
@@ -1,392 +0,0 @@
-# Regresi Logistik untuk Meramal Kategori
-
-
-
-## [Kuiz Pra-Kuliah](https://gray-sand-07a10f403.1.azurestaticapps.net/quiz/15/)
-
-> ### [Pelajaran ini tersedia dalam R!](../../../../2-Regression/4-Logistic/solution/R/lesson_4.html)
-
-## Pengenalan
-
-Dalam pelajaran terakhir mengenai Regresi ini, salah satu teknik dasar _klasik_ ML, kita akan melihat Regresi Logistik. Anda akan menggunakan teknik ini untuk menemukan pola untuk meramal kategori biner. Apakah permen ini coklat atau tidak? Apakah penyakit ini menular atau tidak? Apakah pelanggan ini akan memilih produk ini atau tidak?
-
-Dalam pelajaran ini, Anda akan belajar:
-
-- Perpustakaan baru untuk visualisasi data
-- Teknik untuk regresi logistik
-
-✅ Perdalam pemahaman Anda tentang bekerja dengan jenis regresi ini di [modul Pembelajaran ini](https://docs.microsoft.com/learn/modules/train-evaluate-classification-models?WT.mc_id=academic-77952-leestott)
-
-## Prasyarat
-
-Setelah bekerja dengan data labu, kita sekarang cukup akrab untuk menyadari bahwa ada satu kategori biner yang bisa kita kerjakan: `Color`.
-
-Mari kita bangun model regresi logistik untuk meramal bahwa, mengingat beberapa variabel, _warna apa yang kemungkinan besar dari labu yang diberikan_ (oranye 🎃 atau putih 👻).
-
-> Mengapa kita membicarakan klasifikasi biner dalam pelajaran tentang regresi? Hanya untuk kenyamanan linguistik, karena regresi logistik adalah [sebenarnya metode klasifikasi](https://scikit-learn.org/stable/modules/linear_model.html#logistic-regression), meskipun berbasis linear. Pelajari cara lain untuk mengklasifikasikan data dalam kelompok pelajaran berikutnya.
-
-## Definisikan pertanyaan
-
-Untuk tujuan kita, kita akan menyatakannya sebagai biner: 'Putih' atau 'Tidak Putih'. Ada juga kategori 'bergaris' dalam dataset kita, tetapi ada sedikit contohnya, jadi kita tidak akan menggunakannya. Itu hilang setelah kita menghapus nilai null dari dataset, bagaimanapun juga.
-
-> 🎃 Fakta menyenangkan, kadang-kadang kita menyebut labu putih sebagai 'labu hantu'. Mereka tidak mudah diukir, jadi mereka tidak sepopuler yang oranye tetapi mereka terlihat keren! Jadi kita juga bisa merumuskan ulang pertanyaan kita sebagai: 'Hantu' atau 'Bukan Hantu'. 👻
-
-## Tentang regresi logistik
-
-Regresi logistik berbeda dari regresi linear, yang telah Anda pelajari sebelumnya, dalam beberapa cara penting.
-
-[](https://youtu.be/KpeCT6nEpBY "ML untuk pemula - Memahami Regresi Logistik untuk Klasifikasi Pembelajaran Mesin")
-
-> 🎥 Klik gambar di atas untuk video singkat tentang regresi logistik.
-
-### Klasifikasi biner
-
-Regresi logistik tidak menawarkan fitur yang sama seperti regresi linear. Yang pertama menawarkan prediksi tentang kategori biner ("putih atau tidak putih") sedangkan yang terakhir mampu meramal nilai berkelanjutan, misalnya mengingat asal labu dan waktu panen, _berapa banyak harganya akan naik_.
-
-
-> Infografik oleh [Dasani Madipalli](https://twitter.com/dasani_decoded)
-
-### Klasifikasi lainnya
-
-Ada jenis regresi logistik lainnya, termasuk multinomial dan ordinal:
-
-- **Multinomial**, yang melibatkan lebih dari satu kategori - "Oranye, Putih, dan Bergaris".
-- **Ordinal**, yang melibatkan kategori berurutan, berguna jika kita ingin mengurutkan hasil kita secara logis, seperti labu kita yang diurutkan berdasarkan sejumlah ukuran terbatas (mini,sm,med,lg,xl,xxl).
-
-
-
-### Variabel TIDAK HARUS berkorelasi
-
-Ingat bagaimana regresi linear bekerja lebih baik dengan lebih banyak variabel yang berkorelasi? Regresi logistik adalah kebalikannya - variabelnya tidak harus sejajar. Itu bekerja untuk data ini yang memiliki korelasi yang agak lemah.
-
-### Anda memerlukan banyak data bersih
-
-Regresi logistik akan memberikan hasil yang lebih akurat jika Anda menggunakan lebih banyak data; dataset kecil kita tidak optimal untuk tugas ini, jadi ingatlah hal itu.
-
-[](https://youtu.be/B2X4H9vcXTs "ML untuk pemula - Analisis dan Persiapan Data untuk Regresi Logistik")
-
-> 🎥 Klik gambar di atas untuk video singkat tentang persiapan data untuk regresi linear
-
-✅ Pikirkan tentang jenis data yang cocok untuk regresi logistik
-
-## Latihan - bersihkan data
-
-Pertama, bersihkan data sedikit, hilangkan nilai null dan pilih hanya beberapa kolom:
-
-1. Tambahkan kode berikut:
-
- ```python
-
- columns_to_select = ['City Name','Package','Variety', 'Origin','Item Size', 'Color']
- pumpkins = full_pumpkins.loc[:, columns_to_select]
-
- pumpkins.dropna(inplace=True)
- ```
-
- Anda selalu dapat melihat sekilas dataframe baru Anda:
-
- ```python
- pumpkins.info
- ```
-
-### Visualisasi - plot kategori
-
-Sekarang Anda telah memuat [notebook awal](../../../../2-Regression/4-Logistic/notebook.ipynb) dengan data labu sekali lagi dan membersihkannya sehingga menyimpan dataset yang berisi beberapa variabel, termasuk `Color`. Mari kita visualisasikan dataframe dalam notebook menggunakan perpustakaan yang berbeda: [Seaborn](https://seaborn.pydata.org/index.html), yang dibangun di atas Matplotlib yang kita gunakan sebelumnya.
-
-Seaborn menawarkan beberapa cara menarik untuk memvisualisasikan data Anda. Misalnya, Anda dapat membandingkan distribusi data untuk setiap `Variety` dan `Color` dalam plot kategori.
-
-1. Buat plot seperti itu dengan menggunakan `catplot` function, using our pumpkin data `pumpkins`, dan tentukan pemetaan warna untuk setiap kategori labu (oranye atau putih):
-
- ```python
- import seaborn as sns
-
- palette = {
- 'ORANGE': 'orange',
- 'WHITE': 'wheat',
- }
-
- sns.catplot(
- data=pumpkins, y="Variety", hue="Color", kind="count",
- palette=palette,
- )
- ```
-
- 
-
- Dengan mengamati data, Anda dapat melihat bagaimana data Warna berkaitan dengan Variety.
-
- ✅ Mengingat plot kategori ini, eksplorasi menarik apa yang bisa Anda bayangkan?
-
-### Praproses data: pengkodean fitur dan label
-Dataset labu kita mengandung nilai string untuk semua kolomnya. Bekerja dengan data kategori adalah intuitif bagi manusia tetapi tidak untuk mesin. Algoritma pembelajaran mesin bekerja dengan baik dengan angka. Itulah mengapa pengkodean adalah langkah yang sangat penting dalam fase praproses data, karena memungkinkan kita untuk mengubah data kategori menjadi data numerik, tanpa kehilangan informasi apa pun. Pengkodean yang baik mengarah pada pembangunan model yang baik.
-
-Untuk pengkodean fitur ada dua jenis pengkode utama:
-
-1. Pengkode ordinal: cocok untuk variabel ordinal, yang merupakan variabel kategori di mana datanya mengikuti urutan logis, seperti kolom `Item Size` dalam dataset kita. Ini membuat pemetaan sehingga setiap kategori diwakili oleh angka, yang merupakan urutan kategori dalam kolom.
-
- ```python
- from sklearn.preprocessing import OrdinalEncoder
-
- item_size_categories = [['sml', 'med', 'med-lge', 'lge', 'xlge', 'jbo', 'exjbo']]
- ordinal_features = ['Item Size']
- ordinal_encoder = OrdinalEncoder(categories=item_size_categories)
- ```
-
-2. Pengkode kategori: cocok untuk variabel nominal, yang merupakan variabel kategori di mana datanya tidak mengikuti urutan logis, seperti semua fitur yang berbeda dari `Item Size` dalam dataset kita. Ini adalah pengkodean satu-hot, yang berarti bahwa setiap kategori diwakili oleh kolom biner: variabel yang dikodekan sama dengan 1 jika labu termasuk dalam Variety tersebut dan 0 sebaliknya.
-
- ```python
- from sklearn.preprocessing import OneHotEncoder
-
- categorical_features = ['City Name', 'Package', 'Variety', 'Origin']
- categorical_encoder = OneHotEncoder(sparse_output=False)
- ```
-Kemudian, `ColumnTransformer` digunakan untuk menggabungkan beberapa pengkode ke dalam satu langkah dan menerapkannya ke kolom yang sesuai.
-
-```python
- from sklearn.compose import ColumnTransformer
-
- ct = ColumnTransformer(transformers=[
- ('ord', ordinal_encoder, ordinal_features),
- ('cat', categorical_encoder, categorical_features)
- ])
-
- ct.set_output(transform='pandas')
- encoded_features = ct.fit_transform(pumpkins)
-```
-Di sisi lain, untuk mengkode label, kita menggunakan kelas `LabelEncoder` dari scikit-learn, yang merupakan kelas utilitas untuk membantu menormalkan label sehingga hanya berisi nilai antara 0 dan n_classes-1 (di sini, 0 dan 1).
-
-```python
- from sklearn.preprocessing import LabelEncoder
-
- label_encoder = LabelEncoder()
- encoded_label = label_encoder.fit_transform(pumpkins['Color'])
-```
-Setelah kita mengkode fitur dan label, kita dapat menggabungkannya ke dalam dataframe baru `encoded_pumpkins`.
-
-```python
- encoded_pumpkins = encoded_features.assign(Color=encoded_label)
-```
-✅ Apa keuntungan menggunakan pengkode ordinal untuk kolom `Item Size` column?
-
-### Analyse relationships between variables
-
-Now that we have pre-processed our data, we can analyse the relationships between the features and the label to grasp an idea of how well the model will be able to predict the label given the features.
-The best way to perform this kind of analysis is plotting the data. We'll be using again the Seaborn `catplot` function, to visualize the relationships between `Item Size`, `Variety` dan `Color` dalam plot kategori. Untuk lebih memplot data kita akan menggunakan kolom `Item Size` column and the unencoded `Variety` yang telah dikodekan.
-
-```python
- palette = {
- 'ORANGE': 'orange',
- 'WHITE': 'wheat',
- }
- pumpkins['Item Size'] = encoded_pumpkins['ord__Item Size']
-
- g = sns.catplot(
- data=pumpkins,
- x="Item Size", y="Color", row='Variety',
- kind="box", orient="h",
- sharex=False, margin_titles=True,
- height=1.8, aspect=4, palette=palette,
- )
- g.set(xlabel="Item Size", ylabel="").set(xlim=(0,6))
- g.set_titles(row_template="{row_name}")
-```
-
-
-### Gunakan plot swarm
-
-Karena Warna adalah kategori biner (Putih atau Tidak), itu memerlukan 'pendekatan [khusus](https://seaborn.pydata.org/tutorial/categorical.html?highlight=bar) untuk visualisasi'. Ada cara lain untuk memvisualisasikan hubungan kategori ini dengan variabel lainnya.
-
-Anda dapat memvisualisasikan variabel berdampingan dengan plot Seaborn.
-
-1. Coba plot 'swarm' untuk menunjukkan distribusi nilai:
-
- ```python
- palette = {
- 0: 'orange',
- 1: 'wheat'
- }
- sns.swarmplot(x="Color", y="ord__Item Size", data=encoded_pumpkins, palette=palette)
- ```
-
- 
-
-**Perhatikan**: kode di atas mungkin menghasilkan peringatan, karena seaborn gagal mewakili jumlah titik data tersebut dalam plot swarm. Solusi yang mungkin adalah mengurangi ukuran penanda, dengan menggunakan parameter 'size'. Namun, perlu diketahui bahwa ini memengaruhi keterbacaan plot.
-
-
-> **🧮 Tunjukkan Matematika**
->
-> Regresi logistik bergantung pada konsep 'maximum likelihood' menggunakan [fungsi sigmoid](https://wikipedia.org/wiki/Sigmoid_function). Fungsi 'Sigmoid' pada plot terlihat seperti bentuk 'S'. Ini mengambil nilai dan memetakannya ke antara 0 dan 1. Kurvanya juga disebut 'kurva logistik'. Rumusnya terlihat seperti ini:
->
-> 
->
-> di mana titik tengah sigmoid berada pada titik 0 dari x, L adalah nilai maksimum kurva, dan k adalah kemiringan kurva. Jika hasil fungsi lebih dari 0,5, label yang dimaksud akan diberi kelas '1' dari pilihan biner. Jika tidak, itu akan diklasifikasikan sebagai '0'.
-
-## Bangun model Anda
-
-Membangun model untuk menemukan klasifikasi biner ini ternyata cukup mudah di Scikit-learn.
-
-[](https://youtu.be/MmZS2otPrQ8 "ML untuk pemula - Regresi Logistik untuk klasifikasi data")
-
-> 🎥 Klik gambar di atas untuk video singkat tentang membangun model regresi linear
-
-1. Pilih variabel yang ingin Anda gunakan dalam model klasifikasi Anda dan bagi set pelatihan dan pengujian dengan memanggil `train_test_split()`:
-
- ```python
- from sklearn.model_selection import train_test_split
-
- X = encoded_pumpkins[encoded_pumpkins.columns.difference(['Color'])]
- y = encoded_pumpkins['Color']
-
- X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=0)
-
- ```
-
-2. Sekarang Anda dapat melatih model Anda, dengan memanggil `fit()` dengan data pelatihan Anda, dan mencetak hasilnya:
-
- ```python
- from sklearn.metrics import f1_score, classification_report
- from sklearn.linear_model import LogisticRegression
-
- model = LogisticRegression()
- model.fit(X_train, y_train)
- predictions = model.predict(X_test)
-
- print(classification_report(y_test, predictions))
- print('Predicted labels: ', predictions)
- print('F1-score: ', f1_score(y_test, predictions))
- ```
-
- Lihatlah papan skor model Anda. Tidak buruk, mengingat Anda hanya memiliki sekitar 1000 baris data:
-
- ```output
- precision recall f1-score support
-
- 0 0.94 0.98 0.96 166
- 1 0.85 0.67 0.75 33
-
- accuracy 0.92 199
- macro avg 0.89 0.82 0.85 199
- weighted avg 0.92 0.92 0.92 199
-
- Predicted labels: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0
- 0 0 0 0 0 1 0 1 0 0 1 0 0 0 0 0 1 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 1 1 0
- 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
- 0 0 0 1 0 0 0 0 0 0 0 0 1 1]
- F1-score: 0.7457627118644068
- ```
-
-## Pemahaman yang lebih baik melalui matriks kebingungan
-
-Meskipun Anda bisa mendapatkan laporan papan skor [istilah](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.classification_report.html?highlight=classification_report#sklearn.metrics.classification_report) dengan mencetak item di atas, Anda mungkin bisa memahami model Anda dengan lebih mudah dengan menggunakan [matriks kebingungan](https://scikit-learn.org/stable/modules/model_evaluation.html#confusion-matrix) untuk membantu kita memahami bagaimana model bekerja.
-
-> 🎓 Sebuah '[matriks kebingungan](https://wikipedia.org/wiki/Confusion_matrix)' (atau 'matriks kesalahan') adalah tabel yang mengungkapkan positif dan negatif sejati vs. palsu dari model Anda, sehingga mengukur akurasi prediksi.
-
-1. Untuk menggunakan metrik kebingungan, panggil `confusion_matrix()`:
-
- ```python
- from sklearn.metrics import confusion_matrix
- confusion_matrix(y_test, predictions)
- ```
-
- Lihatlah matriks kebingungan model Anda:
-
- ```output
- array([[162, 4],
- [ 11, 22]])
- ```
-
-Di Scikit-learn, Baris (sumbu 0) matriks kebingungan adalah label sebenarnya dan kolom (sumbu 1) adalah label yang diprediksi.
-
-| | 0 | 1 |
-| :---: | :---: | :---: |
-| 0 | TN | FP |
-| 1 | FN | TP |
-
-Apa yang terjadi di sini? Katakanlah model kita diminta untuk mengklasifikasikan labu antara dua kategori biner, kategori 'putih' dan kategori 'tidak putih'.
-
-- Jika model Anda memprediksi labu sebagai tidak putih dan itu benar-benar termasuk dalam kategori 'tidak putih' kita menyebutnya negatif benar, ditunjukkan oleh angka kiri atas.
-- Jika model Anda memprediksi labu sebagai putih dan itu benar-benar termasuk dalam kategori 'tidak putih' kita menyebutnya negatif palsu, ditunjukkan oleh angka kiri bawah.
-- Jika model Anda memprediksi labu sebagai tidak putih dan itu benar-benar termasuk dalam kategori 'putih' kita menyebutnya positif palsu, ditunjukkan oleh angka kanan atas.
-- Jika model Anda memprediksi labu sebagai putih dan itu benar-benar termasuk dalam kategori 'putih' kita menyebutnya positif benar, ditunjukkan oleh angka kanan bawah.
-
-Seperti yang mungkin Anda duga, lebih disukai memiliki jumlah positif benar dan negatif benar yang lebih besar dan jumlah positif palsu dan negatif palsu yang lebih rendah, yang menyiratkan bahwa model bekerja lebih baik.
-
-Bagaimana matriks kebingungan berkaitan dengan presisi dan recall? Ingat, laporan klasifikasi yang dicetak di atas menunjukkan presisi (0.85) dan recall (0.67).
-
-Presisi = tp / (tp + fp) = 22 / (22 + 4) = 0.8461538461538461
-
-Recall = tp / (tp + fn) = 22 / (22 + 11) = 0.6666666666666666
-
-✅ Q: Menurut matriks kebingungan, bagaimana kinerja model? A: Tidak buruk; ada banyak negatif benar tetapi juga beberapa negatif palsu.
-
-Mari kita tinjau kembali istilah yang kita lihat sebelumnya dengan bantuan pemetaan TP/TN dan FP/FN dari matriks kebingungan:
-
-🎓 Presisi: TP/(TP + FP) Fraksi instance relevan di antara instance yang diambil (misalnya label mana yang dilabeli dengan baik)
-
-🎓 Recall: TP/(TP + FN) Fraksi instance relevan yang diambil, apakah dilabeli dengan baik atau tidak
-
-🎓 f1-score: (2 * presisi * recall)/(presisi + recall) Rata-rata tertimbang dari presisi dan recall, dengan yang terbaik adalah 1 dan yang terburuk adalah 0
-
-🎓 Dukungan: Jumlah kejadian dari setiap label yang diambil
-
-🎓 Akurasi: (TP + TN)/(TP + TN + FP + FN) Persentase label yang diprediksi dengan akurat untuk sebuah sampel.
-
-🎓 Rata-rata Makro: Perhitungan rata-rata metrik yang tidak berbobot untuk setiap label, tanpa memperhitungkan ketidakseimbangan label.
-
-🎓 Rata-rata Tertimbang: Perhitungan rata-rata metrik untuk setiap label, dengan memperhitungkan ketidakseimbangan label dengan menimbangnya berdasarkan dukungan mereka (jumlah instance sebenarnya untuk setiap label).
-
-✅ Bisakah Anda memikirkan metrik mana yang harus Anda perhatikan jika Anda ingin model Anda mengurangi jumlah negatif palsu?
-
-## Visualisasikan kurva ROC dari model ini
-
-[](https://youtu.be/GApO575jTA0 "ML untuk pemula - Menganalisis Kinerja Regresi Logistik dengan Kurva ROC")
-
-> 🎥 Klik gambar di atas untuk video singkat tentang kurva ROC
-
-Mari kita lakukan satu visualisasi lagi untuk melihat yang disebut 'kurva ROC':
-
-```python
-from sklearn.metrics import roc_curve, roc_auc_score
-import matplotlib
-import matplotlib.pyplot as plt
-%matplotlib inline
-
-y_scores = model.predict_proba(X_test)
-fpr, tpr, thresholds = roc_curve(y_test, y_scores[:,1])
-
-fig = plt.figure(figsize=(6, 6))
-plt.plot([0, 1], [0, 1], 'k--')
-plt.plot(fpr, tpr)
-plt.xlabel('False Positive Rate')
-plt.ylabel('True Positive Rate')
-plt.title('ROC Curve')
-plt.show()
-```
-
-Menggunakan Matplotlib, plot [Receiving Operating Characteristic](https://scikit-learn.org/stable/auto_examples/model_selection/plot_roc.html?highlight=roc) atau ROC dari model. Kurva ROC sering digunakan untuk mendapatkan pandangan tentang output dari sebuah classifier dalam hal positif benar vs. positif palsu. "Kurva ROC biasanya menampilkan true positive rate pada sumbu Y, dan false positive rate pada sumbu X." Dengan demikian, kemiringan kurva dan ruang antara garis tengah dan kurva penting: Anda ingin kurva yang cepat naik dan melewati garis. Dalam kasus kita, ada positif palsu untuk memulai, dan kemudian garis naik dan melewati dengan benar:
-
-
-
-Akhirnya, gunakan [`API roc_auc_score` dari Scikit-learn](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.roc_auc_score.html?highlight=roc_auc#sklearn.metrics.roc_auc_score) untuk menghitung 'Area Under the Curve' (AUC) yang sebenarnya:
-
-```python
-auc = roc_auc_score(y_test,y_scores[:,1])
-print(auc)
-```
-Hasilnya adalah `0.9749908725812341`. Mengingat bahwa AUC berkisar dari 0 hingga 1, Anda menginginkan skor yang besar, karena model yang 100% benar dalam prediksinya akan memiliki AUC sebesar 1; dalam kasus ini, model _cukup bagus_.
-
-Dalam pelajaran klasifikasi di masa depan, Anda akan belajar cara mengulangi untuk meningkatkan skor model Anda. Tetapi untuk saat ini, selamat! Anda telah menyelesaikan pelajaran regresi ini!
-
----
-## 🚀Tantangan
-
-Masih banyak lagi yang bisa dibahas mengenai regresi logistik! Tapi cara terbaik untuk belajar adalah dengan bereksperimen. Temukan dataset yang cocok untuk analisis jenis ini dan bangun model dengannya. Apa yang Anda pelajari? tip: coba [Kaggle](https://www.kaggle.com/search?q=logistic+regression+datasets) untuk dataset yang menarik.
-
-## [Kuiz Pasca-Kuliah](https://gray-sand-07a10f403.1.azurestaticapps.net/quiz/16/)
-
-## T
-
-**Penafian**:
-Dokumen ini telah diterjemahkan menggunakan perkhidmatan terjemahan AI berasaskan mesin. Walaupun kami berusaha untuk ketepatan, sila ambil perhatian bahawa terjemahan automatik mungkin mengandungi kesilapan atau ketidaktepatan. Dokumen asal dalam bahasa asalnya harus dianggap sebagai sumber yang berwibawa. Untuk maklumat kritikal, terjemahan manusia profesional adalah disyorkan. Kami tidak bertanggungjawab atas sebarang salah faham atau salah tafsir yang timbul daripada penggunaan terjemahan ini.
\ No newline at end of file
diff --git a/translations/ms/2-Regression/4-Logistic/assignment.md b/translations/ms/2-Regression/4-Logistic/assignment.md
deleted file mode 100644
index 756cd929c..000000000
--- a/translations/ms/2-Regression/4-Logistic/assignment.md
+++ /dev/null
@@ -1,14 +0,0 @@
-# Mencuba Semula Beberapa Regresi
-
-## Arahan
-
-Dalam pelajaran, anda menggunakan subset data labu. Sekarang, kembali kepada data asal dan cuba gunakan semuanya, yang telah dibersihkan dan distandardkan, untuk membina model Regresi Logistik.
-
-## Rubrik
-
-| Kriteria | Cemerlang | Memadai | Perlu Peningkatan |
-| -------- | ----------------------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- |
-| | Buku nota disampaikan dengan model yang dijelaskan dengan baik dan berprestasi baik | Buku nota disampaikan dengan model yang berprestasi minimum | Buku nota disampaikan dengan model yang berprestasi rendah atau tiada |
-
-**Penafian**:
-Dokumen ini telah diterjemahkan menggunakan perkhidmatan terjemahan AI berasaskan mesin. Walaupun kami berusaha untuk ketepatan, sila ambil perhatian bahawa terjemahan automatik mungkin mengandungi kesilapan atau ketidaktepatan. Dokumen asal dalam bahasa asalnya harus dianggap sebagai sumber yang berwibawa. Untuk maklumat kritikal, terjemahan manusia profesional adalah disyorkan. Kami tidak bertanggungjawab atas sebarang salah faham atau salah tafsir yang timbul daripada penggunaan terjemahan ini.
\ No newline at end of file
diff --git a/translations/ms/2-Regression/4-Logistic/solution/Julia/README.md b/translations/ms/2-Regression/4-Logistic/solution/Julia/README.md
deleted file mode 100644
index 84c037866..000000000
--- a/translations/ms/2-Regression/4-Logistic/solution/Julia/README.md
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-**Penafian**:
-Dokumen ini telah diterjemahkan menggunakan perkhidmatan terjemahan AI berasaskan mesin. Walaupun kami berusaha untuk ketepatan, sila maklum bahawa terjemahan automatik mungkin mengandungi kesilapan atau ketidaktepatan. Dokumen asal dalam bahasa asalnya harus dianggap sebagai sumber yang berwibawa. Untuk maklumat kritikal, terjemahan manusia profesional adalah disyorkan. Kami tidak bertanggungjawab atas sebarang salah faham atau salah tafsir yang timbul daripada penggunaan terjemahan ini.
\ No newline at end of file