{"id":52074,"date":"2024-08-16T00:00:00","date_gmt":"2024-08-16T07:00:00","guid":{"rendered":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/blog\/predicting-salaries-with-machine-learning-and-griddb\/"},"modified":"2024-08-16T00:00:00","modified_gmt":"2024-08-16T07:00:00","slug":"predicting-salaries-with-machine-learning-and-griddb","status":"publish","type":"post","link":"https:\/\/www.griddb.net\/en\/blog\/predicting-salaries-with-machine-learning-and-griddb\/","title":{"rendered":"Predicting Salaries with Machine Learning and GridDB"},"content":{"rendered":"<p>Linear regression is a supervised machine learning technique that helps us to predict the value of a variable based on the value of another variable. The variable to be predicted is called the <code>dependent<\/code> variable while the variable used for predicting other variables is called the <code>independent variable<\/code>. It uses one or more independent variables to estimate the coefficients of the linear equation. Linear regression generates a straight line that minimizes the differences between the predicted and the expected output values.<\/p>\n<p>In this article, we will be implementing a linear regression model that predicts the salary of an individual based on their years of experience using Java and GridDB.<\/p>\n<h2>Write the Data into GridDB<\/h2>\n<p>The data to be used shows the years of experience and salaries for different individuals.<\/p>\n<p>We will store the data in GridDB as it offers many benefits such as fast query performance. Let us first import the Java libraries to help us accomplish this:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">\nimport com.toshiba.mwcloud.gs.Collection;\nimport com.toshiba.mwcloud.gs.GSException;\nimport com.toshiba.mwcloud.gs.GridStore;\nimport com.toshiba.mwcloud.gs.GridStoreFactory;\nimport com.toshiba.mwcloud.gs.Query;\nimport com.toshiba.mwcloud.gs.RowKey;\nimport com.toshiba.mwcloud.gs.RowSet;\nimport java.util.*;<\/code><\/pre>\n<\/div>\n<p>GridDB organizes data into containers, and each container can be represented as a static class in Java. Let us create a static class in Java to represent the container where the data will be stored:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">\nstatic class SalaryData {\n    @RowKey int id;\n        double yearsExperience;\n    double salary;\n     }<\/code><\/pre>\n<\/div>\n<p>We have created a GridDB container and given it the name <code>SalaryData<\/code>. See it as an SQL table with 3 columns.<\/p>\n<p>To write the data into GridDB, we should first establish a connection to the database. This requires us to create a <code>Properties<\/code> file from the <code>java.util<\/code> package and pass our GridDB credentials using the <code>key:value<\/code> syntax:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">\nProperties props = new Properties();\nprops.setProperty(\"notificationMember\", \"127.0.1.1:10001\");\nprops.setProperty(\"clusterName\", \"myCluster\");\nprops.setProperty(\"user\", \"admin\");\nprops.setProperty(\"password\", \"admin\");\nGridStore store = GridStoreFactory.getInstance().getGridStore(props);<\/code><\/pre>\n<\/div>\n<p>We will be using the <code>store<\/code> variable to interact with the database.<\/p>\n<p>Now that we are connected, we can store the data in GridDB. Let us first define the data rows:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">\nSalaryData  row1 = new SalaryData();\nrow1.id=1;\nrow1.yearsExperience=1.1;\nrow1.salary=39343.00;\n\nSalaryData  row2 = new SalaryData();\nrow2.id=2;\nrow2.yearsExperience=1.3;\nrow2.salary=46205.00;\n\nSalaryData  row3 = new SalaryData();\nrow3.id=3;\nrow3.yearsExperience=1.5;\nrow3.salary=37731.00;\n\nSalaryData  row4 = new SalaryData();\nrow4.id=4;\nrow4.yearsExperience=2.0;\nrow4.salary=43525.00;\n\nSalaryData  row5 = new SalaryData();\nrow5.id=5;\nrow5.yearsExperience=2.2;\nrow5.salary=39891.00;\n\nSalaryData  row6 = new SalaryData();\nrow6.id=6;\nrow6.yearsExperience=2.9;\nrow6.salary=56642.00;\n\nSalaryData  row7 = new SalaryData();\nrow7.id=7;\nrow7.yearsExperience=3.0;\nrow7.salary=60150.00;\n\nSalaryData  row8 = new SalaryData();\nrow8.id=8;\nrow8.yearsExperience=3.2;\nrow8.salary=54445.00;\n\nSalaryData  row9 = new SalaryData();\nrow9.id=9;\nrow9.yearsExperience=3.2;\nrow9.salary=64445.00;\n\nSalaryData  row10 = new SalaryData();\nrow10.id=10;\nrow10.yearsExperience=3.7;\nrow10.salary=57189.00;\n\nSalaryData  row11 = new SalaryData();\nrow11.id=11;\nrow11.yearsExperience=3.9;\nrow11.salary=63218.00;\n\nSalaryData  row12 = new SalaryData();\nrow12.id=12;\nrow12.yearsExperience=4.0;\nrow12.salary=55794.00;\n\n\nSalaryData  row13 = new SalaryData();\nrow13.id=13;\nrow13.yearsExperience=4.0;\nrow13.salary=56957.00;\n\nSalaryData  row14 = new SalaryData();\nrow14.id=14;\nrow14.yearsExperience=4.1;\nrow14.salary=57081.00;\n\nSalaryData  row15 = new SalaryData();\nrow15.id=15;\nrow15.yearsExperience=4.5;\nrow15.salary=61111.00;\n\nSalaryData  row16 = new SalaryData();\nrow16.id=16;\nrow16.yearsExperience=4.9;\nrow16.salary=67938.00;\n\nSalaryData  row17 = new SalaryData();\nrow17.id=17;\nrow17.yearsExperience=5.1;\nrow17.salary=66029.00;\n\nSalaryData  row18 = new SalaryData();\nrow18.id=18;\nrow18.yearsExperience=5.3;\nrow18.salary=83088.00;\n\nSalaryData  row19 = new SalaryData();\nrow19.id=19;\nrow19.yearsExperience=5.9;\nrow19.salary=81363.00;\n\nSalaryData  row20 = new SalaryData();\nrow20.id=20;\nrow20.yearsExperience=6.0;\nrow20.salary=93940.00;\n\nSalaryData  row21 = new SalaryData();\nrow21.id=21;\nrow21.yearsExperience=6.8;\nrow21.salary=91738.00;\n\nSalaryData  row22 = new SalaryData();\nrow22.id=22;\nrow22.yearsExperience=7.1;\nrow22.salary=98273.00;\n\nSalaryData  row23 = new SalaryData();\nrow23.id=23;\nrow23.yearsExperience=7.9;\nrow23.salary=101302.00;\n\nSalaryData  row24 = new SalaryData();\nrow24.id=24;\nrow24.yearsExperience=8.2;\nrow24.salary=113812.00;\n\nSalaryData  row25 = new SalaryData();\nrow25.id=25;\nrow25.yearsExperience=8.7;\nrow25.salary=109431.00;<\/code><\/pre>\n<\/div>\n<p>Let&#8217;s select the <code>SalaryData<\/code> container where the data is to be stored:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">\nCollection<String, SalaryData> sd= store.putCollection(\"SalaryData\", SalaryData.class);<\/code><\/pre>\n<\/div>\n<p>We can now call the <code>put()<\/code> function to help us flush the data into the database:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">\nsd.put(row1);\nsd.put(row2);\nsd.put(row3);\nsd.put(row4);\nsd.put(row5);\nsd.put(row6);\nsd.put(row7);\nsd.put(row8);\nsd.put(row9);\nsd.put(row10);\nsd.put(row11);\nsd.put(row12);\nsd.put(row13);\nsd.put(row14);\nsd.put(row15);\nsd.put(row16);\nsd.put(row17);\nsd.put(row18);\nsd.put(row19);\nsd.put(row20);\nsd.put(row21);\nsd.put(row22);\nsd.put(row23);\nsd.put(row24);\nsd.put(row25);<\/code><\/pre>\n<\/div>\n<h2>Retrieve the Data<\/h2>\n<p>We should now retrieve the data from GridDB and use it to fit a machine learning model. We will write a TQL query that selects and returns all the data stored in the <code>SalaryData<\/code> container:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">\nQuery<SalaryData> query = sd.query(\"select *\");\nRowSet<SalaryData> rs = query.fetch(false);\ndouble x=0;\ndouble y=0;\ndouble[][] data = {{x},{y}};\n\nSystem.out.println(\"Training dataset:\");\nwhile(rs.hasNext()) {\nSalaryData sd1 = rs.next();\nx=sd1.yearsExperience;\ny=sd1.salary;\n\n\nSystem.out.println(x +\" \"+ y);\ndouble[][] d= {{x},{y}};\ndata=d.clone();\n\n}<\/code><\/pre>\n<\/div>\n<p>The <code>select *<\/code> is a TQL query that fetches all the data stored in the <code>SalaryData<\/code> container. We have also defined two variables, <code>x<\/code> an <code>y<\/code> to store the values of <code>yearsExperiene<\/code> and <code>salary<\/code> respectively when fetched from the database. The data has then been stored in an array named <code>data<\/code>. The <code>while<\/code> loop helps us to iterate over all the rows of the GridDB container.<\/p>\n<h2>Create Weka Instances<\/h2>\n<p>We now want to use the Weka machine learning library to fit a linear regression model. We have to convert our data into Weka instances. We will first create attributes for the dataset and store them in a FastVector data structure. Next, we will create Weka instances from the dataset.<\/p>\n<p>Let&#8217;s first create the data structures for storing the attributes and the instances:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">\nint numInstances = data[0].length;\nFastVector atts = new FastVector();\nList<Instance> instances = new ArrayList<Instance>();<\/code><\/pre>\n<\/div>\n<p>We can now create a<code>for<\/code> loop and use it to iterate over the data items while populating the FastVector data structure with the attributes:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">\nfor(int dim = 0; dim < 2; dim++)\n    {\n        Attribute current = new Attribute(\"Attribute\" + dim, dim);\n\n    if(dim == 0)\n        {\n       for(int obj = 0; obj < numInstances; obj++)\n            {\n                instances.add(new SparseInstance(numInstances));\n            }\n        }\n\n       for(int obj = 0; obj < numInstances; obj++)\n        {\n            instances.get(obj).setValue(current, data[dim][obj]);\n            \n        }\n        atts.addElement(current);\n    }\n    \nInstances newDataset = new Instances(\"Dataset\", atts, instances.size());<\/code><\/pre>\n<\/div>\n<p>The integer variable <code>dim<\/code> generates a two dimensional data structure for storing the attributes. We have also created objects with the specific attributes to be used for building the model. These have been stored in an Instance variable named <code>newDataset<\/code>.<\/p>\n<h2>Build a Linear Regression Model<\/h2>\n<p>The data instances are now ready, hence, we can use them to build a machine learning model. Let's first import the necessary libraries from Weka:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">\nimport weka.classifiers.Classifier;\nimport weka.classifiers.Evaluation;\nimport weka.core.Attribute;\nimport weka.core.FastVector;\nimport weka.core.Instance;\nimport weka.core.Instances;\nimport weka.core.SparseInstance;<\/code><\/pre>\n<\/div>\n<p>Let us set the class attribute for the dataset:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">\nnewDataset.setClassIndex(1);<\/code><\/pre>\n<\/div>\n<p>The above line of code sets <code>salary<\/code> as the class attribute for the dataset.<\/p>\n<p>Next, we use the <code>LinearRegression()<\/code> function of the Weka library to build a Linear Regression classifier.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">\nfor(Instance inst : instances)\nnewDataset.add(inst);\nClassifier classifier = new weka.classifiers.functions.LinearRegression();\n\nclassifier.buildClassifier(newDataset);<\/code><\/pre>\n<\/div>\n<p>We have created an instance of the function and given it the name <code>classifier<\/code>. We have then called the <code>buildClassifier()<\/code> function to build a classifier using our dataset.<\/p>\n<h2>Make a Prediction<\/h2>\n<p>Let's use our linear regression model to predict the salary of a person based on their years of experience. We will use the last instance of our dataset to make the prediction:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">\nInstance pd = newDataset.lastInstance();\ndouble value = classifier.classifyInstance(pd);                 \n        System.out.println(value);<\/code><\/pre>\n<\/div>\n<p><code>pd<\/code> is an instance of the last instance of our dataset. The <code>classifyInstance()<\/code> function predicts the value of <code>salary<\/code> for the instance.<\/p>\n<h2>Execute the Model<\/h2>\n<p>To run the model, first download the Weka API from the following URL:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-sh\">http:\/\/www.java2s.com\/Code\/Jar\/w\/weka.htm<\/code><\/pre>\n<\/div>\n<p>Choose Weka version 3.7.0.<\/p>\n<p>Set the class paths for the <code>gridstore.jar<\/code> and <code>weka-3-7-0.jar<\/code> files by running the following commands on the terminal:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-sh\">export CLASSPATH=$CLASSPATH:\/usr\/share\/java\/gridstore.jar<\/code><\/pre>\n<\/div>\n<div class=\"clipboard\">\n<pre><code class=\"language-sh\">export CLASSPATH=$CLASSPATH:\/mnt\/c\/Users\/user\/Desktop\/weka-3.7.0.jar<\/code><\/pre>\n<\/div>\n<p>The above commands may change depending on the location of your files.<\/p>\n<p>Compile your <code>.java<\/code> file by running the following command:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-sh\">javac Salary.java<\/code><\/pre>\n<\/div>\n<p>Run the generated .class file using the following command:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-sh\">java Salary<\/code><\/pre>\n<\/div>\n<p>The model predicted a salary of 109431.0 for the person.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linear regression is a supervised machine learning technique that helps us to predict the value of a variable based on the value of another variable. The variable to be predicted is called the dependent variable while the variable used for predicting other variables is called the independent variable. It uses one or more independent variables [&hellip;]<\/p>\n","protected":false},"author":41,"featured_media":52075,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[121],"tags":[],"class_list":["post-52074","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Predicting Salaries with Machine Learning and GridDB | GridDB: Open Source Time Series Database for IoT<\/title>\n<meta name=\"description\" content=\"Linear regression is a supervised machine learning technique that helps us to predict the value of a variable based on the value of another variable. The\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/griddb.net\/en\/blog\/predicting-salaries-with-machine-learning-and-griddb\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Predicting Salaries with Machine Learning and GridDB | GridDB: Open Source Time Series Database for IoT\" \/>\n<meta property=\"og:description\" content=\"Linear regression is a supervised machine learning technique that helps us to predict the value of a variable based on the value of another variable. The\" \/>\n<meta property=\"og:url\" content=\"https:\/\/griddb.net\/en\/blog\/predicting-salaries-with-machine-learning-and-griddb\/\" \/>\n<meta property=\"og:site_name\" content=\"GridDB: Open Source Time Series Database for IoT\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/griddbcommunity\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-08-16T07:00:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.griddb.net\/wp-content\/uploads\/2025\/12\/123410-macbook-air-coding-html-javascript_1920x1920.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1920\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"griddb-admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@GridDBCommunity\" \/>\n<meta name=\"twitter:site\" content=\"@GridDBCommunity\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"griddb-admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/griddb.net\/en\/blog\/predicting-salaries-with-machine-learning-and-griddb\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/predicting-salaries-with-machine-learning-and-griddb\/\"},\"author\":{\"name\":\"griddb-admin\",\"@id\":\"https:\/\/www.griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233\"},\"headline\":\"Predicting Salaries with Machine Learning and GridDB\",\"datePublished\":\"2024-08-16T07:00:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/predicting-salaries-with-machine-learning-and-griddb\/\"},\"wordCount\":751,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.griddb.net\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/predicting-salaries-with-machine-learning-and-griddb\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2025\/12\/123410-macbook-air-coding-html-javascript_1920x1920.jpg\",\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/griddb.net\/en\/blog\/predicting-salaries-with-machine-learning-and-griddb\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/griddb.net\/en\/blog\/predicting-salaries-with-machine-learning-and-griddb\/\",\"url\":\"https:\/\/griddb.net\/en\/blog\/predicting-salaries-with-machine-learning-and-griddb\/\",\"name\":\"Predicting Salaries with Machine Learning and GridDB | GridDB: Open Source Time Series Database for IoT\",\"isPartOf\":{\"@id\":\"https:\/\/www.griddb.net\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/predicting-salaries-with-machine-learning-and-griddb\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/predicting-salaries-with-machine-learning-and-griddb\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2025\/12\/123410-macbook-air-coding-html-javascript_1920x1920.jpg\",\"datePublished\":\"2024-08-16T07:00:00+00:00\",\"description\":\"Linear regression is a supervised machine learning technique that helps us to predict the value of a variable based on the value of another variable. The\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/griddb.net\/en\/blog\/predicting-salaries-with-machine-learning-and-griddb\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/griddb.net\/en\/blog\/predicting-salaries-with-machine-learning-and-griddb\/#primaryimage\",\"url\":\"\/wp-content\/uploads\/2025\/12\/123410-macbook-air-coding-html-javascript_1920x1920.jpg\",\"contentUrl\":\"\/wp-content\/uploads\/2025\/12\/123410-macbook-air-coding-html-javascript_1920x1920.jpg\",\"width\":1920,\"height\":1920},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.griddb.net\/en\/#website\",\"url\":\"https:\/\/www.griddb.net\/en\/\",\"name\":\"GridDB: Open Source Time Series Database for IoT\",\"description\":\"GridDB is an open source time-series database with the performance of NoSQL and convenience of SQL\",\"publisher\":{\"@id\":\"https:\/\/www.griddb.net\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.griddb.net\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.griddb.net\/en\/#organization\",\"name\":\"Fixstars\",\"url\":\"https:\/\/www.griddb.net\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.griddb.net\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png\",\"contentUrl\":\"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png\",\"width\":200,\"height\":83,\"caption\":\"Fixstars\"},\"image\":{\"@id\":\"https:\/\/www.griddb.net\/en\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/griddbcommunity\/\",\"https:\/\/x.com\/GridDBCommunity\",\"https:\/\/www.linkedin.com\/company\/griddb-by-toshiba\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233\",\"name\":\"griddb-admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.griddb.net\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g\",\"caption\":\"griddb-admin\"},\"url\":\"https:\/\/www.griddb.net\/en\/author\/griddb-admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Predicting Salaries with Machine Learning and GridDB | GridDB: Open Source Time Series Database for IoT","description":"Linear regression is a supervised machine learning technique that helps us to predict the value of a variable based on the value of another variable. The","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/griddb.net\/en\/blog\/predicting-salaries-with-machine-learning-and-griddb\/","og_locale":"en_US","og_type":"article","og_title":"Predicting Salaries with Machine Learning and GridDB | GridDB: Open Source Time Series Database for IoT","og_description":"Linear regression is a supervised machine learning technique that helps us to predict the value of a variable based on the value of another variable. The","og_url":"https:\/\/griddb.net\/en\/blog\/predicting-salaries-with-machine-learning-and-griddb\/","og_site_name":"GridDB: Open Source Time Series Database for IoT","article_publisher":"https:\/\/www.facebook.com\/griddbcommunity\/","article_published_time":"2024-08-16T07:00:00+00:00","og_image":[{"width":1920,"height":1920,"url":"https:\/\/www.griddb.net\/wp-content\/uploads\/2025\/12\/123410-macbook-air-coding-html-javascript_1920x1920.jpg","type":"image\/jpeg"}],"author":"griddb-admin","twitter_card":"summary_large_image","twitter_creator":"@GridDBCommunity","twitter_site":"@GridDBCommunity","twitter_misc":{"Written by":"griddb-admin","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/griddb.net\/en\/blog\/predicting-salaries-with-machine-learning-and-griddb\/#article","isPartOf":{"@id":"https:\/\/griddb.net\/en\/blog\/predicting-salaries-with-machine-learning-and-griddb\/"},"author":{"name":"griddb-admin","@id":"https:\/\/www.griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233"},"headline":"Predicting Salaries with Machine Learning and GridDB","datePublished":"2024-08-16T07:00:00+00:00","mainEntityOfPage":{"@id":"https:\/\/griddb.net\/en\/blog\/predicting-salaries-with-machine-learning-and-griddb\/"},"wordCount":751,"commentCount":0,"publisher":{"@id":"https:\/\/www.griddb.net\/en\/#organization"},"image":{"@id":"https:\/\/griddb.net\/en\/blog\/predicting-salaries-with-machine-learning-and-griddb\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2025\/12\/123410-macbook-air-coding-html-javascript_1920x1920.jpg","articleSection":["Blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/griddb.net\/en\/blog\/predicting-salaries-with-machine-learning-and-griddb\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/griddb.net\/en\/blog\/predicting-salaries-with-machine-learning-and-griddb\/","url":"https:\/\/griddb.net\/en\/blog\/predicting-salaries-with-machine-learning-and-griddb\/","name":"Predicting Salaries with Machine Learning and GridDB | GridDB: Open Source Time Series Database for IoT","isPartOf":{"@id":"https:\/\/www.griddb.net\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/griddb.net\/en\/blog\/predicting-salaries-with-machine-learning-and-griddb\/#primaryimage"},"image":{"@id":"https:\/\/griddb.net\/en\/blog\/predicting-salaries-with-machine-learning-and-griddb\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2025\/12\/123410-macbook-air-coding-html-javascript_1920x1920.jpg","datePublished":"2024-08-16T07:00:00+00:00","description":"Linear regression is a supervised machine learning technique that helps us to predict the value of a variable based on the value of another variable. The","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/griddb.net\/en\/blog\/predicting-salaries-with-machine-learning-and-griddb\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/griddb.net\/en\/blog\/predicting-salaries-with-machine-learning-and-griddb\/#primaryimage","url":"\/wp-content\/uploads\/2025\/12\/123410-macbook-air-coding-html-javascript_1920x1920.jpg","contentUrl":"\/wp-content\/uploads\/2025\/12\/123410-macbook-air-coding-html-javascript_1920x1920.jpg","width":1920,"height":1920},{"@type":"WebSite","@id":"https:\/\/www.griddb.net\/en\/#website","url":"https:\/\/www.griddb.net\/en\/","name":"GridDB: Open Source Time Series Database for IoT","description":"GridDB is an open source time-series database with the performance of NoSQL and convenience of SQL","publisher":{"@id":"https:\/\/www.griddb.net\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.griddb.net\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.griddb.net\/en\/#organization","name":"Fixstars","url":"https:\/\/www.griddb.net\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.griddb.net\/en\/#\/schema\/logo\/image\/","url":"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png","contentUrl":"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png","width":200,"height":83,"caption":"Fixstars"},"image":{"@id":"https:\/\/www.griddb.net\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/griddbcommunity\/","https:\/\/x.com\/GridDBCommunity","https:\/\/www.linkedin.com\/company\/griddb-by-toshiba"]},{"@type":"Person","@id":"https:\/\/www.griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233","name":"griddb-admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.griddb.net\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g","caption":"griddb-admin"},"url":"https:\/\/www.griddb.net\/en\/author\/griddb-admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/posts\/52074","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/comments?post=52074"}],"version-history":[{"count":0,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/posts\/52074\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/media\/52075"}],"wp:attachment":[{"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/media?parent=52074"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/categories?post=52074"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/tags?post=52074"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}