<?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: Rodrigo</title>
    <description>The latest articles on DEV Community by Rodrigo (@rennorodrigo).</description>
    <link>https://dev.to/rennorodrigo</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%2F395798%2Fda98c161-8f4b-4ffc-9de1-1d26438c3638.png</url>
      <title>DEV Community: Rodrigo</title>
      <link>https://dev.to/rennorodrigo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rennorodrigo"/>
    <language>en</language>
    <item>
      <title>Genetic Programming With Javascript React JS</title>
      <dc:creator>Rodrigo</dc:creator>
      <pubDate>Tue, 26 May 2020 17:10:10 +0000</pubDate>
      <link>https://dev.to/rennorodrigo/genetic-programming-with-javascript-react-js-13b6</link>
      <guid>https://dev.to/rennorodrigo/genetic-programming-with-javascript-react-js-13b6</guid>
      <description>&lt;p&gt;For the purposes of learning, i implemented a genetic programming algorithm using syntactic trees to discover mathematical functions that represent the learning of input and output data. &lt;/p&gt;

&lt;p&gt;See this example, XOR operator:&lt;/p&gt;

&lt;p&gt;[N,x1,x2,Result]&lt;br&gt;
[1,0,0,0],&lt;br&gt;
[2,0,1,1],&lt;br&gt;
[3,1,0,1],&lt;br&gt;
[4,1,1,0],&lt;br&gt;
[5,0,0,0],&lt;br&gt;
[6,0,1,1],&lt;br&gt;
[7,1,0,1],&lt;br&gt;
[8,1,1,0],&lt;br&gt;
[9,0,0,0],&lt;br&gt;
[10,0,1,1],&lt;br&gt;
[11,1,0,1],&lt;br&gt;
[12,1,1,0]&lt;/p&gt;

&lt;p&gt;Training with the first 4 registers, the tree found the following function:&lt;br&gt;
((x2-x1) ** (((70-0) * (x1+2))+(Math.tan(x2) * x1)))&lt;/p&gt;

&lt;p&gt;The tree:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xzBuQfD9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/eomwo3ttcxan7xj0y7x3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xzBuQfD9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/eomwo3ttcxan7xj0y7x3.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Replacing values:&lt;br&gt;
((0-0) ** (((70-0) * (0+2))+(Math.tan(0) * 0))) = 0&lt;br&gt;
((0-1) ** (((70-0) * (1+2))+(Math.tan(0) * 1))) = 1&lt;br&gt;
((1-0) ** (((70-0) * (0+2))+(Math.tan(1) * 0))) = 1&lt;br&gt;
((1-1) ** (((70-0) * (1+2))+(Math.tan(1) * 1))) = 0&lt;/p&gt;

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

&lt;p&gt;We can configure genetic programming with a larger population and different types of mutation to explore better tree generation and faster data approximation.&lt;/p&gt;

&lt;p&gt;If you also like genetic programming, you can download the code and implement a better solution.&lt;/p&gt;

&lt;p&gt;A online example is here:&lt;br&gt;
&lt;a href="https://linuxever-2b066.web.app/"&gt;https://linuxever-2b066.web.app/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The code is available for download on github:&lt;br&gt;
&lt;a href="https://github.com/rennorodrigo/pgeneticareactjs"&gt;https://github.com/rennorodrigo/pgeneticareactjs&lt;/a&gt;&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>react</category>
      <category>javascript</category>
      <category>geneticprogramming</category>
    </item>
  </channel>
</rss>
