<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Kinfey Lo</title>
    <description>The latest articles on DEV Community by Kinfey Lo (@kinfey).</description>
    <link>https://dev.to/kinfey</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F688646%2Faebc907b-9fee-49b8-96e5-05a53736664c.jpeg</url>
      <title>DEV Community: Kinfey Lo</title>
      <link>https://dev.to/kinfey</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kinfey"/>
    <language>en</language>
    <item>
      <title>.NET Core in Artificial Intelligence Series-Introduction to .NET Interactive</title>
      <dc:creator>Kinfey Lo</dc:creator>
      <pubDate>Thu, 26 Aug 2021 06:48:22 +0000</pubDate>
      <link>https://dev.to/kinfey/net-core-in-artificial-intelligence-series-introduction-to-net-interactive-5cc0</link>
      <guid>https://dev.to/kinfey/net-core-in-artificial-intelligence-series-introduction-to-net-interactive-5cc0</guid>
      <description>&lt;p&gt;Before entering the artificial intelligence application of .NET Core, we first set up the environment to provide a convenience for future learning.&lt;/p&gt;

&lt;p&gt;As a .NET programmer, or programmer of other programming languages, I believe that the dependence on IDE is essential, such as Visual Studio/Visual Studio Code, IntelliJ, Eclipse, etc. But for a person engaged in data science, compared with traditional programming, they prefer to use Notebook as the main tool for data science work. Through the overview of the study, you may know this important point of knowledge, but the specifics still have to be introduced to you as follows. Environment configuration, we also start from .NET Interactive.&lt;/p&gt;

&lt;h2&gt;&lt;b&gt;Why use Jupyter Notebook?&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2-smzCgm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mg7zzuuyvaq2mu730b7l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2-smzCgm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mg7zzuuyvaq2mu730b7l.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s take a look at what Jupyter Notebook is. Jupyter is a free, open source, interactive network tool called a computing notebook. Researchers can use it to combine software code, computing output, explanatory text, and multimedia resources in a single document. Jupyter Notebook has the following features:&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Data analysis:&lt;/b&gt; Jupyter Notebook allows users to view the results of the code online without relying on other parts of the code. In the notebook, you can check each cell of the code at any time to draw the output. Therefore, unlike traditional IDEs, Jupyter Notebook facilitates online printouts, which is very useful for exploratory data analysis (EDA) processes.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Each cell has a cache:&lt;/b&gt; It is difficult for traditional development tools to retain the execution status of each line, but Jupyter Notebook can cache the results of each line-whether it is the local code for training the ML model or remotely The code downloaded by the service.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;It has nothing to do with programming language:&lt;/b&gt; It supports multiple languages ​​and multiple formats.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Data visualization:&lt;/b&gt; As a component, Jupyter Notebook supports visualization and includes rendering some data sets, such as graphs and charts, which are generated from code with the help of modules such as Matplotlib, Plotly or Bokeh. Jupyter allows users to visualize narratives while sharing code and data sets, enabling others to make interactive changes.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Real-time interaction with code:&lt;/b&gt; Jupyter Notebook uses the "ipywidgets" package, which provides a standard user interface for exploring the interactivity of code and data. Therefore, the code can be edited by the user or sent to re-run, making the Jupyter code non-static. It allows the user to control the input source of the code and provide feedback directly on the browser.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Record code examples:&lt;/b&gt; Jupyter allows users to easily explain their code line by line with feedback. Even better, with Jupyter, users can add interactivity and explanation, while the code is fully functional.&lt;/p&gt;

&lt;h2&gt;&lt;b&gt;Introduce .NET Interactive &lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;.NET Interactive is a more flexible way of code interaction, focusing on data browsing and sorting. You can think of it as a .NET plugin under Jupyter Notebook. If you have ever been try Xamarin, you will find that it is very similar to Xamarin Workbooks. You can write simple code through .NET Interactive, and you can also introduce related packages through Nuget, allowing you to perform better in data analysis, code exploration, and machine learning scenarios. You are familiar with .NET Core technology.&lt;/p&gt;

&lt;p&gt;.NET Interactive is a plug-in developed by the .NET team, which can support the use of traditional Jupyter Notebook pages, or you can install the plug-in of .NET Interactive through Visual Studio Code to develop directly in the IDE.&lt;/p&gt;

&lt;h2&gt;&lt;b&gt;Install .NET Interactive &lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;The installation of .NET Interactive requires Python and the installation of JupyterNotebook, so you need to install Python on your machine (it is recommended to install the 3.8.x Python version), if you install Python successfully, you need to install it through the command line&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip3 &lt;span class="nb"&gt;install &lt;/span&gt;jupyter
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After the installation is successful, don’t forget to install .NET Core on this machine. .NET Interactive supports the .NET Core 3.x+ version (it is recommended to install the .NET Core 5.x version on this machine). After the installation is successful, you can use the dotnet tool .NET Interactive is installed&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dotnet tool &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--global&lt;/span&gt; Microsoft.dotnet-interactive
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; dotnet tool needs to configure the global PATH, otherwise it will affect the operation of dotnet-interactive (for the dotnet tool path documentation, please refer to &lt;a href="https://docs.microsoft.com/en-%20us/dotnet/core/tools/dotnet-tool-install"&gt;&lt;/a&gt;&lt;a href="https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-tool-install"&gt;https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-tool-install&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Bind .NET Interactive to Jupyter Notebook&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dotnet-interactive jupyter &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check whether .NET Interactive has been added to the support environment of Jupyter Notebook by running the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;jupyter kernelspec list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YRTh12sz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s96wicnf3c68gf6cc20v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YRTh12sz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s96wicnf3c68gf6cc20v.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After completing the above related operations, you can directly call .NET Interactive through Jupyter Notebook to use C#/F# to complete data science work.&lt;/p&gt;

&lt;p&gt;You can run it through the command line&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;jupyter notebook
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice:&lt;/p&gt;

&lt;p&gt;If you are running jupyter notebook for the first time, you may be prompted to enter a password, you can complete the password modification work through the following link&lt;/p&gt;

&lt;p&gt;&lt;a href="https://jupyter-notebook.readthedocs.io/en/stable/public_server.html"&gt;&lt;/a&gt;&lt;a href="https://jupyter-notebook.readthedocs.io/en/stable/public_server.html"&gt;https://jupyter-notebook.readthedocs.io/en/stable/public_server.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QNs_JGVd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/522p8e8mwf330bvqsfmi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QNs_JGVd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/522p8e8mwf330bvqsfmi.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you want to get more knowledge of Jupyter Notebook, you can visit the following link&lt;/p&gt;

&lt;p&gt;&lt;a href="https://jupyter-notebook.readthedocs.io/en/stable/"&gt;&lt;/a&gt;&lt;a href="https://jupyter-notebook.readthedocs.io/en/stable/"&gt;https://jupyter-notebook.readthedocs.io/en/stable/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can also run the Notebook application directly after installing .NET Interactive through Visual Studio Code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--02Vng-26--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kb8j4wh2zdpdvtsa2wvk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--02Vng-26--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kb8j4wh2zdpdvtsa2wvk.png"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LiqAN2yp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sggogmz96n2goy0t554g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LiqAN2yp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sggogmz96n2goy0t554g.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;&lt;b&gt;Sample A&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;Create a folder anywhere on the command line of the machine, then enter the folder and input jupyter notebook directly&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;demoapp
&lt;span class="nb"&gt;cd &lt;/span&gt;demoapp
jupyter notebook
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BwW21R3e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lvrohyt1hrojow3d1vix.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BwW21R3e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lvrohyt1hrojow3d1vix.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Open the browser and enter &lt;a href="http://localhost:8888"&gt;http://localhost:8888&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OVMrgSvB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/txggltkx69j01p0xpqao.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OVMrgSvB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/txggltkx69j01p0xpqao.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Create a new notebook file by clicking New and selecting C#&lt;/p&gt;

&lt;p&gt;input these codes cell by cell&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System.Text.Json&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System.Text.Json.Serialization&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ReactorInfo&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;Name&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;Title&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;info&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;ReactorInfo&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;Name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Kinfey"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Title&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"Reactor Guest"&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;infoString&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;JsonSerializer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Serialize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;info&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;infoString&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note here that through the "+" in the menu bar to increase the line&lt;/p&gt;

&lt;p&gt;Then press Run to run the code line by line, you can see the following results&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GbXE1D47--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qfpq9xbd95i9ei12bsys.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GbXE1D47--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qfpq9xbd95i9ei12bsys.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;&lt;b&gt;Sample B&lt;/b&gt;&lt;/h2&gt;

&lt;p&gt;Create a .ipynb file in Visual Studio Code (.ipynb is the default file of Notebook), and then add the RazorInteractive library through nuget (RazorInteractive is a Razor template that allows you to write interactively under .NET Interactive)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="s"&gt;"nuget: RazorInteractive, 1.0.5"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After the import is successful, add the following code in each line&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="p"&gt;!&lt;/span&gt;&lt;span class="n"&gt;razor&lt;/span&gt;

&lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;colors&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="s"&gt;"red"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"green"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"blue"&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;ol&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nf"&gt;@foreach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;colors&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;li&lt;/span&gt; &lt;span class="n"&gt;style&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"color: @color;"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;@color&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;li&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;ol&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;firstname&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"John"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;lastname&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Doe"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;colors&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="s"&gt;"red"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"green"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"blue"&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="p"&gt;!&lt;/span&gt;&lt;span class="n"&gt;razor&lt;/span&gt;

&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;Hello&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;@Model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;firstname&lt;/span&gt; &lt;span class="n"&gt;@Model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;lastname&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;,&lt;/span&gt; &lt;span class="n"&gt;what&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="n"&gt;you&lt;/span&gt; &lt;span class="n"&gt;favorite&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="p"&gt;?&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;ol&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nf"&gt;@foreach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;Model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;colors&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;li&lt;/span&gt; &lt;span class="n"&gt;style&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"color: @color;"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;@color&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;li&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;ol&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each line is executed, you can see the following results&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tIFM74un--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/orm1j3nmn6ppt62vc9q8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tIFM74un--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/orm1j3nmn6ppt62vc9q8.png"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;

&lt;p&gt;NET Interactive makes your .NET programming interesting, provides you with more convenient support in some experimental environments and some teaching, and combined with future learning, you can easily complete data interaction operations and make .NET programs It’s easier for employees to complete data science tasks. Everyone quickly try it.&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>dotnet</category>
    </item>
    <item>
      <title>.NET Core 
In Artificial Intelligence Series-Overview</title>
      <dc:creator>Kinfey Lo</dc:creator>
      <pubDate>Wed, 18 Aug 2021 04:26:40 +0000</pubDate>
      <link>https://dev.to/kinfey/net-core-in-artificial-intelligence-series-overview-3i5f</link>
      <guid>https://dev.to/kinfey/net-core-in-artificial-intelligence-series-overview-3i5f</guid>
      <description>&lt;p&gt;Hi .NET Developer, this is a series of how to complete artificial intelligence applications under .NET Core, and hope to provide a guide for .NET Developer to enter the field of artificial intelligence.&lt;/p&gt;

&lt;p&gt;.NET Core is already a technology stack solution for full-scene applications, with support for every field. Since Microsoft's efforts in open source, the community capabilities of .NET Core have also been supplemented.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4nxozzkit3d5sxljtkym.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4nxozzkit3d5sxljtkym.png"&gt;&lt;/a&gt;&lt;br&gt;
Artificial intelligence is a global hotspot. In artificial intelligence, the Python language is the first world. There are many technical barriers for many .NET programmers to enter this field. Of course, some people will mention why we need to use .NET for machine learning? For a team, there is technical continuity. If you want to invest in a new field, you must ensure the technical cost. If you want to recruit a Python team, it will cost a lot. What can be done with the original technology is the best solution, and it can continue the creativity of the original team. It is also very good for individuals to better apply the experience accumulated in the past in new fields.&lt;/p&gt;

&lt;p&gt;What can .NET Core do in artificial intelligence at this stage? How is the ecology? The following are some related technologies in native .NET Core artificial intelligence scenarios&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9qptj9sqpzooldh0t7nb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9qptj9sqpzooldh0t7nb.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;.NET Interactive&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;In traditional data science, data scientists like to use Jupyter Notebook as the main environmental tool. (Jupyter notebook is a web application that allows users to combine explanatory text, mathematical equations, code, and visual content into one easy-to-share document.) .NET Interactive is an extension of Jupyter Notebook that allows .NET Developers to work in Jupyter Use C#/F# to do data-related work on Notebook.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;NumSharp&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;In Python, we need to use Numpy to do a large amount of data processing, complete matrix operations, and multi-dimensional data conversion. NumSharp is an open source .NET Core version of Numpy provided by a third party. (Github  &lt;a href="https://github.com/SciSharp/NumSharp" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;a href="https://github.com/SciSharp/NumSharp" rel="noopener noreferrer"&gt;https://github.com/SciSharp/NumSharp&lt;/a&gt;)&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;.NET DataFrame&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;In data science, data analysis is a very important part, and Pandas is an important tool in the Python scenario. For .NET Core, data analysis is done through DataFrame, allowing you to understand and adjust data faster.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;XPlot&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Through XPlot, you can generate different charts from the data and find out the characteristics of the data.(Github &lt;a href="https://fslab.org/XPlot/plotly.html" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;a href="https://fslab.org/XPlot/plotly.html" rel="noopener noreferrer"&gt;https://fslab.org/XPlot/plotly.html&lt;/a&gt;)&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;.NET for Apache Spark&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;.NET Core natively supports Apache Spark for big data processing&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;ML.NET&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;ML.NET is Microsoft's machine learning framework, which provides an easy way to train, create, and run models in the .NET ecosystem. This is great news for .NET developers, because it allows you to reuse all the knowledge, skills, code, and libraries you already have as a .NET developer. However, this is not just a framework for .NET developers. In fact, ML.NET has proven itself to be a great end-to-end tool that enables any developer to create complex pipelines and bind to different data sources.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;TensorFlow.NET&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;TensorFlow.NET (TF.NET) provides .NET Standard bindings for TensorFlow. It aims to implement a complete Tensorflow API in C#, allowing .NET developers to use the cross-platform .NET Standard framework to develop, train, and deploy machine learning models. TensorFlow.NET has built-in Keras high-level interface and is released as an independent package TensorFlow.Keras. (Github  &lt;a href="https://github.com/SciSharp/TensorFlow.NET" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;a href="https://github.com/SciSharp/TensorFlow.NET" rel="noopener noreferrer"&gt;https://github.com/SciSharp/TensorFlow.NET&lt;/a&gt;)&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;TensorFlowSharp&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;TensorFlowSharp is a TensorFlow model runtime. Compared with TensorFlow.NET, it lacks many functions such as graph calculation and training. (Github  &lt;a href="https://github.com/migueldeicaza/TensorFlowSharp" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;a href="https://github.com/migueldeicaza/TensorFlowSharp" rel="noopener noreferrer"&gt;https://github.com/migueldeicaza/TensorFlowSharp&lt;/a&gt;)&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;TorchSharp&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;TorchSharp is a .NET library that provides access to libraries that support PyTorch. (Github  &lt;a href="https://github.com/xamarin/TorchSharp" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;a href="https://github.com/xamarin/TorchSharp" rel="noopener noreferrer"&gt;https://github.com/xamarin/TorchSharp&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Through the above-mentioned native libraries, you can complete related technologies through C#/F#. This series will start with the most basic knowledge, including environment construction, basic concepts, machine learning related algorithms, and deep learning, hoping to make .NETer more Good to learn the knowledge of artificial intelligence.&lt;/p&gt;

&lt;p&gt;ps:The book update is also synchronized on Github (&lt;a href="https://github.com/kinfey/DotMLBooks" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;a href="https://github.com/kinfey/DotMLBooks" rel="noopener noreferrer"&gt;https://github.com/kinfey/DotMLBooks&lt;/a&gt;)&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>dotnet</category>
    </item>
  </channel>
</rss>
