<?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>topic Using open source node to run simple sklearn model in SAS Data Science</title>
    <link>https://communities.sas.com/t5/SAS-Data-Science/Using-open-source-node-to-run-simple-sklearn-model/m-p/696544#M8474</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have followed the demo and example code to run a simple Random Forest model using Open Source Node in Model Studio.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code is able to run as Preprocessing node but not Supervised Learning. My gut is telling me I might miss define some required variable in order to render the Assessment, but I can not figure out why, could you help to take a look? Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;from sklearn.ensemble import RandomForestClassifier
import pandas as pd
X = dm_traindf.loc[:, dm_input]
y = dm_traindf[dm_dec_target]

params = {'n_estimators': 100}
dm_model = RandomForestClassifier(**params)
dm_model.fit(X, y)

fullX = dm_inputdf.loc[:, dm_input]
dm_scoreddf = pd.DataFrame(dm_model.predict_proba(fullX), columns=['P__va_d_ped_death_bin0', 'P__va_d_ped_death_bin1'])&lt;/PRE&gt;&lt;P&gt;More information, the name of the target is "&lt;SPAN&gt;_va_d_ped_death_bin" and it is interval, but it only has 0 and 1 value.&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Nov 2020 15:28:04 GMT</pubDate>
    <dc:creator>DaisyQL</dc:creator>
    <dc:date>2020-11-04T15:28:04Z</dc:date>
    <item>
      <title>Using open source node to run simple sklearn model</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Using-open-source-node-to-run-simple-sklearn-model/m-p/696544#M8474</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have followed the demo and example code to run a simple Random Forest model using Open Source Node in Model Studio.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code is able to run as Preprocessing node but not Supervised Learning. My gut is telling me I might miss define some required variable in order to render the Assessment, but I can not figure out why, could you help to take a look? Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;from sklearn.ensemble import RandomForestClassifier
import pandas as pd
X = dm_traindf.loc[:, dm_input]
y = dm_traindf[dm_dec_target]

params = {'n_estimators': 100}
dm_model = RandomForestClassifier(**params)
dm_model.fit(X, y)

fullX = dm_inputdf.loc[:, dm_input]
dm_scoreddf = pd.DataFrame(dm_model.predict_proba(fullX), columns=['P__va_d_ped_death_bin0', 'P__va_d_ped_death_bin1'])&lt;/PRE&gt;&lt;P&gt;More information, the name of the target is "&lt;SPAN&gt;_va_d_ped_death_bin" and it is interval, but it only has 0 and 1 value.&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 15:28:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Using-open-source-node-to-run-simple-sklearn-model/m-p/696544#M8474</guid>
      <dc:creator>DaisyQL</dc:creator>
      <dc:date>2020-11-04T15:28:04Z</dc:date>
    </item>
    <item>
      <title>Re: Using open source node to run simple sklearn model</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Using-open-source-node-to-run-simple-sklearn-model/m-p/696609#M8475</link>
      <description>&lt;P&gt;Actually, I just figure it out and I was able to run the python model. after this fix:&lt;/P&gt;&lt;PRE&gt;dm_scoreddf = pd.DataFrame(dm_model.predict(fullX), columns=['P__va_d_ped_death_bin'])&lt;/PRE&gt;&lt;P&gt;So what happened is I copied the example code without checking. For interval variable "_va_d_ped_death_bin", the script did not recognize the levels. Once I fix how to create the&amp;nbsp;dm_scoreddf it works afterwards&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 17:45:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Using-open-source-node-to-run-simple-sklearn-model/m-p/696609#M8475</guid>
      <dc:creator>DaisyQL</dc:creator>
      <dc:date>2020-11-04T17:45:13Z</dc:date>
    </item>
  </channel>
</rss>

