<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Jasty Manya on Medium]]></title>
        <description><![CDATA[Stories by Jasty Manya on Medium]]></description>
        <link>https://medium.com/@jastymanya?source=rss-ecb84ca497f5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*XFkoLIxPd3Wo1bAU.</url>
            <title>Stories by Jasty Manya on Medium</title>
            <link>https://medium.com/@jastymanya?source=rss-ecb84ca497f5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 10:30:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jastymanya/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[10 days of Machine learning]]></title>
            <link>https://medium.com/@jastymanya/10-days-of-machine-learning-de06727e7c65?source=rss-ecb84ca497f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/de06727e7c65</guid>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Jasty Manya]]></dc:creator>
            <pubDate>Sun, 15 May 2022 06:33:33 GMT</pubDate>
            <atom:updated>2022-05-15T06:33:33.319Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>DAY FOUR</strong></p><h3>Multiple Linear Regression</h3><p>In the previous topic, we have learned about Simple Linear Regression, where a single Independent/Predictor(X) variable is used to model the response variable (Y). But there may be various cases in which the response variable is affected by more than one predictor variable; for such cases, the Multiple Linear Regression algorithm is used.</p><p>Moreover, Multiple Linear Regression is an extension of Simple Linear regression as it takes more than one predictor variable to predict the response variable. We can define it as:</p><blockquote>Multiple Linear Regression is one of the important regression algorithms which models the linear relationship between a single dependent continuous variable and more than one independent variable.</blockquote><p><strong>Example:</strong></p><p>Prediction of CO2 emission based on engine size and number of cylinders in a car.</p><p><strong>Some key points about MLR:</strong></p><ul><li>For MLR, the dependent or target variable(Y) must be the continuous/real, but the predictor or independent variable may be of continuous or categorical form.</li><li>Each feature variable must model the linear relationship with the dependent variable.</li><li>MLR tries to fit a regression line through a multidimensional space of data-points.</li></ul><h3>MLR equation:</h3><p>In Multiple Linear Regression, the target variable(Y) is a linear combination of multiple predictor variables x1, x2, x3, …,xn.</p><h3>Implementation of Multiple Linear Regression model using Python:</h3><p>To implement MLR using Python, we have below problem:</p><p><strong>Problem Description:</strong></p><p>We have a dataset of <strong>50 start-up companies</strong>. This dataset contains five main information: <strong>R&amp;D Spend, Administration Spend, Marketing Spend, State, and Profit for a financial year</strong>. Our goal is to create a model that can easily determine which company has a maximum profit, and which is the most affecting factor for the profit of a company.</p><p>Since we need to find the Profit, so it is the dependent variable, and the other four variables are independent variables. Below are the main steps of deploying the MLR model:</p><ol><li><strong>Data Pre-processing Steps</strong></li><li><strong>Fitting the MLR model to the training set</strong></li><li><strong>Predicting the result of the test set</strong></li></ol><h3>ML Polynomial Regression</h3><ul><li>Polynomial Regression is a regression algorithm that models the relationship between a dependent(y) and independent variable(x) as nth degree polynomial. The Polynomial Regression equation is given below:</li></ul><pre>y= b0+b1x1+ b2x12+ b2x13+...... bnx1n</pre><ul><li>It is also called the special case of Multiple Linear Regression in ML. Because we add some polynomial terms to the Multiple Linear regression equation to convert it into Polynomial Regression.</li><li>It is a linear model with some modification in order to increase the accuracy.</li><li>The dataset used in Polynomial regression for training is of non-linear nature.</li><li>It makes use of a linear regression model to fit the complicated and non-linear functions and datasets.</li><li><strong>Hence, <em>“In Polynomial regression, the original features are converted into Polynomial features of required degree (2,3,..,n) and then modeled using a linear model.”</em></strong></li></ul><h3>Support Vector Machine Algorithm</h3><p>Support Vector Machine or SVM is one of the most popular Supervised Learning algorithms, which is used for Classification as well as Regression problems. However, primarily, it is used for Classification problems in Machine Learning.</p><p>The goal of the SVM algorithm is to create the best line or decision boundary that can segregate n-dimensional space into classes so that we can easily put the new data point in the correct category in the future. This best decision boundary is called a hyperplane.</p><p>SVM chooses the extreme points/vectors that help in creating the hyperplane. These extreme cases are called as support vectors, and hence algorithm is termed as Support Vector Machine. Consider the below diagram in which there are two different categories that are classified using a decision boundary or hyperplane:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*tM9z0JmHCQxnizyH.png" /></figure><p><strong>Example:</strong> SVM can be understood with the example that we have used in the KNN classifier. Suppose we see a strange cat that also has some features of dogs, so if we want a model that can accurately identify whether it is a cat or dog, so such a model can be created by using the SVM algorithm. We will first train our model with lots of images of cats and dogs so that it can learn about different features of cats and dogs, and then we test it with this strange creature. So as support vector creates a decision boundary between these two data (cat and dog) and choose extreme cases (support vectors), it will see the extreme case of cat and dog. On the basis of the support vectors, it will classify it as a cat. Consider the below diagram:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*aii7-Gw_sw-vjJB0.png" /></figure><p>SVM algorithm can be used for <strong>Face detection, image classification, text categorization,</strong> etc.</p><h3>Types of SVM</h3><p><strong>SVM can be of two types:</strong></p><ul><li><strong>Linear SVM:</strong> Linear SVM is used for linearly separable data, which means if a dataset can be classified into two classes by using a single straight line, then such data is termed as linearly separable data, and classifier is used called as Linear SVM classifier.</li><li><strong>Non-linear SVM:</strong> Non-Linear SVM is used for non-linearly separated data, which means if a dataset cannot be classified by using a straight line, then such data is termed as non-linear data and classifier used is called as Non-linear SVM classifier.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de06727e7c65" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[10 days of Machine learning]]></title>
            <link>https://medium.com/@jastymanya/day-3-a6ad119b844a?source=rss-ecb84ca497f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6ad119b844a</guid>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Jasty Manya]]></dc:creator>
            <pubDate>Wed, 11 May 2022 10:06:39 GMT</pubDate>
            <atom:updated>2022-05-12T07:25:52.579Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*Vns13bMpXR_0biib0mLAHg.png" /></figure><h3><strong>DAY THREE</strong></h3><h3>Supervised Machine Learning</h3><p>Supervised learning is the types of machine learning in which machines are trained using well “labelled” training data, and on basis of that data, machines predict the output. The labelled data means some input data is already tagged with the correct output.</p><p>In supervised learning, the training data provided to the machines work as the supervisor that teaches the machines to predict the output correctly. It applies the same concept as a student learns in the supervision of the teacher.</p><p>Supervised learning is a process of providing input data as well as correct output data to the machine learning model. The aim of a supervised learning algorithm is to <strong>find a mapping function to map the input variable(x) with the output variable(y)</strong>.</p><p>In the real-world, supervised learning can be used for <strong>Risk Assessment, Image classification, Fraud Detection, spam filtering</strong>, etc.</p><h3>How Supervised Learning Works?</h3><p>In supervised learning, models are trained using labelled dataset, where the model learns about each type of data. Once the training process is completed, the model is tested on the basis of test data (a subset of the training set), and then it predicts the output.</p><p>The working of Supervised learning can be easily understood by the below example and diagram:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*KiFqBGCsR2ctWgqK.png" /></figure><p>Suppose we have a dataset of different types of shapes which includes square, rectangle, triangle, and Polygon. Now the first step is that we need to train the model for each shape.</p><ul><li>If the given shape has four sides, and all the sides are equal, then it will be labelled as a <strong>Square</strong>.</li><li>If the given shape has three sides, then it will be labelled as a <strong>triangle</strong>.</li><li>If the given shape has six equal sides then it will be labelled as <strong>hexagon</strong>.</li></ul><p>Now, after training, we test our model using the test set, and the task of the model is to identify the shape.</p><p>The machine is already trained on all types of shapes, and when it finds a new shape, it classifies the shape on the bases of a number of sides, and predicts the output.</p><h3>Steps Involved in Supervised Learning:</h3><ul><li>First Determine the type of training dataset</li><li>Collect/Gather the labelled training data.</li><li>Split the training dataset into training <strong>dataset, test dataset, and validation dataset</strong>.</li><li>Determine the input features of the training dataset, which should have enough knowledge so that the model can accurately predict the output.</li><li>Determine the suitable algorithm for the model, such as support vector machine, decision tree, etc.</li><li>Execute the algorithm on the training dataset. Sometimes we need validation sets as the control parameters, which are the subset of training datasets.</li><li>Evaluate the accuracy of the model by providing the test set. If the model predicts the correct output, which means our model is accurate.</li></ul><h3>Types of supervised Machine learning Algorithms:</h3><p>Supervised learning can be further divided into two types of problems:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*5EVgUYlfXW0mIVje.png" /></figure><p><strong>1. Regression</strong></p><p>Regression algorithms are used if there is a relationship between the input variable and the output variable. It is used for the prediction of continuous variables, such as Weather forecasting, Market Trends, etc. Below are some popular Regression algorithms which come under supervised learning:</p><ul><li>Linear Regression</li><li>Regression Trees</li><li>Non-Linear Regression</li><li>Bayesian Linear Regression</li><li>Polynomial Regression</li></ul><p><strong>2. Classification</strong></p><p>Classification algorithms are used when the output variable is categorical, which means there are two classes such as Yes-No, Male-Female, True-false, etc.</p><p>Spam Filtering,</p><ul><li>Random Forest</li><li>Decision Trees</li><li>Logistic Regression</li><li>Support vector Machines</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6ad119b844a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[10 days of Machine learning]]></title>
            <link>https://medium.com/@jastymanya/day-two-c3d7708b787a?source=rss-ecb84ca497f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/c3d7708b787a</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[10dayschallenge]]></category>
            <dc:creator><![CDATA[Jasty Manya]]></dc:creator>
            <pubDate>Tue, 10 May 2022 11:36:24 GMT</pubDate>
            <atom:updated>2022-05-12T07:25:20.528Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>DAY TWO</strong></p><h3>Machine learning Life cycle</h3><p>Machine learning has given the computer systems the abilities to automatically learn without being explicitly programmed. But how does a machine learning system work? So, it can be described using the life cycle of machine learning. Machine learning life cycle is a cyclic process to build an efficient machine learning project. The main purpose of the life cycle is to find a solution to the problem or project.</p><p>Machine learning life cycle involves seven major steps, which are given below:</p><ul><li><strong>Gathering Data</strong></li><li><strong>Data preparation</strong></li><li><strong>Data Wrangling</strong></li><li><strong>Analyze Data</strong></li><li><strong>Train the model</strong></li><li><strong>Test the model</strong></li><li><strong>Deployment</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/493/0*YemGIyk_oEv-SCt7.png" /></figure><p>The most important thing in the complete process is to understand the problem and to know the purpose of the problem. Therefore, before starting the life cycle, we need to understand the problem because the good result depends on the better understanding of the problem.</p><p>In the complete life cycle process, to solve a problem, we create a machine learning system called “model”, and this model is created by providing “training”. But to train a model, we need data, hence, life cycle starts by collecting data.</p><h3>1. Gathering Data:</h3><p>Data Gathering is the first step of the machine learning life cycle. The goal of this step is to identify and obtain all data-related problems.</p><p>In this step, we need to identify the different data sources, as data can be collected from various sources such as <strong>files</strong>, <strong>database</strong>, <strong>internet</strong>, or <strong>mobile devices</strong>. It is one of the most important steps of the life cycle. The quantity and quality of the collected data will determine the efficiency of the output. The more will be the data, the more accurate will be the prediction.</p><p>This step includes the below tasks:</p><ul><li><strong>Identify various data sources</strong></li><li><strong>Collect data</strong></li><li><strong>Integrate the data obtained from different sources</strong></li></ul><p>By performing the above task, we get a coherent set of data, also called as a <strong>dataset</strong>. It will be used in further steps.</p><h3>2. Data preparation</h3><p>After collecting the data, we need to prepare it for further steps. Data preparation is a step where we put our data into a suitable place and prepare it to use in our machine learning training.</p><p>In this step, first, we put all data together, and then randomize the ordering of data.</p><p>This step can be further divided into two processes:</p><ul><li><strong>Data exploration:</strong><br>It is used to understand the nature of data that we have to work with. We need to understand the characteristics, format, and quality of data.<br>A better understanding of data leads to an effective outcome. In this, we find Correlations, general trends, and outliers.</li><li><strong>Data pre-processing:</strong><br>Now the next step is preprocessing of data for its analysis.</li></ul><h3>3. Data Wrangling</h3><p>Data wrangling is the process of cleaning and converting raw data into a useable format. It is the process of cleaning the data, selecting the variable to use, and transforming the data in a proper format to make it more suitable for analysis in the next step. It is one of the most important steps of the complete process. Cleaning of data is required to address the quality issues.</p><p>It is not necessary that data we have collected is always of our use as some of the data may not be useful. In real-world applications, collected data may have various issues, including:</p><ul><li><strong>Missing Values</strong></li><li><strong>Duplicate data</strong></li><li><strong>Invalid data</strong></li><li><strong>Noise</strong></li></ul><p>So, we use various filtering techniques to clean the data.</p><p>It is mandatory to detect and remove the above issues because it can negatively affect the quality of the outcome.</p><h3>4. Data Analysis</h3><p>Now the cleaned and prepared data is passed on to the analysis step. This step involves:</p><ul><li><strong>Selection of analytical techniques</strong></li><li><strong>Building models</strong></li><li><strong>Review the result</strong></li></ul><p>The aim of this step is to build a machine learning model to analyze the data using various analytical techniques and review the outcome. It starts with the determination of the type of the problems, where we select the machine learning techniques such as <strong>Classification</strong>, <strong>Regression</strong>, <strong>Cluster analysis</strong>, <strong>Association</strong>, etc. then build the model using prepared data, and evaluate the model.</p><p>Hence, in this step, we take the data and use machine learning algorithms to build the model.</p><h3>5. Train Model</h3><p>Now the next step is to train the model, in this step we train our model to improve its performance for better outcome of the problem.</p><p>We use datasets to train the model using various machine learning algorithms. Training a model is required so that it can understand the various patterns, rules, and, features.</p><h3>6. Test Model</h3><p>Once our machine learning model has been trained on a given dataset, then we test the model. In this step, we check for the accuracy of our model by providing a test dataset to it.</p><p>Testing the model determines the percentage accuracy of the model as per the requirement of project or problem.</p><h3>7. Deployment</h3><p>The last step of machine learning life cycle is deployment, where we deploy the model in the real-world system.</p><p>If the above-prepared model is producing an accurate result as per our requirement with acceptable speed, then we deploy the model in the real system. But before deploying the project, we will check whether it is improving its performance using available data or not. The deployment phase is similar to making the final report for a project.</p><h3>Data Preprocessing in Machine learning</h3><p>Data preprocessing is a process of preparing the raw data and making it suitable for a machine learning model. It is the first and crucial step while creating a machine learning model.</p><p>When creating a machine learning project, it is not always a case that we come across the clean and formatted data. And while doing any operation with data, it is mandatory to clean it and put in a formatted way. So for this, we use data preprocessing task.</p><h3>Why do we need Data Preprocessing?</h3><p>A real-world data generally contains noises, missing values, and maybe in an unusable format which cannot be directly used for machine learning models. Data preprocessing is required tasks for cleaning the data and making it suitable for a machine learning model which also increases the accuracy and efficiency of a machine learning model.</p><p>It involves below steps:</p><ul><li><strong>Getting the dataset</strong></li><li><strong>Importing libraries</strong></li><li><strong>Importing datasets</strong></li><li><strong>Finding Missing Data</strong></li><li><strong>Encoding Categorical Data</strong></li><li><strong>Splitting dataset into training and test set</strong></li><li><strong>Feature scaling</strong></li></ul><h3>1) Get the Dataset</h3><p>To create a machine learning model, the first thing we required is a dataset as a machine learning model completely works on data. The collected data for a particular problem in a proper format is known as the <strong>dataset</strong>.</p><p>Dataset may be of different formats for different purposes, such as, if we want to create a machine learning model for business purpose, then dataset will be different with the dataset required for a liver patient. So each dataset is different from another dataset. To use the dataset in our code, we usually put it into a CSV <strong>file</strong>. However, sometimes, we may also need to use an HTML or xlsx file.</p><h3>2) Importing Libraries</h3><p>In order to perform data preprocessing using Python, we need to import some predefined Python libraries. These libraries are used to perform some specific jobs. There are three specific libraries that we will use for data preprocessing, which are:</p><p><strong>Numpy:</strong> Numpy Python library is used for including any type of mathematical operation in the code. It is the fundamental package for scientific calculation in Python. It also supports to add large, multidimensional arrays and matrices. So, in Python, we can import it as:</p><p><strong>Matplotlib:</strong> The second library is <strong>matplotlib</strong>, which is a Python 2D plotting library, and with this library, we need to import a sub-library <strong>pyplot</strong>. This library is used to plot any type of charts in Python for the code. It will be imported as below:</p><p><strong>Pandas:</strong> The last library is the Pandas library, which is one of the most famous Python libraries and used for importing and managing the datasets. It is an open-source data manipulation and analysis library.</p><h3>3) Importing the Datasets</h3><p>Now we need to import the datasets which we have collected for our machine learning project.</p><p><strong>Extracting dependent and independent variables:</strong></p><p>In machine learning, it is important to distinguish the matrix of features (independent variables) and dependent variables from dataset. In our dataset, there are three independent variables that are <strong>Country, Age</strong>, and <strong>Salary</strong>, and one is a dependent variable which is <strong>Purchased</strong>.</p><p><strong>Extracting independent variable:</strong></p><p>To extract an independent variable, we will use <strong>iloc[ ] </strong>method of Pandas library. It is used to extract the required rows and columns from the dataset.</p><p><strong>Extracting dependent variable:</strong></p><p>To extract dependent variables, again, we will use Pandas .iloc[] method.</p><ol><li>y= data_set.iloc[:,3].values</li></ol><p>Here we have taken all the rows with the last column only. It will give the array of dependent variables.</p><h3>4) Handling Missing data:</h3><p>The next step of data preprocessing is to handle missing data in the datasets. If our dataset contains some missing data, then it may create a huge problem for our machine learning model. Hence it is necessary to handle missing values present in the dataset.</p><p><strong>Ways to handle missing data:</strong></p><p>There are mainly two ways to handle missing data, which are:</p><p><strong>By deleting the particular row:</strong> The first way is used to commonly deal with null values. In this way, we just delete the specific row or column which consists of null values. But this way is not so efficient and removing data may lead to loss of information which will not give the accurate output.</p><p><strong>By calculating the mean:</strong> In this way, we will calculate the mean of that column or row which contains any missing value and will put it on the place of missing value. This strategy is useful for the features which have numeric data such as age, salary, year, etc. Here, we will use this approach.</p><h3>5) Encoding Categorical data:</h3><p>Categorical data is data which has some categories such as, in our dataset; there are two categorical variable, <strong>Country</strong>, and <strong>Purchased</strong>.</p><p>Since machine learning model completely works on mathematics and numbers, but if our dataset would have a categorical variable, then it may create trouble while building the model. So it is necessary to encode these categorical variables into numbers.</p><p><strong>For Country variable:</strong></p><p>Firstly, we will convert the country variables into categorical data. So to do this, we will use <strong>LabelEncoder()</strong> class from <strong>preprocessing</strong> library.</p><p><strong>Dummy Variables:</strong></p><p>Dummy variables are those variables which have values 0 or 1. The 1 value gives the presence of that variable in a particular column, and rest variables become 0. With dummy encoding, we will have a number of columns equal to the number of categories.</p><p>In our dataset, we have 3 categories so it will produce three columns having 0 and 1 values. For Dummy Encoding, we will use <strong>OneHotEncoder</strong> class of <strong>preprocessing</strong> library.</p><p><strong>For Purchased Variable:</strong></p><ol><li>labelencoder_y= LabelEncoder()</li><li>y= labelencoder_y.fit_transform(y)</li></ol><p>For the second categorical variable, we will only use labelencoder object of <strong>LableEncoder</strong> class. Here we are not using <strong>OneHotEncoder</strong> class because the purchased variable has only two categories yes or no, and which are automatically encoded into 0 and 1.</p><h3>6) Splitting the Dataset into the Training set and Test set</h3><p>In machine learning data preprocessing, we divide our dataset into a training set and test set. This is one of the crucial steps of data preprocessing as by doing this, we can enhance the performance of our machine learning model.</p><p>Suppose, if we have given training to our machine learning model by a dataset and we test it by a completely different dataset. Then, it will create difficulties for our model to understand the correlations between the models.</p><p>If we train our model very well and its training accuracy is also very high, but we provide a new dataset to it, then it will decrease the performance. So we always try to make a machine learning model which performs well with the training set and also with the test dataset. Here, we can define these datasets as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/549/0*5ubhYyIN5AUfmQUF.png" /></figure><p><strong>Training Set:</strong> A subset of dataset to train the machine learning model, and we already know the output.</p><p><strong>Test set:</strong> A subset of dataset to test the machine learning model, and by using the test set, model predicts the output.</p><p>For splitting the dataset, we will use the below lines of code:</p><ol><li>from sklearn.model_selection import train_test_split</li><li>x_train, x_test, y_train, y_test= train_test_split(x, y, test_size= 0.2, random_state=0)</li></ol><p><strong>Explanation:</strong></p><ul><li>In the above code, the first line is used for splitting arrays of the dataset into random train and test subsets.</li><li>In the second line, we have used four variables for our output that are</li><li><strong>x_train:</strong> features for the training data</li><li><strong>x_test:</strong> features for testing data</li><li><strong>y_train:</strong> Dependent variables for training data</li><li><strong>y_test:</strong> Independent variable for testing data</li><li>In <strong>train_test_split() function</strong>, we have passed four parameters in which first two are for arrays of data, and <strong>test_size</strong> is for specifying the size of the test set. The test_size maybe .5, .3, or .2, which tells the dividing ratio of training and testing sets.</li><li>The last parameter <strong>random_state</strong> is used to set a seed for a random generator so that you always get the same result, and the most used value for this is 42.</li></ul><h3>7) Feature Scaling</h3><p>Feature scaling is the final step of data preprocessing in machine learning. It is a technique to standardize the independent variables of the dataset in a specific range. In feature scaling, we put our variables in the same range and in the same scale so that no any variable dominate the other variable.</p><p>As we can see, the age and salary column values are not on the same scale. A machine learning model is based on <strong>Euclidean distance</strong>, and if we do not scale the variable, then it will cause some issue in our machine learning model.</p><p>Euclidean distance is given as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/513/0*REuzmu6eV8-ywLYq.png" /></figure><p>If we compute any two values from age and salary, then salary values will dominate the age values, and it will produce an incorrect result. So to remove this issue, we need to perform feature scaling for machine learning.</p><p>There are two ways to perform feature scaling in machine learning:</p><p><strong>Standardization</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/466/0*N9rmCpqZZ35yVb4R.png" /></figure><p><strong>Normalization</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/418/0*3-va57ASU3u-b0M7.png" /></figure><p>Here, we will use the standardization method for our dataset.</p><p>For feature scaling, we will import <strong><em>StandardScaler</em></strong> class of <strong><em>sklearn.preprocessing</em></strong> library as:</p><ol><li>from sklearn.preprocessing import StandardScaler</li></ol><p>Now, we will create the object of <strong>StandardScaler</strong> class for independent variables or features. And then we will fit and transform the training dataset.</p><ol><li>st_x= StandardScaler()</li><li>x_train= st_x.fit_transform(x_train)</li></ol><p>For test dataset, we will directly apply <strong>transform()</strong> function instead of <strong>fit_transform()</strong> because it is already done in training set.</p><ol><li>x_test= st_x.transform(x_test)</li></ol><p>Here is a link to the github repository for more explanation. <a href="https://github.com/JASTYN/Machine-Learning-techniques-/tree/main/Day%201">https://github.com/JASTYN/Machine-Learning-techniques-</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c3d7708b787a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[10 days of Machine learning]]></title>
            <link>https://medium.com/@jastymanya/21-days-of-machine-learning-be5fff5c0e64?source=rss-ecb84ca497f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/be5fff5c0e64</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Jasty Manya]]></dc:creator>
            <pubDate>Mon, 09 May 2022 12:53:54 GMT</pubDate>
            <atom:updated>2022-05-09T13:32:45.438Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U_xjXtHS9VZOG3bGkEs5OQ.png" /></figure><p><strong>DAY ONE.</strong></p><p><strong>Welcome to 21 days Machine learning series. </strong>Machine Learning is said as a subset of <strong>artificial intelligence</strong> that is mainly concerned with the development of algorithms which allow a computer to learn from the data and past experiences on their own. The term machine learning was first introduced by <strong>Arthur Samuel</strong> in <strong>1959</strong>. We can define it in a summarized way as:</p><blockquote><em>Machine learning enables a machine to automatically learn from data, improve performance from experiences, and predict things without being explicitly programmed.</em></blockquote><p>With the help of sample historical data, which is known as <strong>training data</strong>, machine learning algorithms build a <strong>mathematical model</strong> that helps in making predictions or decisions without being explicitly programmed. Machine learning brings computer science and statistics together for creating predictive models. Machine learning constructs or uses the algorithms that learn from historical data. The more we will provide the information, the higher will be the performance.</p><h3>Features of Machine Learning:</h3><ul><li>Machine learning uses data to detect various patterns in a given dataset.</li><li>It can learn from past data and improve automatically.</li><li>It is a data-driven technology.</li><li>Machine learning is much similar to data mining as it also deals with the huge amount of the data.</li></ul><h3>Classification of Machine Learning</h3><p>At a broad level, machine learning can be classified into three types:</p><ol><li><strong>Supervised learning</strong></li><li><strong>Unsupervised learning</strong></li><li><strong>Reinforcement learning</strong></li></ol><h3>1) Supervised Learning</h3><p>Supervised learning is a type of machine learning method in which we provide sample labeled data to the machine learning system in order to train it, and on that basis, it predicts the output.</p><p>The system creates a model using labeled data to understand the datasets and learn about each data, once the training and processing are done then we test the model by providing a sample data to check whether it is predicting the exact output or not.</p><p>The goal of supervised learning is to map input data with the output data. The supervised learning is based on supervision, and it is the same as when a student learns things in the supervision of the teacher. The example of supervised learning is <strong>spam filtering</strong>.</p><p>Supervised learning can be grouped further in two categories of algorithms:</p><ul><li><strong>Classification</strong></li><li><strong>Regression</strong></li></ul><h3>2) Unsupervised Learning</h3><p>Unsupervised learning is a learning method in which a machine learns without any supervision.</p><p>The training is provided to the machine with the set of data that has not been labeled, classified, or categorized, and the algorithm needs to act on that data without any supervision. The goal of unsupervised learning is to restructure the input data into new features or a group of objects with similar patterns.</p><p>In unsupervised learning, we don’t have a predetermined result. The machine tries to find useful insights from the huge amount of data. It can be further classifieds into two categories of algorithms:</p><ul><li><strong>Clustering</strong></li><li><strong>Association</strong></li></ul><h3>3) Reinforcement Learning</h3><p>Reinforcement learning is a feedback-based learning method, in which a learning agent gets a reward for each right action and gets a penalty for each wrong action. The agent learns automatically with these feedbacks and improves its performance. In reinforcement learning, the agent interacts with the environment and explores it. The goal of an agent is to get the most reward points, and hence, it improves its performance.</p><p>The robotic dog, which automatically learns the movement of his arms, is an example of Reinforcement learning.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be5fff5c0e64" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>