{"id":183,"date":"2020-06-23T19:42:00","date_gmt":"2020-06-23T19:42:00","guid":{"rendered":"https:\/\/demo.mekshq.com\/johannes\/dc\/?p=183"},"modified":"2023-09-01T16:37:55","modified_gmt":"2023-09-01T16:37:55","slug":"ml-simple-linear-regression","status":"publish","type":"post","link":"https:\/\/amineoumous.com\/blog\/2020\/06\/23\/ml-simple-linear-regression\/","title":{"rendered":"How can we predict an Employee&#8217;s salary ?"},"content":{"rendered":"\n<p>Linear regression is one of the easiest algorithms in machine learning, is used for finding a linear relationship between two variables (target and predictors) with the linear equation. there are two types of linear regression:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Simple Linear Regression<\/li><li>Multiple Linear Regression<\/li><\/ul>\n\n\n\n<p>Today I&#8217;m going to start with &#8221; <strong>Simple Linear Regression<\/strong> &#8220;<\/p>\n\n\n\n<p>A simple Linear Regression is basically this formula, where Y = A + B*X and you might recognize this formula from back in high school. let&#8217;s go through these variables and coefficients one by one.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/amineoumous.com\/blog\/wp-content\/uploads\/2023\/08\/amineoumous_formula_simple_LR.png\" alt=\"formula Y = A + B*X \" class=\"wp-image-1339\" width=\"240\" height=\"91\" srcset=\"https:\/\/amineoumous.com\/blog\/wp-content\/uploads\/2023\/08\/amineoumous_formula_simple_LR.png 320w, https:\/\/amineoumous.com\/blog\/wp-content\/uploads\/2023\/08\/amineoumous_formula_simple_LR-300x113.png 300w\" sizes=\"auto, (max-width: 240px) 100vw, 240px\" \/><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Objective<\/h3>\n\n\n\n<p>The objective of this tutorial is to predict the salary of an employee according to the number of years of experience he has.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Dataset<\/h3>\n\n\n\n<p>When you look at the dataset (can be found&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/www.kaggle.com\/amineoumous\/salary-data\" target=\"_blank\">here<\/a>). you see that it has 3 columns &#8220;Index&#8221;, \u201cYearsExperience\u201d and \u201cSalary\u201d for 30 employees in an X company. So, we will train a Simple Linear Regression model to learn the correlation between \u201cYearsExperience\u201d of each employee and their respective \u201cSalary\u201d.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Import Libraries<\/h3>\n\n\n\n<p>we will use 4 libraries such as :<br> &#8211; <em>NumPy<\/em>: <code>import numpy as np<\/code><br> &#8211; <em>Pandas<\/em>: <code>import pandas as pd<\/code> to work with a dataset<br> &#8211; <em>Matplotlib<\/em>: <code>import matplotlib.pyplot as plt<\/code> to visualize our plots for viewing<br> &#8211; <em>Sklearn<\/em>: <code>from sklearn.linear_model import LinearRegression<\/code> to implement machine learning functions, in this example, we use Linear Regression<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Load the Dataset<\/h3>\n\n\n\n<p>We will be using the pandas dataframe. Here X is the independent variable which is the second column which contains Years of Experience array and y is the dependent variable which is the last column which contains Salary array.<br>So for X, we specify : <code>X = dataset.iloc[:, 1:-1].values<\/code><br>and for y, we specify : <code>y = dataset.iloc[:, -1].values<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Split Data<\/h3>\n\n\n\n<p>Next, we have to split our dataset into a training dataset for training the model and testing to check the performance of the model, to do this we need to use the train_test_split method from library model_selection.<\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/amineoumous\/f3e98e109f0d9100cf5029370bf84331.js\"><\/script>\n\n\n\n<p><strong>Code Explanation :<\/strong><\/p>\n\n\n\n<p><kbd><strong>test_size = 1\/3<\/strong><\/kbd>&nbsp;: we will split our dataset into 2 parts (training set, test set) and the ratio of test set compared to a dataset is 1\/3, which means test set will contain 10 observations, and the training set will contain 20 observations. We should not let the test set too big; if it\u2019s too big, we will lack data to train. Normally, we should pick around 5% to 30%.<\/p>\n\n\n\n<p><strong><kbd>random_state = 0<\/kbd><\/strong>&nbsp;: this is the seed for the random number generator, which is required only if you want to compare your results with mine. If we leave it blank or 0, the RandomState instance used by np.random will be used instead.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4: build the Regression Model<\/h3>\n\n\n\n<p>It&#8217;s a very simple step. We will use the <code>LinearRegression<\/code> class from the <code>sklearn.linear_model<\/code> library. First, we create an object of the <code>LinearRegression<\/code> class and call the fit method passing the <code>X_train<\/code> and <code>y_train<\/code>.<\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/amineoumous\/fa967028fbac9e876821901dbdc25268.js\"><\/script>\n\n\n\n<p><strong>Code Explanation :<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><kbd>regressor = LinearRegression()<\/kbd>&nbsp;: our training model which will implement the Linear Regression.<\/li><li><kbd>regressor.fit(X_train, y_train)<\/kbd> : This is the training process. we pass the X_train which contains a value of Year Experience and y_train which contains values of particular Salary to form up the model.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Step 5: Predict the test set<\/h3>\n\n\n\n<p>After we have training our regressor, we will now use it to predict the results of the test set and compare the predicted values with the real values.<br>Let&#8217;s compare to see if our model did well.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/amineoumous.com\/blog\/wp-content\/uploads\/2023\/08\/amineoumous_compare_real_predict.jpg\" alt=\"compare_real_predict\" class=\"wp-image-1340\" width=\"264\" height=\"320\" srcset=\"https:\/\/amineoumous.com\/blog\/wp-content\/uploads\/2023\/08\/amineoumous_compare_real_predict.jpg 264w, https:\/\/amineoumous.com\/blog\/wp-content\/uploads\/2023\/08\/amineoumous_compare_real_predict-248x300.jpg 248w\" sizes=\"auto, (max-width: 264px) 100vw, 264px\" \/><\/figure><\/div>\n\n\n\n<p>If we take the first employee, the real salary is 37731 and our model predicts 40835.1, which is not too bad. Some predictions are off, but some are fairly close.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 6: visualize the training model and testing model<\/h3>\n\n\n\n<p>Training Set :to visualize the results, we&#8217;ll plot the actual data points of the training set X_train and y_train, next we&#8217;ll plot the regression line which is the predicted values for the X_train.<\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/amineoumous\/0e47e54e2fab4669b5d6c41e7dc84b26.js\"><\/script>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"320\" height=\"219\" src=\"http:\/\/amineoumous.com\/blog\/wp-content\/uploads\/2023\/08\/amineoumous_plot_training_set.jpg\" alt=\"plot_training_set\" class=\"wp-image-1341\" srcset=\"https:\/\/amineoumous.com\/blog\/wp-content\/uploads\/2023\/08\/amineoumous_plot_training_set.jpg 320w, https:\/\/amineoumous.com\/blog\/wp-content\/uploads\/2023\/08\/amineoumous_plot_training_set-300x205.jpg 300w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/figure><\/div>\n\n\n\n<p><br>Test Set :Let\u2019s visualize the test results. First, we\u2019ll plot the actual data points of the training set X_test and y_test, next we\u2019ll plot the regression line which is the same as above.<\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/amineoumous\/bc8c201854879f66bddea7f5500078bc.js\"><\/script>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"320\" height=\"210\" src=\"http:\/\/amineoumous.com\/blog\/wp-content\/uploads\/2023\/08\/amineoumous_plot_test_set.jpg\" alt=\"plot_test_set\" class=\"wp-image-1342\" srcset=\"https:\/\/amineoumous.com\/blog\/wp-content\/uploads\/2023\/08\/amineoumous_plot_test_set.jpg 320w, https:\/\/amineoumous.com\/blog\/wp-content\/uploads\/2023\/08\/amineoumous_plot_test_set-300x197.jpg 300w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Step 7: Predict an Employee Salary<\/h3>\n\n\n\n<p>Alright! We already have the model, now we can use it to predict an Employee Salary based on his years of experience. This is how we do it, for example a person with 15 years experience<\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/amineoumous\/60e0b9eeaa708e9f56498e9abde1b260.js\"><\/script>\n\n\n\n<p>YEAH! \ud83d\ude0e The value of&nbsp;<em>salary_pred<\/em>&nbsp;with X = 15 (15 Years Experience) is&nbsp;<strong>167005.32889087 $<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-text-color has-background has-johannes-acc-background-color has-johannes-acc-color\"\/>\n\n\n\n<p>Simple Linear Regression, we need to follow 5 steps as per below:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li> Importing the dataset.<\/li><li> Splitting dataset into a training set and testing set (Normally, the testing set should be 5% to 30% of the dataset).<\/li><li> Initializing the regression model and fitting it using a training set.<\/li><li> Visualize the training set and testing set (you can skip this step if you want).<\/li><li> Make new predictions<\/li><\/ol>\n\n\n\n<ul class=\"wp-block-list\"><li>If you want to share your models with me on Kaggle here is the link to our dataset:&nbsp;<a href=\"https:\/\/www.kaggle.com\/datasets\/amineoumous\/salary-data\" data-type=\"URL\" data-id=\"https:\/\/www.kaggle.com\/datasets\/amineoumous\/salary-data\" target=\"_blank\" rel=\"noreferrer noopener\">Salary Data &#8211; Kaggle<\/a>.<\/li><li>Here is the&nbsp;<a href=\"https:\/\/www.kaggle.com\/code\/amineoumous\/simple-linear-regression\/notebook\" data-type=\"URL\" data-id=\"https:\/\/www.kaggle.com\/code\/amineoumous\/simple-linear-regression\/notebook\" target=\"_blank\" rel=\"noreferrer noopener\">Full Source Code<\/a>.<\/li><\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>An example of simple linear regression to predict an employee salary, we implement python code using the Scikit-Learn machine learning library.<\/p>\n","protected":false},"author":1,"featured_media":1343,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[94,93,95],"class_list":["post-183","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-data","tag-data","tag-machine-learning","tag-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How can we predict an Employee&#039;s salary ? - Amine&#039;s Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/amineoumous.com\/blog\/2020\/06\/23\/ml-simple-linear-regression\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How can we predict an Employee&#039;s salary ? - Amine&#039;s Blog\" \/>\n<meta property=\"og:description\" content=\"An example of simple linear regression to predict an employee salary, we implement python code using the Scikit-Learn machine learning library.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/amineoumous.com\/blog\/2020\/06\/23\/ml-simple-linear-regression\/\" \/>\n<meta property=\"og:site_name\" content=\"Amine&#039;s Blog\" \/>\n<meta property=\"article:published_time\" content=\"2020-06-23T19:42:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-09-01T16:37:55+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/amineoumous.com\/blog\/wp-content\/uploads\/2018\/12\/amineoumous_ml_Simple_LR.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"600\" \/>\n\t<meta property=\"og:image:height\" content=\"491\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Amine\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Amine\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/amineoumous.com\\\/blog\\\/2020\\\/06\\\/23\\\/ml-simple-linear-regression\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/amineoumous.com\\\/blog\\\/2020\\\/06\\\/23\\\/ml-simple-linear-regression\\\/\"},\"author\":{\"name\":\"Amine\",\"@id\":\"https:\\\/\\\/amineoumous.com\\\/blog\\\/#\\\/schema\\\/person\\\/6743cd27c3f89257502abef0a0d18f6c\"},\"headline\":\"How can we predict an Employee&#8217;s salary ?\",\"datePublished\":\"2020-06-23T19:42:00+00:00\",\"dateModified\":\"2023-09-01T16:37:55+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/amineoumous.com\\\/blog\\\/2020\\\/06\\\/23\\\/ml-simple-linear-regression\\\/\"},\"wordCount\":800,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/amineoumous.com\\\/blog\\\/#\\\/schema\\\/person\\\/6743cd27c3f89257502abef0a0d18f6c\"},\"image\":{\"@id\":\"https:\\\/\\\/amineoumous.com\\\/blog\\\/2020\\\/06\\\/23\\\/ml-simple-linear-regression\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/amineoumous.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/12\\\/amineoumous_ml_Simple_LR.jpg\",\"keywords\":[\"Data\",\"Machine Learning\",\"Tutorials\"],\"articleSection\":[\"Data\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/amineoumous.com\\\/blog\\\/2020\\\/06\\\/23\\\/ml-simple-linear-regression\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/amineoumous.com\\\/blog\\\/2020\\\/06\\\/23\\\/ml-simple-linear-regression\\\/\",\"url\":\"https:\\\/\\\/amineoumous.com\\\/blog\\\/2020\\\/06\\\/23\\\/ml-simple-linear-regression\\\/\",\"name\":\"How can we predict an Employee's salary ? - Amine&#039;s Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/amineoumous.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/amineoumous.com\\\/blog\\\/2020\\\/06\\\/23\\\/ml-simple-linear-regression\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/amineoumous.com\\\/blog\\\/2020\\\/06\\\/23\\\/ml-simple-linear-regression\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/amineoumous.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/12\\\/amineoumous_ml_Simple_LR.jpg\",\"datePublished\":\"2020-06-23T19:42:00+00:00\",\"dateModified\":\"2023-09-01T16:37:55+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/amineoumous.com\\\/blog\\\/2020\\\/06\\\/23\\\/ml-simple-linear-regression\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/amineoumous.com\\\/blog\\\/2020\\\/06\\\/23\\\/ml-simple-linear-regression\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/amineoumous.com\\\/blog\\\/2020\\\/06\\\/23\\\/ml-simple-linear-regression\\\/#primaryimage\",\"url\":\"https:\\\/\\\/amineoumous.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/12\\\/amineoumous_ml_Simple_LR.jpg\",\"contentUrl\":\"https:\\\/\\\/amineoumous.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/12\\\/amineoumous_ml_Simple_LR.jpg\",\"width\":600,\"height\":491},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/amineoumous.com\\\/blog\\\/2020\\\/06\\\/23\\\/ml-simple-linear-regression\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/amineoumous.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How can we predict an Employee&#8217;s salary ?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/amineoumous.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/amineoumous.com\\\/blog\\\/\",\"name\":\"Amine's Blog\",\"description\":\"Welcome to my digital world of innovation and exploration!\",\"publisher\":{\"@id\":\"https:\\\/\\\/amineoumous.com\\\/blog\\\/#\\\/schema\\\/person\\\/6743cd27c3f89257502abef0a0d18f6c\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/amineoumous.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/amineoumous.com\\\/blog\\\/#\\\/schema\\\/person\\\/6743cd27c3f89257502abef0a0d18f6c\",\"name\":\"Amine\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\\\/\\\/amineoumous.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/amineoumous_cover.jpg\",\"url\":\"http:\\\/\\\/amineoumous.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/amineoumous_cover.jpg\",\"contentUrl\":\"http:\\\/\\\/amineoumous.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/amineoumous_cover.jpg\",\"width\":1584,\"height\":768,\"caption\":\"Amine\"},\"logo\":{\"@id\":\"http:\\\/\\\/amineoumous.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/amineoumous_cover.jpg\"},\"sameAs\":[\"http:\\\/\\\/amineoumous.com\\\/blog\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How can we predict an Employee's salary ? - Amine&#039;s Blog","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:\/\/amineoumous.com\/blog\/2020\/06\/23\/ml-simple-linear-regression\/","og_locale":"en_US","og_type":"article","og_title":"How can we predict an Employee's salary ? - Amine&#039;s Blog","og_description":"An example of simple linear regression to predict an employee salary, we implement python code using the Scikit-Learn machine learning library.","og_url":"https:\/\/amineoumous.com\/blog\/2020\/06\/23\/ml-simple-linear-regression\/","og_site_name":"Amine&#039;s Blog","article_published_time":"2020-06-23T19:42:00+00:00","article_modified_time":"2023-09-01T16:37:55+00:00","og_image":[{"width":600,"height":491,"url":"https:\/\/amineoumous.com\/blog\/wp-content\/uploads\/2018\/12\/amineoumous_ml_Simple_LR.jpg","type":"image\/jpeg"}],"author":"Amine","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Amine","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/amineoumous.com\/blog\/2020\/06\/23\/ml-simple-linear-regression\/#article","isPartOf":{"@id":"https:\/\/amineoumous.com\/blog\/2020\/06\/23\/ml-simple-linear-regression\/"},"author":{"name":"Amine","@id":"https:\/\/amineoumous.com\/blog\/#\/schema\/person\/6743cd27c3f89257502abef0a0d18f6c"},"headline":"How can we predict an Employee&#8217;s salary ?","datePublished":"2020-06-23T19:42:00+00:00","dateModified":"2023-09-01T16:37:55+00:00","mainEntityOfPage":{"@id":"https:\/\/amineoumous.com\/blog\/2020\/06\/23\/ml-simple-linear-regression\/"},"wordCount":800,"commentCount":0,"publisher":{"@id":"https:\/\/amineoumous.com\/blog\/#\/schema\/person\/6743cd27c3f89257502abef0a0d18f6c"},"image":{"@id":"https:\/\/amineoumous.com\/blog\/2020\/06\/23\/ml-simple-linear-regression\/#primaryimage"},"thumbnailUrl":"https:\/\/amineoumous.com\/blog\/wp-content\/uploads\/2018\/12\/amineoumous_ml_Simple_LR.jpg","keywords":["Data","Machine Learning","Tutorials"],"articleSection":["Data"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/amineoumous.com\/blog\/2020\/06\/23\/ml-simple-linear-regression\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/amineoumous.com\/blog\/2020\/06\/23\/ml-simple-linear-regression\/","url":"https:\/\/amineoumous.com\/blog\/2020\/06\/23\/ml-simple-linear-regression\/","name":"How can we predict an Employee's salary ? - Amine&#039;s Blog","isPartOf":{"@id":"https:\/\/amineoumous.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/amineoumous.com\/blog\/2020\/06\/23\/ml-simple-linear-regression\/#primaryimage"},"image":{"@id":"https:\/\/amineoumous.com\/blog\/2020\/06\/23\/ml-simple-linear-regression\/#primaryimage"},"thumbnailUrl":"https:\/\/amineoumous.com\/blog\/wp-content\/uploads\/2018\/12\/amineoumous_ml_Simple_LR.jpg","datePublished":"2020-06-23T19:42:00+00:00","dateModified":"2023-09-01T16:37:55+00:00","breadcrumb":{"@id":"https:\/\/amineoumous.com\/blog\/2020\/06\/23\/ml-simple-linear-regression\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/amineoumous.com\/blog\/2020\/06\/23\/ml-simple-linear-regression\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/amineoumous.com\/blog\/2020\/06\/23\/ml-simple-linear-regression\/#primaryimage","url":"https:\/\/amineoumous.com\/blog\/wp-content\/uploads\/2018\/12\/amineoumous_ml_Simple_LR.jpg","contentUrl":"https:\/\/amineoumous.com\/blog\/wp-content\/uploads\/2018\/12\/amineoumous_ml_Simple_LR.jpg","width":600,"height":491},{"@type":"BreadcrumbList","@id":"https:\/\/amineoumous.com\/blog\/2020\/06\/23\/ml-simple-linear-regression\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/amineoumous.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How can we predict an Employee&#8217;s salary ?"}]},{"@type":"WebSite","@id":"https:\/\/amineoumous.com\/blog\/#website","url":"https:\/\/amineoumous.com\/blog\/","name":"Amine's Blog","description":"Welcome to my digital world of innovation and exploration!","publisher":{"@id":"https:\/\/amineoumous.com\/blog\/#\/schema\/person\/6743cd27c3f89257502abef0a0d18f6c"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/amineoumous.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/amineoumous.com\/blog\/#\/schema\/person\/6743cd27c3f89257502abef0a0d18f6c","name":"Amine","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/amineoumous.com\/blog\/wp-content\/uploads\/2023\/09\/amineoumous_cover.jpg","url":"http:\/\/amineoumous.com\/blog\/wp-content\/uploads\/2023\/09\/amineoumous_cover.jpg","contentUrl":"http:\/\/amineoumous.com\/blog\/wp-content\/uploads\/2023\/09\/amineoumous_cover.jpg","width":1584,"height":768,"caption":"Amine"},"logo":{"@id":"http:\/\/amineoumous.com\/blog\/wp-content\/uploads\/2023\/09\/amineoumous_cover.jpg"},"sameAs":["http:\/\/amineoumous.com\/blog"]}]}},"views":428,"_links":{"self":[{"href":"https:\/\/amineoumous.com\/blog\/wp-json\/wp\/v2\/posts\/183","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/amineoumous.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/amineoumous.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/amineoumous.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/amineoumous.com\/blog\/wp-json\/wp\/v2\/comments?post=183"}],"version-history":[{"count":3,"href":"https:\/\/amineoumous.com\/blog\/wp-json\/wp\/v2\/posts\/183\/revisions"}],"predecessor-version":[{"id":1348,"href":"https:\/\/amineoumous.com\/blog\/wp-json\/wp\/v2\/posts\/183\/revisions\/1348"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/amineoumous.com\/blog\/wp-json\/wp\/v2\/media\/1343"}],"wp:attachment":[{"href":"https:\/\/amineoumous.com\/blog\/wp-json\/wp\/v2\/media?parent=183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/amineoumous.com\/blog\/wp-json\/wp\/v2\/categories?post=183"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/amineoumous.com\/blog\/wp-json\/wp\/v2\/tags?post=183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}