<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Workbench exits every time lm.fit command is run in python 2 in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Workbench-exits-every-time-lm-fit-command-is-run-in-python-2/m-p/60759#M69231</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can reproduce the "Engine exited with status 2." if I'm using the&amp;nbsp;v1 engine but it works with the v2 engine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What version are you using?&amp;nbsp;&lt;/P&gt;&lt;P&gt;- If you are using 1.0.x then I recommend upgrading to 1.1.1.&lt;/P&gt;&lt;P&gt;- If you are already using 1.1.1 then you should use the v2 engine. You can go to your Settings menu on the Project page and select the "&lt;SPAN&gt;Base Image v2, docker.repository.cloudera.com/cdsw/engine:2" on the Engines tab. You can also change the default engine in the Admin menu but it will be applied to new projects, for already existing ones you need to select it manually.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;</description>
    <pubDate>Mon, 09 Oct 2017 18:21:23 GMT</pubDate>
    <dc:creator>peter_ableda</dc:creator>
    <dc:date>2017-10-09T18:21:23Z</dc:date>
    <item>
      <title>Workbench exits every time lm.fit command is run in python 2</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Workbench-exits-every-time-lm-fit-command-is-run-in-python-2/m-p/60758#M69230</link>
      <description>&lt;P&gt;Trying to run the below code for boston housing linear regression analysis:&lt;/P&gt;&lt;P&gt;import pandas as pd&lt;BR /&gt;import matplotlib.pyplot as plt&lt;BR /&gt;import numpy as np&lt;BR /&gt;import scipy.stats as stats&lt;BR /&gt;import sklearn&lt;BR /&gt;from sklearn.datasets import load_boston&lt;BR /&gt;%matplotlib inline&lt;/P&gt;&lt;P&gt;boston = load_boston() #Load the dataset&lt;BR /&gt;#This creates a dictionary that has data inside of it. ls look at the keys of this dictionary&lt;BR /&gt;print boston.keys()&lt;/P&gt;&lt;P&gt;#print boston.data&lt;BR /&gt;#So this a matrix of datapoints.&lt;BR /&gt;print boston.data.shape&lt;BR /&gt;#We have 506 rows and 13 columns&lt;/P&gt;&lt;P&gt;#Lets see if we can learn more about these 506 rows&lt;BR /&gt;print boston.DESCR&lt;BR /&gt;boston_df = pd.DataFrame(boston.data)&lt;BR /&gt;boston_df.head()&lt;BR /&gt;boston_df.columns = boston.feature_names&lt;BR /&gt;boston_df.head()&lt;/P&gt;&lt;P&gt;boston_df.describe()&lt;BR /&gt;X = boston_df&lt;BR /&gt;y = boston.target&lt;/P&gt;&lt;P&gt;from sklearn.linear_model import LinearRegression&lt;BR /&gt;lm = LinearRegression()&lt;/P&gt;&lt;P&gt;lm.fit(X, y)&lt;BR /&gt;print 'Estimated intercept coefficent:', lm.intercept_&lt;BR /&gt;print 'Number of coefficients:', len(lm.coef_)&lt;/P&gt;&lt;P&gt;pd.DataFrame(zip(boston_df.columns, lm.coef_), columns=['feature', 'coefficient'])&lt;/P&gt;&lt;P&gt;print "Predicted House price", lm.predict(X)[41] * 1000&lt;BR /&gt;print "Equation house price", (lm.intercept_ + np.dot(lm.coef_, X.iloc[[41]].values[0])) * 1000&lt;BR /&gt;print "Target price", y[41] * 1000&lt;/P&gt;&lt;P&gt;print "Residual price", (lm.predict(X)[41] - y[41]) * 1000&lt;/P&gt;&lt;P&gt;print "R^2 =", lm.score(X, y)&lt;/P&gt;&lt;P&gt;plt.scatter(y, lm.predict(X))&lt;BR /&gt;plt.xlabel('Prices: $Y_i$')&lt;BR /&gt;plt.ylabel('PredictedPrices: $\hat{Y}_i$')&lt;BR /&gt;plt.title('Actual vs Predicted')&lt;BR /&gt;plt.plot()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Keep getting this exit error each time:&lt;/P&gt;&lt;P&gt;&amp;nbsp;lm = LinearRegression()&lt;BR /&gt;lm.fit(X, y)&lt;BR /&gt;Engine exited with status 2.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2026 13:28:33 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Workbench-exits-every-time-lm-fit-command-is-run-in-python-2/m-p/60758#M69230</guid>
      <dc:creator>nehanirmal</dc:creator>
      <dc:date>2026-04-21T13:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: Workbench exits every time lm.fit command is run in python 2</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Workbench-exits-every-time-lm-fit-command-is-run-in-python-2/m-p/60759#M69231</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can reproduce the "Engine exited with status 2." if I'm using the&amp;nbsp;v1 engine but it works with the v2 engine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What version are you using?&amp;nbsp;&lt;/P&gt;&lt;P&gt;- If you are using 1.0.x then I recommend upgrading to 1.1.1.&lt;/P&gt;&lt;P&gt;- If you are already using 1.1.1 then you should use the v2 engine. You can go to your Settings menu on the Project page and select the "&lt;SPAN&gt;Base Image v2, docker.repository.cloudera.com/cdsw/engine:2" on the Engines tab. You can also change the default engine in the Admin menu but it will be applied to new projects, for already existing ones you need to select it manually.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2017 18:21:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Workbench-exits-every-time-lm-fit-command-is-run-in-python-2/m-p/60759#M69231</guid>
      <dc:creator>peter_ableda</dc:creator>
      <dc:date>2017-10-09T18:21:23Z</dc:date>
    </item>
  </channel>
</rss>

