<?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 Re: Hosting R apps and models in Machine Learning</title>
    <link>https://community.databricks.com/t5/machine-learning/hosting-r-apps-and-models/m-p/101490#M3828</link>
    <description>&lt;P&gt;Great, thanks! We'll have a look and try to implement it. I'll share the results as soon as we have some &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 09 Dec 2024 15:45:36 GMT</pubDate>
    <dc:creator>AntonDBUser</dc:creator>
    <dc:date>2024-12-09T15:45:36Z</dc:date>
    <item>
      <title>Hosting R apps and models</title>
      <link>https://community.databricks.com/t5/machine-learning/hosting-r-apps-and-models/m-p/101375#M3824</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;Has anyone tried to host an R Shiny app using Databricks apps? It is very useful for Python apps, but it would be nice to know if anyone have any workaround to make it work with R Shiny Apps.&lt;/P&gt;&lt;P&gt;We also wonder about Databricks model hosting for R models. Is it even possible using some workarounds?&lt;/P&gt;&lt;P&gt;Appreciate any input on this!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Dec 2024 12:44:47 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/hosting-r-apps-and-models/m-p/101375#M3824</guid>
      <dc:creator>AntonDBUser</dc:creator>
      <dc:date>2024-12-08T12:44:47Z</dc:date>
    </item>
    <item>
      <title>Re: Hosting R apps and models</title>
      <link>https://community.databricks.com/t5/machine-learning/hosting-r-apps-and-models/m-p/101455#M3825</link>
      <description>&lt;P data-renderer-start-pos="51"&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/102636"&gt;@AntonDBUser&lt;/a&gt;,&lt;/P&gt;
&lt;P data-renderer-start-pos="51"&gt;Please refer to these posts for R Shiny using Databricks Apps -&amp;nbsp;&lt;A href="https://docs.databricks.com/en/sparkr/shiny.html#id8," target="_blank"&gt;https://docs.databricks.com/en/sparkr/shiny.html#id8,&lt;/A&gt; &lt;A href="https://community.databricks.com/t5/machine-learning/host-r-shiny-app/m-p/22992" target="_blank"&gt;https://community.databricks.com/t5/machine-learning/host-r-shiny-app/m-p/22992&lt;/A&gt;&lt;/P&gt;
&lt;P data-renderer-start-pos="51"&gt;For R Models hosting,&amp;nbsp;&lt;SPAN&gt;we recommend using Posit Connect.&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL class="ak-ul" data-indent-level="1"&gt;
&lt;LI&gt;
&lt;P data-renderer-start-pos="139"&gt;Useful Resources &lt;BR /&gt;&lt;A class="cc-1rn59kg" title="https://posit.co/blog/databricks-udfs/" href="https://posit.co/blog/databricks-udfs/" data-testid="link-with-safety" data-renderer-mark="true" target="_blank"&gt;&lt;U data-renderer-mark="true"&gt;Parallelize R code using user-defined functions (UDFs) in sparklyr - Posit&lt;/U&gt;&lt;/A&gt;&lt;/P&gt;
&lt;UL class="ak-ul" data-indent-level="2"&gt;
&lt;LI&gt;
&lt;P data-renderer-start-pos="235"&gt;Install the necessary packages and set up your credentials, it remotely access Databricks cluster through R Studio&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P data-renderer-start-pos="353"&gt;Use sparklyr to access your Databricks cluster in RStudio.With sparklyr, you can execute distributed R code within the Spark environment in Databricks cluster.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P data-renderer-start-pos="516"&gt;Train a machine learning model and run predictions using spark udf&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P data-renderer-start-pos="586"&gt;Save the trained model as an R object&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P data-renderer-start-pos="627"&gt;Upload the R object to Databricks, save it as a pin, or store it in another suitable location&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P data-renderer-start-pos="724"&gt;Use the vetiver package to store the model as a pin and deploy it as a REST API on Posit Connect&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P data-renderer-start-pos="826"&gt;Other blogs&lt;/P&gt;
&lt;UL class="ak-ul" data-indent-level="2"&gt;
&lt;LI&gt;
&lt;P data-renderer-start-pos="841"&gt;&lt;A class="cc-1rn59kg" title="https://www.databricks.com/blog/databricks-and-posit-announce-new-integrations" href="https://www.databricks.com/blog/databricks-and-posit-announce-new-integrations" data-testid="link-with-safety" data-renderer-mark="true" target="_blank"&gt;&lt;U data-renderer-mark="true"&gt;Databricks and Posit announce new integrations, simplifying Lakehouse access for developers&lt;/U&gt;&lt;/A&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P data-renderer-start-pos="936"&gt;&lt;A class="cc-1rn59kg" title="https://posit.co/blog/databricks-shiny-r-app/" href="https://posit.co/blog/databricks-shiny-r-app/" data-testid="link-with-safety" data-renderer-mark="true" target="_blank"&gt;&lt;U data-renderer-mark="true"&gt;From Databricks to Posit Connect: Building and Deploying a Shiny for R Application&lt;/U&gt;&lt;/A&gt;\&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P data-renderer-start-pos="1116"&gt;While it is technically possible to serve R models without Posit Connect, it involves several complex adjustments.&lt;/P&gt;
&lt;P data-renderer-start-pos="1234"&gt;Below are the steps and options available:&lt;/P&gt;
&lt;OL start="1" data-indent-level="1"&gt;
&lt;LI&gt;
&lt;P data-renderer-start-pos="1280"&gt;Create a MLflow Run and Log the R Model and get a MLflow URI:&lt;/P&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;UL data-indent-level="1"&gt;
&lt;LI&gt;
&lt;P data-renderer-start-pos="1347"&gt;Use the 'crate' flavor to log the R model within an experiment&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P data-renderer-start-pos="1413"&gt;Include a list of required package versions or an renv lockfile.&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P data-renderer-start-pos="1481"&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL start="2" data-indent-level="1"&gt;
&lt;LI&gt;
&lt;P data-renderer-start-pos="1485"&gt;Add Additional Artifacts:&lt;/P&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;UL data-indent-level="1"&gt;
&lt;LI&gt;
&lt;P data-renderer-start-pos="1516"&gt;Create a `pyfunc` that wraps the R model&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P data-renderer-start-pos="1560"&gt;&amp;nbsp;&amp;nbsp;Copy the model artifacts into a new model.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P data-renderer-start-pos="1608"&gt;&amp;nbsp;&amp;nbsp;Generate `conda.yml`.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P data-renderer-start-pos="1635"&gt;&amp;nbsp;&amp;nbsp;Adjust the `conda_env.yaml` to include `r-base` to add R to the container image.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P data-renderer-start-pos="1721"&gt;&amp;nbsp;&amp;nbsp;Detect the version of R.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P data-renderer-start-pos="1751"&gt;&amp;nbsp;&amp;nbsp;Use `rpy2` to set up the predict method and pass parameters to it.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P data-renderer-start-pos="1823"&gt;&amp;nbsp;The `pyfunc` must use `rpy2` to load and invoke the R model.&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Mon, 09 Dec 2024 10:36:34 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/hosting-r-apps-and-models/m-p/101455#M3825</guid>
      <dc:creator>parthSundarka</dc:creator>
      <dc:date>2024-12-09T10:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: Hosting R apps and models</title>
      <link>https://community.databricks.com/t5/machine-learning/hosting-r-apps-and-models/m-p/101479#M3826</link>
      <description>&lt;P&gt;Thanks a lot for the input and reply! A lot of good material, tips and resources!&amp;nbsp;&lt;/P&gt;&lt;P&gt;We're already using the Shiny Notebooks hosting, but we're wondering if it was possible to migrate to the new Databricks Apps? Seems like a better fit, and we also saw that it also supports Shiny, but that might be only the Python implementation of Shiny? Do you recommend to stay with Notebook hosting for now?&lt;BR /&gt;&lt;BR /&gt;For the model hosting we're already crate and adding the renv when logging to mlflow, but not the Pyfunc wrapping. We'll give that a try. Do you have some code examples for the second part "&lt;SPAN&gt;Add Additional Artifacts"? That would be really helpfull!&lt;BR /&gt;&lt;BR /&gt;BR,&lt;BR /&gt;Anton&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2024 14:38:28 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/hosting-r-apps-and-models/m-p/101479#M3826</guid>
      <dc:creator>AntonDBUser</dc:creator>
      <dc:date>2024-12-09T14:38:28Z</dc:date>
    </item>
    <item>
      <title>Re: Hosting R apps and models</title>
      <link>https://community.databricks.com/t5/machine-learning/hosting-r-apps-and-models/m-p/101488#M3827</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/102636"&gt;@AntonDBUser&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Do you recommend to stay with Notebook hosting for now? - Unfortunately yes as R support for Databricks Apps is a Feature request for now internally. It would be a great feature to have and is also considered for Future.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Do you have some code examples for the second part?-&amp;nbsp; I am attaching a few files with some sample code, which might not work out of the box but would give a good idea on how can it be used. Hopefully it helps &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Kind Regards,&lt;/P&gt;
&lt;P&gt;Parth&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2024 15:35:10 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/hosting-r-apps-and-models/m-p/101488#M3827</guid>
      <dc:creator>parthSundarka</dc:creator>
      <dc:date>2024-12-09T15:35:10Z</dc:date>
    </item>
    <item>
      <title>Re: Hosting R apps and models</title>
      <link>https://community.databricks.com/t5/machine-learning/hosting-r-apps-and-models/m-p/101490#M3828</link>
      <description>&lt;P&gt;Great, thanks! We'll have a look and try to implement it. I'll share the results as soon as we have some &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2024 15:45:36 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/hosting-r-apps-and-models/m-p/101490#M3828</guid>
      <dc:creator>AntonDBUser</dc:creator>
      <dc:date>2024-12-09T15:45:36Z</dc:date>
    </item>
    <item>
      <title>Re: Hosting R apps and models</title>
      <link>https://community.databricks.com/t5/machine-learning/hosting-r-apps-and-models/m-p/101831#M3835</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/102636"&gt;@AntonDBUser&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Did you get a chance to test this? Let me know if the above solution can be marked as accepted.&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 21:02:08 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/hosting-r-apps-and-models/m-p/101831#M3835</guid>
      <dc:creator>parthSundarka</dc:creator>
      <dc:date>2024-12-11T21:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: Hosting R apps and models</title>
      <link>https://community.databricks.com/t5/machine-learning/hosting-r-apps-and-models/m-p/110173#M3965</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/135558"&gt;@parthSundarka&lt;/a&gt;!&lt;BR /&gt;&lt;BR /&gt;We tried, but had some problems making it work. Do you have a more complete code example? That would be very helpfull!&lt;BR /&gt;BR, Anton&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2025 07:42:16 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/hosting-r-apps-and-models/m-p/110173#M3965</guid>
      <dc:creator>AntonDBUser</dc:creator>
      <dc:date>2025-02-14T07:42:16Z</dc:date>
    </item>
  </channel>
</rss>

