How to pass categorical features to Linear Regression modeling in PySpark MLlib?
<p>I was working on <code>Linear Regression</code> modeling in <code>PySpark</code> and have a doubt regrading that. The data that I have has <code>categorical features</code>. I went through the documentation on <code>PySpark</code> and the example for <code>Linear Regression</code> shows this:</p>

<pre><code>model = LinearRegressionWithSGD.train(parsedData)
</code></pre>

<p>It does not show how to pass the <code>categorical features</code> to <code>Linear Regression</code>. I have worked on <code>Random Forest</code> in <code>PySpark</code> before where I first <code>encoded</code> <code>categorical features</code> and then passed these features to the model as <code>Random Forest</code> provides a <code>parameter</code> to specify the <code>categorical features</code>. The <code>Linear Regression</code> does not show any such parameter in the documentation.</p>

<p>Can anyone help me by providing me the way to pass <code>categorical feature</code> to <code>Linear Regression</code> modeling in <code>PySpark</code> <code>MLlib</code></p>