<?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: f2010126</title>
    <description>The latest articles on DEV Community by f2010126 (@f2010126).</description>
    <link>https://dev.to/f2010126</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%2F112599%2Fc3a32195-db21-4798-82d2-f4790c7185cc.png</url>
      <title>DEV Community: f2010126</title>
      <link>https://dev.to/f2010126</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/f2010126"/>
    <language>en</language>
    <item>
      <title>Predict Yacht Hydrodynamics using MindsDB</title>
      <dc:creator>f2010126</dc:creator>
      <pubDate>Mon, 31 Oct 2022 15:08:16 +0000</pubDate>
      <link>https://dev.to/f2010126/predict-yacht-hydrodynamics-using-mindsdb-3pnb</link>
      <guid>https://dev.to/f2010126/predict-yacht-hydrodynamics-using-mindsdb-3pnb</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CpY9aWD0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m485l0b6gczzndx7wqxd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CpY9aWD0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m485l0b6gczzndx7wqxd.png" alt="Yachts" width="498" height="346"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Ships and resistance
&lt;/h2&gt;

&lt;p&gt;A ship must be designed to move efficiently through the water with a minimum of external force. For thousands of years ship designers and builders of sailing vessels used rules of thumb based on the midship-section area to size the sails for a given vessel. But with the advances in steam power and construction of large iron ships in the mid-19th century, it became clear to ship owners and builders that a more rigorous approach was needed.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vgbAj768--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kedj69bs90wwq7nucnv9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vgbAj768--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kedj69bs90wwq7nucnv9.png" alt="Visual Representation of Residuary resistance" width="524" height="546"&gt;&lt;/a&gt;&lt;br&gt;
In modern times, for the practical evaluation of ship resistance for normal ship forms, it is usual to group wave-making resistance, form resistance, eddy resistance and frictional form resistance into one force:  &lt;em&gt;residuary resistance&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Residuary resistance is formally defined as the sum of the wave-making resistance and eddy resistance that opposes the movement of a vessel through the water. &lt;/p&gt;

&lt;h2&gt;
  
  
  Role of Machine Learning and MindsDB
&lt;/h2&gt;

&lt;p&gt;The measurement of the residuary resistance per unit weight of displacement is a complex complex task. Calculating the value from measurements of ship’s dimensions, which are easier to determine and can be achieved using regression methods. &lt;br&gt;
When dealing with regression, a machine learning model like an MLP can be used to model the regression better than conventional methods. &lt;br&gt;
Which is where MindsDB comes into play. It acts as a datastore as well as the selector for the correct ML model to fit and train the data. It's an all in one solution when it comes to getting Machine learning involved in your data workflow. &lt;/p&gt;

&lt;p&gt;The goal here is to use MindsDB to predict the values of the residuary resistance per unit weight of displacement from the variables describing ship’s dimensions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Training Data
&lt;/h2&gt;

&lt;p&gt;The data is taken from the UCI Machine Learning Repository &lt;a href="https://archive.ics.uci.edu/ml/datasets/yacht+hydrodynamics"&gt;here&lt;/a&gt;, created by Ship Hydromechanics Laboratory, Maritime and Transport Technology Department, Technical University of Delft. The Delft data set comprises 308 full-scale experiments, which were performed at the Delft Ship Hydromechanics Laboratory. These experiments include 22 different hull forms, derived from a parent form closely related to the â€˜Standfast 43â€™ &lt;/p&gt;

&lt;h3&gt;
  
  
  Attributes:
&lt;/h3&gt;

&lt;p&gt;Variations concern hull geometry coefficients and the Froude number:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Longitudinal position of the center of buoyancy, adimensional.&lt;/li&gt;
&lt;li&gt;Prismatic coefficient, adimensional.&lt;/li&gt;
&lt;li&gt;Length-displacement ratio, adimensional.&lt;/li&gt;
&lt;li&gt;Beam-draught ratio, adimensional.&lt;/li&gt;
&lt;li&gt;Length-beam ratio, adimensional.&lt;/li&gt;
&lt;li&gt;Froude number, adimensional.&lt;/li&gt;
&lt;li&gt;Residuary resistance per unit weight of displacement, adimensional.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Development Environment
&lt;/h2&gt;

&lt;p&gt;As MindsDB offers a cloud version, we can sign up &lt;a href="https://cloud.mindsdb.com/"&gt;here&lt;/a&gt;, or we could use it locally via &lt;a href="https://docs.mindsdb.com/setup/self-hosted/pip/source/"&gt;Pip&lt;/a&gt; or &lt;a href="https://docs.mindsdb.com/setup/self-hosted/docker/"&gt;Docker&lt;/a&gt;. In this tutorial, we will be using MindsDB via the cloud to highlight the ease of access. &lt;br&gt;
Data files are restricted to a maximum size of 10MB.&lt;/p&gt;

&lt;h3&gt;
  
  
  Connecting to the datasource
&lt;/h3&gt;

&lt;p&gt;For this tutorial, we connect to our database as a CSV file on the MindsDB cloud. We begin by downloading the &lt;a href="https://archive.ics.uci.edu/ml/machine-learning-databases/00243/"&gt;data file here&lt;/a&gt; and uploading the file "yacht_hydrodynamics.csv".  Follow the &lt;a href="https://docs.mindsdb.com/sql/tutorials/customer-churn/"&gt;guide&lt;/a&gt; to upload the file to MindsDB and name the table appropriately.&lt;/p&gt;

&lt;h2&gt;
  
  
  Training
&lt;/h2&gt;

&lt;p&gt;Once named, create and train a predictor with the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;CREATE PREDICTOR mindsdb.yacht_model FROM files (SELECT * FROM yacht_hydrodynamics) PREDICT residuary_resistance;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The quantity to predict here is residuary_resistance.&lt;/p&gt;

&lt;p&gt;It may take a couple of minutes for the training to complete. You can &lt;a href="https://docs.mindsdb.com/#5-creating-a-predictor-create-predictor"&gt;monitor the status of your model&lt;/a&gt; like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;br&gt;
SELECT * FROM mindsdb.predictors WHERE name='yacht_model';&lt;/code&gt;&lt;br&gt;
`&lt;/p&gt;

&lt;p&gt;The AutoML will figure out the model, and you can use &lt;a href="https://docs.mindsdb.com/sql/api/describe/?h=describe"&gt;DESCRIBE&lt;/a&gt; to see how this model was built. MindsDB will pick the most optimised one as the result model to make the predictions. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;br&gt;
DESCRIBE PREDICTOR mindsdb.yacht_model.model;&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
The query lists out the candidate models used to train the data along with other metrics like performance, and accuracy.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4y77Pe52--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ofq8mvvsy91y1uj9etcr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4y77Pe52--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ofq8mvvsy91y1uj9etcr.png" alt="Describe the model" width="880" height="289"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The model takes very little time to train due to the low number of training points. &lt;/p&gt;

&lt;h2&gt;
  
  
  Prediction
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;SELECT&lt;/code&gt; statement fetches predictions from the model table. The data is returned on the fly and not saved.&lt;br&gt;
&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;SELECT residuary_resistance, residuary_resistance_explain FROM mindsdb.yacht_model WHERE prismatic_coeff=0.55 AND froude_no=0.181;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BOwWTAt_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iqd3rlsi4p453aep24d4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BOwWTAt_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iqd3rlsi4p453aep24d4.png" alt="Predicting a query" width="880" height="60"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;MindsDB eases the process of using ML to predict an otherwise complex problem. There are few barriers to getting started, making this a good option for novice users. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>MindsDB Tutorial: Predicting the Genre of Books</title>
      <dc:creator>f2010126</dc:creator>
      <pubDate>Sat, 08 Oct 2022 21:00:03 +0000</pubDate>
      <link>https://dev.to/f2010126/mindsdb-tutorial-predicting-the-genre-of-books-2ifh</link>
      <guid>https://dev.to/f2010126/mindsdb-tutorial-predicting-the-genre-of-books-2ifh</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;MindsDB introduces AI and machine learning into databases to help data teams – and every day data users – identify patterns, predict trends, and train models.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://camo.githubusercontent.com/6387788854039fff8d9762a4249374084a56131a6cadbfd6c8aad97ebd311c33/68747470733a2f2f646f63732e6d696e647364622e636f6d2f6173736574732f6d64625f696d6167652e706e67" class="article-body-image-wrapper"&gt;&lt;img src="https://camo.githubusercontent.com/6387788854039fff8d9762a4249374084a56131a6cadbfd6c8aad97ebd311c33/68747470733a2f2f646f63732e6d696e647364622e636f6d2f6173736574732f6d64625f696d6167652e706e67" alt="MindsDB Logo" width="1286" height="994"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The goal of this tutorial is to predict the genre of the book based on the synopsis of the book. The only pre-requisite knowledge is the basics of SQL and databases. Knowledge of Machine learning is a bonus but not a deal-breaker.  &lt;/p&gt;

&lt;p&gt;The workflow is divided into 3 main steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Connect to the database&lt;/li&gt;
&lt;li&gt;Fire an SQL query to create and trade an ML predictor.&lt;/li&gt;
&lt;li&gt;Once training is complete, execute another SQL query to make predictions using the trained predictor. &lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Development Environment
&lt;/h2&gt;

&lt;p&gt;As MindsDB offers a cloud version, we can sign up &lt;a href="https://cloud.mindsdb.com/"&gt;here&lt;/a&gt;, or we could use it locally via &lt;a href="https://docs.mindsdb.com/setup/self-hosted/pip/source/"&gt;Pip&lt;/a&gt; or &lt;a href="https://docs.mindsdb.com/setup/self-hosted/docker/"&gt;Docker&lt;/a&gt;. In this tutorial, we will be using MindsDB via the cloud to highlight the ease of access. &lt;br&gt;
The only drawback is the upper limit on the number of rows in the data. MindsDB supports up to 10K rows and will raise an error for a larger number. Data files are restricted to a maximum size of 10MB.&lt;/p&gt;

&lt;h2&gt;
  
  
  Data Setup
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Data
&lt;/h3&gt;

&lt;p&gt;We are using the Book Genre Prediction data set from Kaggle, downloadable &lt;a href="https://www.kaggle.com/datasets/athu1105/book-genre-prediction"&gt;here&lt;/a&gt; . &lt;/p&gt;

&lt;h4&gt;
  
  
  About the data
&lt;/h4&gt;

&lt;p&gt;This dataset contains a single file named data.csv containing the data. Data is divided across 4 columns, &lt;strong&gt;index&lt;/strong&gt; , &lt;strong&gt;title&lt;/strong&gt;, &lt;strong&gt;genre&lt;/strong&gt;, &lt;strong&gt;summary&lt;/strong&gt;. The data is about 10MB and has 4656 records. Data is of the following format.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;# index&lt;/th&gt;
&lt;th&gt;title&lt;/th&gt;
&lt;th&gt;genre&lt;/th&gt;
&lt;th&gt;summary&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Drowned Wednesday&lt;/td&gt;
&lt;td&gt;fantasy&lt;/td&gt;
&lt;td&gt;Drowned Wednesday is the first Trustee among the Morrow Days who is on Arthur's side and wishes the...&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Violets are Blue&lt;/td&gt;
&lt;td&gt;thriller&lt;/td&gt;
&lt;td&gt;The book begins where Roses are Red ended, with Dr. Alex Cross at the home of murdered FBI Agent Be...&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;Starcross&lt;/td&gt;
&lt;td&gt;science&lt;/td&gt;
&lt;td&gt;Protagonist Arthur ("Art") Mumby and his older sister Myrtle are invited to the Starcross hotel on ...&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Connecting to the datasource
&lt;/h3&gt;

&lt;p&gt;For this tutorial, we connect to our database as a CSV file on the MindsDB cloud. We begin by downloading the &lt;a href="https://www.kaggle.com/datasets/athu1105/book-genre-prediction"&gt;csv data file here&lt;/a&gt; and uploading the file "data.csv".  Follow the &lt;a href="https://docs.mindsdb.com/sql/tutorials/customer-churn/"&gt;guide&lt;/a&gt; to upload the file to MindsDB and name the table appropriately. I have used "BookGenres".&lt;/p&gt;

&lt;p&gt;Once uploaded, you can run queries directly on the database. Let's start by previewing the data we will use to train the model:&lt;br&gt;
&lt;code&gt;SELECT * FROM files.BookGenres LIMIT 10;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;For a data visualization, showing the distribution of data, click on &lt;a href="https://docs.mindsdb.com/"&gt;DATA INSIGHTS&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ko9YdoKC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cloud.mindsdb.com/assets/data-insights.99082f5a.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ko9YdoKC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cloud.mindsdb.com/assets/data-insights.99082f5a.svg" alt="Data insights" width="155" height="56"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Training
&lt;/h2&gt;

&lt;p&gt;Let's create and train the machine learning model. For that, we use the &lt;a href="https://docs.mindsdb.com/#5-creating-a-predictor-create-predictor"&gt;CREATE PREDICTOR&lt;/a&gt; syntax, where we specify what query to train FROM and what we want to learn to PREDICT. In this case, we will train using the 'title' ,'genre' and 'summary' features/columns in the table to predict the 'genre'.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;CREATE PREDICTOR mindsdb.predict_genre_model FROM files (SELECT title, genre, summary FROM BookGenres) PREDICT genre;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It may take a couple of minutes for the training to complete. You can &lt;a href="https://docs.mindsdb.com/#5-creating-a-predictor-create-predictor"&gt;monitor the status of your model&lt;/a&gt; like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;SELECT * FROM mindsdb.predictors WHERE name='predict_genre_model';&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The AutoML will figure out the model, and you can use &lt;a href="https://docs.mindsdb.com/sql/api/describe/?h=describe"&gt;DESCRIBE&lt;/a&gt; to see how this model was built. MindsDB uses several candidate models to internally train the data and then picks up the most optimised one as the result model to make the predictions. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;DESCRIBE PREDICTOR mindsdb.predict_genre_model.model;&lt;/code&gt;&lt;br&gt;
The query lists out the candidate models used to train the data along with other metrics like performance, and accuracy. &lt;/p&gt;

&lt;p&gt;To see the parameters used by MindsDB's AutoML pipeline execute the following SQL:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;DESCRIBE PREDICTOR mindsdb.predict_genre_model.ensemble;&lt;/code&gt;&lt;br&gt;
The result is a JSON listing the hyper-parameters and values used for training your candidate predictor.&lt;/p&gt;

&lt;h2&gt;
  
  
  Making Predictions
&lt;/h2&gt;

&lt;p&gt;Once training is completed, your model is ready to predict. Prediction using MindsDB is easy as running an SQL query.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;SELECT genre FROM mindsdb.predict_genre_model WHERE summary = "The Prince of no value Brishen Khaskem, prince of the Kai, has lived content as the nonessential spare heir to a throne secured many times over. A trade and political alliance between the human kingdom of Gaur and the Kai kingdom of Bast-Haradis requires that he marry a Gauri woman to seal the treaty. Always a dutiful son, Brishen agrees to the marriage and discovers his bride is as ugly as he expected and more beautiful than he could have imagined. The noblewoman of no importance Ildiko, niece of the Gauri king, has always known her only worth to the royal family lay in a strategic marriage. Resigned to her fate, she is horrified to learn that her intended groom isn’t just a foreign aristocrat but the younger prince of a people neither familiar nor human. Bound to her new husband, Ildiko will leave behind all she’s known to embrace a man shrouded in darkness but with a soul forged by light. Two people brought together by the trappings of duty and politics will discover they are destined for each other, even as the powers of a hostile kingdom scheme to tear them apart. (less)";&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusions
&lt;/h2&gt;

&lt;p&gt;It is very easy to start making predictions with machine learning even without being a data scientist or having any formal knowledge of machine learning. It took me under an hour to get my model up and running.&lt;br&gt;
Tools like MindsDB take away the burden of choosing the right model, the right parameters and training time so you can focus on the problem at hand and not the technical aspects.&lt;br&gt;
Feel free to check this for yourself. The documentation is well written and the developer community is constantly improving the product. &lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
