Answers.Body: <p>In general these steps are correct, but are few clarifications would be good. For supervised learning, you can:</p>
  
  <ol>
  <li>pick model to use</li>
  <li>split data into training and test set</li>
  <li>train model, or determine weights by optimization of our error function (inputting in training data)</li>
  <li>use trained model to predict on test data</li>
  <li>utilize metrics of interest to evaluate our model (e.g. MSE for continuous outcomes, AUC for binary)</li>
  </ol>
  
  <p>This however is a very elementary pipeline to train a supervised machine learning model. There are many other steps taken to ensure our model is as robust as possible (like cross validation, feature selection, hyperparameter optimization, model selection...). I would strongly recommend learning about these other steps and seeing how they integrate with the above pipeline.</p>
  
  <hr>
  
  <p>For unsupervised learning, the process depends a lot on the task, but in general it involves optimizing some objective function using the data provided. This is usually done using all the data in one go (not split into training and test) unlike supervised learning. This can be seen more clearly with examples, take methods like PCA and k clustering; the steps taken to apply these methods very much depend on the method used.</p>
  
  <hr>
  
  <p>Going further, I would recommend Andrew Ng's coursera course on machine learning. It is very accessible and a great introduction to this field, covering both unsupervised/supervised learning.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-07T14:54:59.213Z
Answers.LastActivityDate: 2018-12-07T18:09:11.143Z
Answers.LastEditDate: 2018-12-07T18:09:11.143Z
Answers.UserDisplayName: sma
Body: <p>I am new to machine learning. I know Logistic Regression (LR) is a supervised learning technique. Therefore, we need training data to train the model.</p>
  <p>I tried to understand the basic steps to get the final RL model.
  According to my understanding, here are the steps.</p>
  <ol>
  <li><p>We define the LR model, that is, <span class="math-container">$y = \text{sigmoid}(W x + B)$</span>. Set <span class="math-container">$W$</span> and <span class="math-container">$B$</span> to zero or another value.</p>
  </li>
  <li><p>Given the training data (the inputs are <span class="math-container">$x_1, x_2, \dots, x_m$</span>, and the outputs are <span class="math-container">$y_1, y_2, \dots, y_m$</span>), we find <span class="math-container">$W$</span> and <span class="math-container">$B$</span> values by minimizing a cost function using gradient descent.</p>
  </li>
  <li><p>Then we use the found <span class="math-container">$W$</span> and <span class="math-container">$B$</span> values. We then again apply a known sample from the training data <span class="math-container">$\hat{x}$</span> to get the predicting of <span class="math-container">$\hat{y}$</span>, that is, <span class="math-container">$\hat{y} = \text{sigmoid}(W \hat{x} + B)$</span>.</p>
  </li>
  <li><p>We test the final model on unknown data.</p>
  </li>
  </ol>
  <p>Are these steps correct?</p>
  <p>Please, if you could also give me the basic idea behind the supervised technique, I would appreciate it.</p>
  
Tags: <machine-learning><training><supervised-learning><logistic-regression>
Title: Are these steps to get a final linear regression model correct?
UserDisplayName: Ind
ThreadText: # Are these steps to get a final linear regression model correct?
  
  (Asked by: username_0 on 2018-11-27)
  
  I am new to machine learning. I know Logistic Regression (LR) is a supervised learning technique. Therefore, we need training data to train the model.
  
  I tried to understand the basic steps to get the final RL model.
  According to my understanding, here are the steps.
  
  1. We define the LR model, that is, $y = \text{sigmoid}(W x + B)$. Set $W$ and $B$ to zero or another value.
  2. Given the training data (the inputs are $x\_1, x\_2, \dots, x\_m$, and the outputs are $y\_1, y\_2, \dots, y\_m$), we find $W$ and $B$ values by minimizing a cost function using gradient descent.
  3. Then we use the found $W$ and $B$ values. We then again apply a known sample from the training data $\hat{x}$ to get the predicting of $\hat{y}$, that is, $\hat{y} = \text{sigmoid}(W \hat{x} + B)$.
  4. We test the final model on unknown data.
  
  Are these steps correct?
  
  Please, if you could also give me the basic idea behind the supervised technique, I would appreciate it.
  
  **Tags:** machine-learning, training, supervised-learning, logistic-regression
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-12-07. Score: 2
  
  In general these steps are correct, but are few clarifications would be good. For supervised learning, you can:
  
  1. pick model to use
  2. split data into training and test set
  3. train model, or determine weights by optimization of our error function (inputting in training data)
  4. use trained model to predict on test data
  5. utilize metrics of interest to evaluate our model (e.g. MSE for continuous outcomes, AUC for binary)
  
  This however is a very elementary pipeline to train a supervised machine learning model. There are many other steps taken to ensure our model is as robust as possible (like cross validation, feature selection, hyperparameter optimization, model selection...). I would strongly recommend learning about these other steps and seeing how they integrate with the above pipeline.
  
  ---
  
  For unsupervised learning, the process depends a lot on the task, but in general it involves optimizing some objective function using the data provided. This is usually done using all the data in one go (not split into training and test) unlike supervised learning. This can be seen more clearly with examples, take methods like PCA and k clustering; the steps taken to apply these methods very much depend on the method used.
  
  ---
  
  Going further, I would recommend Andrew Ng's coursera course on machine learning. It is very accessible and a great introduction to this field, covering both unsupervised/supervised learning.
  
  
  ---
  
  