<?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 VINAY KOLI on Medium]]></title>
        <description><![CDATA[Stories by VINAY KOLI on Medium]]></description>
        <link>https://medium.com/@vinaykoli10?source=rss-98e4630ec681------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*glbL5cBZ8uQGB7_x</url>
            <title>Stories by VINAY KOLI on Medium</title>
            <link>https://medium.com/@vinaykoli10?source=rss-98e4630ec681------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 06:43:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vinaykoli10/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[Step by Step Guide to build your First ML model.]]></title>
            <link>https://medium.com/@vinaykoli10/step-by-step-guide-to-build-your-first-ml-model-in-python-2bcdabcf54dd?source=rss-98e4630ec681------2</link>
            <guid isPermaLink="false">https://medium.com/p/2bcdabcf54dd</guid>
            <dc:creator><![CDATA[VINAY KOLI]]></dc:creator>
            <pubDate>Fri, 09 May 2025 15:17:42 GMT</pubDate>
            <atom:updated>2025-05-13T15:42:31.977Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OT61hSIjmB51hrP1.jpg" /></figure><h3><strong>Introduction</strong></h3><p>Machine Learning is one of the best AI (Artificial Intelligence) technique to handle data and create many different models to understand different problem and predict future trends. In today’s time ML models are used everywhere to understand the trends and all the predictions.</p><p>From this blog we will get to know different models we can use to create a best model for beginners.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*P3-dKciwhT5UL-Z4" /></figure><h3><strong>Model Types in ML</strong></h3><p>There are different types of methods used to create a model. But before that lets know the types of Machine learning.</p><ol><li>Supervised Machine Learning (Dealing with Labelled Datasets)</li><li>Unsupervised Machine Learning (Dealing with Unlabeled Datasets)</li><li>Semi-Supervised Machine Learning (Using Both Supervised &amp; Unsupervised)</li><li>Reinforcement Learning</li></ol><p>Now let’s talk about every model a beginner can use for building his model.</p><p>In this blog we will be mostly be talking about Logistic Regression, Decision Tree &amp; Random Forest. since this models are most widely been used.</p><h3><strong>Logistic Regression</strong></h3><p>This model is used while handling a supervised (Labelled Datasets), ie both the X and Y data are known. And Y data are always Discrete and Categorical. Logistic regression allows us to perform regression in order to measure the relationship between the Independent Variables and the Dependent Variables and helps us predict the probability of every data point to belong to either of the classes. It uses the sigmoid function that helps converting any real value data (-oo +oo) to range of 0 to 1. It uses the odds ratio which is the probability of success divided by the probability of failure based on which the logit function helps us get a final probability value based on the regression equation.</p><p>Types of Logistic regression</p><p>1)Binary Logistic Regression :- In this we use 2 classes, it models the probability that a given input belongs to a particular class (e.g., 0 or 1, Yes or No, Spam or Not Spam).It uses a sigmoid (logistic) function to convert a linear combination of inputs into a probability between 0 and hence we call them Binary Logistic Regression.</p><p>2)Multinomial Logistic Regression-It uses More than 2 classes, used when the target variable has more than two classes. Unlike binary logistic regression, which handles only two outcomes (0 or 1), multi-class logistic regression handles three or more categories (e.g., class A, B, C).</p><p>For Training Phase we divide the data into 80–20 ratio. By default the model divides the data into 75–25 ratio, i.e. 75% data is used for training and 25% data is used for testing. We put input as both X, Y this are the historical data. And the output will be the logistic regression equation for the best fit line, which will be generated. Behind the scenes<strong> </strong>it uses this formula to calculate the best fit line <strong>y = ß0+ß1X1+ß2X2+ß3X3+…+ßnXn</strong></p><p>For testing Phase, we will only put X as the input so that with this value it will predict the Probability Matrix. The final Predicted value based on the matrix depending upon which class has the highest probability. Once this is finalized, we can create a column and let add all the predicted values in them for each data.</p><p>To evaluate the accuracy of the model we can use different types of matric such as Confusion matric, accuracy score, recall, precision, f1_score.</p><p>To increase the accuracy score of the model we can tune the model by doing Feature Selection, Adjustment of threshold (Dedicated Approach)</p><p>Points to remember</p><ol><li>It works on the bases of probabilities.</li><li>It is more suitable in binary in comparison to multiclass classification.</li><li>Very much suitable for clearly Separable Data.</li><li>It uses the MLE (Maximum Likelihood Estimate) approach.</li></ol><h3>Decision Tree</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*xV_rF1pmR6TmNu5y.png" /></figure><p>This is most preferred model building, because it is used for smaller and larger data. It is used for Supervised Dataset, which means both X and Y are known. It also has Y discrete, categorical and continuous. This model can be used to solve classification as well as regression datasets. Decision tree-will build a tree like structures where it starts with the entire data, and splits it into homogenous subsets, based on the most significant independent variable found on each level in the tree. This process of splitting continuous until all the subsets at the last level are homogeneous. This model helps to understand dataset very easily because it divides the data in sub categories or root leaf nodes/parent child node. It is very much useful for data Exploration i.e. it gets the values of each and every variables. It needs less data cleaning, because it divides the data in root and leaf nodes. The data types is not constraint, and it uses Non parametric methods. But with advantage it even has disadvantage, it gets over fitted and this method is not fit for continuous variables. Because the regression tree are used when dependent variables are continuous.</p><p>Decision tree is <strong>Greedy algorithm, </strong>because<strong> </strong>the algorithm cares only the current split and not about the future split which will lead to a better tree i.e. it looks for the best variables and starts dividing the data.</p><p>How does a tree based algorithms decide where to split? How does decision tree choose the significant variable for splitting? This are the question while creating the model so to answer this we use,<br><strong>Gini index</strong>-it says if we select two item from a population at random then they must be of same class and probability for this is 1 if population is pure. It works with categorical target variable “Success” or “Failure”. It performs only Binary splits. Higher the value of Gini, higher the homogeneity. CART(Classification and Regression Tree)uses Gini method to create binary splits. -chi-square it uses goodness of fit.</p><p>Training process we divide the data into 80–20 ratio. i.e. 80% data is used for training and 20% data is used for testing. We put input as both X, Y this are the historical data. And the output will be the logistic regression equation for the best fit line, which will be generated.</p><p>Test process we add the 20% data i.e. only X and then Y is been predicted in the output. similarly we check the accuracy of the data, and if needed we do tunning by doing feature selection, pruning(set constraint on the growth of the tree),Bagging, &amp; Boosting.</p><h3>Random Forest</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*ybyDP7BN_qntG7Jr.jpg" /></figure><p>Random Forest is an ensemble machine learning algorithm that builds multiple decision trees and combines their outputs to improve prediction accuracy and control overfitting.</p><p>It is used for both:</p><p>Classification tasks (e.g., Spam vs. Not Spam)</p><p>Regression tasks (e.g., Predicting house prices)</p><blockquote><em>It’s called “forest” because it creates a collection (ensemble) of decision trees. Reduces overfitting (a common problem with single decision trees)Increases accuracy and robustness. Works well with both numerical and categorical features. Handles missing data and imbalanced datasets better than many basic model.</em></blockquote><p>The training-testing split of the data is similar to the decision tree.This model is better then decision tree, it gives better accuracy then any other model.</p><h4>We have got to know about the three most used models but lets understand the steps to remember while making the model</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DA26p_Irm5f4NCRf" /></figure><p><strong>Preprocessing </strong>Feature Selection,(recursive)<br>1. Initial approaches — Domain knowledge, singularity, high cardinality, If there are large amount of missing values(more than 50% drop)<br>2. Filter method — subset the variable using statics method. it will only filter the important data.<br>correlation, SelectKbest, variance threshold<br>3.Wrapper methods — RFE(backward), SFS(forward)<br>4.Embedded methods — LASSO, tree.feature_important(used in decision tree, random forest)<br>5.Dimensionality Reduction Tchnique — PCA</p><p><strong>Handling missing data:-</strong><br>1.Detect the missing data — by using this code is null(), sum()<br>2.Seek help from the client — Get the default value, gather the real values<br>3.If the client does not have the data then we should either eliminate or impute the data.<br>4.Elimination — Drop VARIABLES that have more the 50% data missing.<br> Drop Rows when you have less than 15% of rows missing.<br>5.Imputation — default values — for e.g. Other, Don&#39;t know, Maybe(used when there are categorical data)<br> — forward fill, backward fill, fillNA<br> — Measure of CT — mean(no outliers),median(Outliers) →Numerical<br> — Mode — Categorical</p><p><strong>Convert Categorical data to numerical:-</strong><br>1.Manual encoding — (Replace, Map)preferred when there are less number of variables and less number of categorical data.<br>2.Dummy Variables — pd.get_dummies(understand which column represent which category, it will create a table and makes the row into columns and gives in form of true and false Boolean .It causes high dimensionality problem i.e. it creates huge amount of data, and we drop the first category by using the code that is called dummy trap, OuthotEncorder(sklearn)works same but uses 1,0<br>3.Creating levels — LabelEncoder-it assigns the alphabetic in asci values(it works in ascending order) i.e., A-0,B-1,c-2, this is used when larger number of data used to covert in data<br>this machine learning algorithm works under stat formulas, it work using numeric form using statistics functions, we cant add categoric data.</p><p><strong>Scaling data:-</strong><br><strong>Why do we scale?</strong> — The range of the number are in units, so when the models get data it assumes that variable with larger number giving it more important, to order this discrepancy we use scaling of data and then the data is form in unit range and unitless. <br><strong>how do we scale</strong> — Firstly its Normalization, is scales the data from 0 to 1 this are fixed, but they get affected due to outlier. hence we prefere this if there are less number of data in the dataset. If there are larger number of data we use Standardization, it keeps the data in range from -3 to +3 this is prefered when there are outlier in the data.<br><strong>how do u split data </strong>— we use random sampling Train_test_split(80%)randomly splits data, but if we want to <br>manual split the data then we use iloc. We can also split using the number of observation, But we cant use when there are date or time components in the data.<br><strong>Random_state</strong> — is a seed value in order to represented thr value to generate the same output to everyone. In other words we use random_state so that the data which is drawned randomly will be same for other people also who are accessing or working with same dataset.<br>80–20 data split is used when less data are there in dataset.<br>70–30 data split is used when larger data are there in dataset.<br>But if we use sklearn it by default splits data into 75–25.</p><h3><strong>Conclusion</strong></h3><p>So in this Blog we go to know that from dataset we can create a best models and mostly the 3 best models are as follows,</p><p><strong>Logistic Regression</strong> provided a simple baseline for binary classification.</p><p><strong>Decision Tree</strong> gave a clear, interpretable model with rule-based splits.</p><p><strong>Random Forest</strong> improved accuracy and reduced overfitting using an ensemble of trees.</p><p>By following this pipeline from data loading to evaluation you’ve successfully built and compared multiple machine learning models in Python.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2bcdabcf54dd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learn SQL in 20 Days]]></title>
            <link>https://medium.com/@vinaykoli10/learn-sql-in-20-days-ae85c200ca46?source=rss-98e4630ec681------2</link>
            <guid isPermaLink="false">https://medium.com/p/ae85c200ca46</guid>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[dbms]]></category>
            <category><![CDATA[rdbms]]></category>
            <dc:creator><![CDATA[VINAY KOLI]]></dc:creator>
            <pubDate>Sat, 29 Mar 2025 18:23:19 GMT</pubDate>
            <atom:updated>2025-03-29T18:23:19.997Z</atom:updated>
            <content:encoded><![CDATA[<p>Introduction:</p><p>SQL (Structured Query Language) is a standard programming language used to manage and manipulate relational databases. It allows users to create, retrieve, update, and delete data efficiently. One of the best Language used for Data analyst, to do different operation with respective with data handling. With this blog we will understand and know all the basics about SQL.</p><p>SQL is one of the languages which is easy to understand and easy to write.</p><p>Data base- is an electronically stored systematic collection of data. it can contain any type of data, include words number image video and files. it is used to store huge amount to data</p><p>Data base management is further divided into two main part DBMS. DBMS (Data Base Management System) A Database Management System (DBMS) is a type of software that assists in the storage, management, and retrieval of data in an efficient manner. SQL (Structured Query Language) is employed to interact with a DBMS, enabling users to perform various operations on databases.</p><ol><li><strong>Relational DBMS (RDBMS)</strong> — Uses tables (structured format) An RDBMS<strong> (</strong>Relational Database Management System<strong>)</strong> is a type of database system that stores data in a structured format using tables (rows &amp; columns) and enforces relationships between them. SQL is the standard language used to interact with RDBMS.</li><li>Examples include: MySQL, PostgreSQL, SQL Server, and Oracle.</li></ol><p>The Rows are called Records or Tuple while in other hand Columns are called Fields or attributes in SQL.</p><p>Now let us understand the Syntax for the SQL</p><p><strong>SELECT-</strong>This is used to select the columns</p><p><strong>Syntax:</strong></p><p>SELECT col1,col2,….coln;</p><p>FROM table_name;</p><p>Eg.</p><p>SELECT Name, Dept;</p><p>FROM employees;</p><p>This above example helps to select the name and department column from the Employees table.</p><p><strong>WHERE</strong>- it is used to filter the records based or criteria or conditions. It filters out only their rows value the criteria or condition are satisfied (TRUE).It uses operators for the criteria or conditions.Where clauses never use aggrative function for filtering the records</p><p><strong>Syntax:</strong></p><p>SELECT*</p><p>FROM Employees</p><p>WHERE Dept=”IT”;</p><p>The above example helps us to understand that we have selet data from the employees table where department is only IT.</p><p><strong>OPERATORS</strong>- are used to perform operators/operations (Task)</p><p>— Arithmetic operator — (+, *, /, -)is a mathematical operator.</p><p>— Relational operator — (&gt;, &gt;=, &lt;, &lt;=, =, !=) used in relation only used in numerical data.</p><p><strong>Syntax</strong></p><p>SELECT*</p><p>FROM Employee;</p><p>WHERE Dept!=”HR”;</p><p>The above Example helps us to understand that the user has selected all the data from the data from the employees table, and the department column is not equal to HR except HR data all other data are fetched.</p><p><strong>Logical Operation</strong>- this are the operation used such as AND, OR &amp; NOT.</p><p>AND-Multiple condition is TRUE AND return TRUE, in other words when both the conditions are <strong>True</strong> then it will return the value.</p><p>OR-Anyone amongst the given condition is <strong>TRUE</strong>, i.e. Almost anyone of the conditions is <strong>True</strong> then it will return the value.</p><p>NOT- when the give condition is mentioned negate<strong> a condition</strong> in a WHERE clause. It returns records that <strong>do not match</strong> the specified condition</p><p><strong>Syntax</strong></p><p>SELECT* FROM Employee; WHERE Dept =”IT” AND salary&gt;40000;</p><p>SELECT* FROM Employee; WHERE Dept =”Sales” OR salary&gt;40000;</p><p>SELECT* FROM Employee; WHERE NOT salary&gt;40000;</p><p>In short to understand all the clauses in short this is the below explanation in short:-</p><p>Clauses — Clauses in SQL are used to retrieve data as per specifications.</p><p>Types of clauses are-</p><p><strong>SELECT</strong> — Selects or Retrieve the specific columns to be shown in outcome.</p><p><strong>FROM</strong> — uses the table from where the data is retrieved.</p><p><strong>WHERE</strong> — filtering the data based on conditions or criteria</p><p><strong>GROUP BY</strong> — Generates groups of data to showcase summarized outcome.</p><p><strong>HAVING</strong> — used to filter the grouped data based on the criteria or conditions</p><p><strong>ORDER BY</strong> — sorting the data either in ascending or descending</p><p><strong>LIMIT</strong> — Limits the outcome/records of the query</p><p><strong>DISTINCT</strong> — Retrieves unique records or set of records</p><p><strong>COMMANDS of SQL </strong>is divide into 5 languages</p><p>1)DDL</p><p>2)DML</p><p>3)DCl</p><p>4)TCL</p><p>5)DQL</p><p><strong>DDL- (Data definition language)</strong></p><p>This deals with structure of data in SQL.</p><p>CREATE is the first instruction, in ddl which is used to create a DB(DataBase) object such as DB, Tables, Views, etc</p><p><strong>SYNTAX:</strong></p><p>CREATE table table_name(</p><p>col1 column definition,</p><p>col2 column defination,</p><p>.</p><p>.</p><p>constraints(colname))engine=engine_name;</p><p>pointer with respective to DDL-</p><p>It deals with STRUCTURAL part of data base</p><p>They are AUTO-COMMITTED i.e. will be permanent; they can’t be undo)</p><p>They can’t be ROLLBACK</p><p>No use of where clause in truncate and drop are</p><p><strong>DML- (Data Manipulation language)</strong> imp it is used to fill the data, structure</p><p>#INSERT it is used to add ROWS</p><p>#UPDATE it is used to updates</p><p>#DELETE it is used to delete, where to delete</p><p>pointer wrt DML</p><p>It deals with records ie rows</p><p>This are not AUTO COMMITTED and can use ROLLBACK</p><p>where clause can be implemented auto-commit transaction means it uses insert, update, and delete</p><p><strong>DCL — (Data Control Language)</strong> it is given from client side, it is used to grant or revert the privileges.</p><p>GRANT — it gives limitation or restriction from the client side to work on the data.</p><p>REVOKE — it is used to take back the permissions from the user.</p><p><strong>TCL — (Transaction Control Language)</strong></p><ol><li>If it is a banking sector the money is debited from one account and credited to other account</li><li>To manage changes made by the data in a table by DML statement</li></ol><p>ROLLBACK (it is like undo)</p><ol><li>It restores the DB to last committed state.</li><li>Also used with save point to restore the DB to the required save point name.</li></ol><p>SAVEPOINT (which temporarily saves data)</p><p>1)used to temporarily save transaction so that you can roll back to that point</p><p>COMMIT (saves the data permanent)</p><ol><li>It is used to permanently save a transaction</li><li>It is changes made by insert, update, delete (DML)are not permanent until you use commit statement</li></ol><p><strong>JOIN</strong></p><p>This is used to combine data base on 2 or more table to provide the results set.</p><p>SYNTAX</p><p>select * from table1(always be Left table)</p><p>(type of joint)join table2(always be right table)</p><p>on table1.col=table2.col;</p><p><strong>types of joins-</strong></p><p><strong>1)Inner join</strong> (Very much used)- it combines the data based on common/matching values found within the tables</p><p><strong>2)Left join</strong>- considers all the data from left table &amp; matching data from right table, where the match is not found for right table, it shows null. it is also known as left outer joint, because it covers left outer join</p><p><strong>3)Right join</strong>- considers all the data from right table &amp; matching data from left table, where the match is not found for left table, it shows null.</p><p><strong>4)Outer join/ full join/ full outer join </strong>— it combines all the records from the tables</p><p><strong>5)Natural join</strong> — can join the table based on the common column in the table being joined.</p><p><strong>6)Cross join</strong>- is used to generate a paired combination of each row of the first table with each row of the second table this is also known as CARTESIAN JOIN</p><p><strong>7)Self join</strong>- as its name implies is used to join a table to itself, this means that each row in a table is joined to itself and every other row in that table.a table is joining itself</p><p><strong>Conclusion:</strong></p><p>So, from this blog we got to know all the basis of SQL which will help us to fetch and do all the basic operation using SQL. With this basic SQL we can solve the basic problems. There is other more things</p><p>Key Takeaways:</p><ul><li>SQL is the standard language for RDBMS (Relational Database Management Systems).</li><li>It includes DDL (Data Definition Language), DML (Data Manipulation Language), DCL (Data Control Language), and TCL (Transaction Control Language).</li><li>Used in data analysis, reporting, and application development.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae85c200ca46" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>