title: How to deploy model, when model has dummy columns?
body: <p>I have categorical column so, I convert them as dummy columns and use minmax scaling for rest of integer columns. And I fit this converted data into model. Now when deploying the model (<strong>Flask</strong>) how deploy.</p>
  <p>After get variable input from HTML how to convert them as dummy variables as like model?</p>
  <p>Please provide any samples if possible for deployment file with dummy columns.</p>
  <p>This is my deployment code for model which has dummy columns (<em>app.py</em>)</p>
  <pre><code>    int_features = [x for x in request.form.values()]
      #int_features = pd.DataFrame([np.array(int_features)], columns=['age', 'workclass', 'fnlwgt','education', 'education_num', 'marital_status', 'occupation', 'relationship', 'race', 'sex', 'capital_gain', 'capital_loss', 'hpw', 'country'])
      df = pd.read_csv('adult.csv').drop('salary', axis = 'columns')
      df.append(int_features, ignore_index = True)
      df_new = pd.get_dummies(df, drop_first=True)
      def norm_func(i):
          x = (i-i.min()) /(i.max()-i.min())
          return(x)
  
      df_new = norm_func(df_new)
      
      final = pd.DataFrame(df_new.iloc[-1:,])
      inputs = pd.DataFrame(df.iloc[-1:,])
      prediction = int(model.predict(final))
      return render_template('final1.html', data = inputs, prediction_text='Result: {}'.format(prediction))
  
  </code></pre>
  <p>I append with input data with main data in order to use the dummy variables conversion and minmax scaler (which is <em>norm_func</em>). After conversion spilt end row of data from full data (which is input from user), predict for the row and display the result.</p>
  <p>Am correctly doing this or wrong?</p>