<?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 sujith bysani on Medium]]></title>
        <description><![CDATA[Stories by sujith bysani on Medium]]></description>
        <link>https://medium.com/@bysanisujith2003?source=rss-d41e16d30a4d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*XsAbZjJO_x6aXD83</url>
            <title>Stories by sujith bysani on Medium</title>
            <link>https://medium.com/@bysanisujith2003?source=rss-d41e16d30a4d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 18:58:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bysanisujith2003/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[UNDERSTANDING LOGISTIC REGRESSION]]></title>
            <link>https://medium.com/@bysanisujith2003/understanding-logistic-regression-ba7b915d819d?source=rss-d41e16d30a4d------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba7b915d819d</guid>
            <category><![CDATA[r]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[logistic-regression]]></category>
            <category><![CDATA[regression]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[sujith bysani]]></dc:creator>
            <pubDate>Sat, 24 Dec 2022 18:06:52 GMT</pubDate>
            <atom:updated>2022-12-26T17:14:50.060Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/272/0*_uaHuzr2zgoDwsKu" /></figure><p>Logistic regression is a type of statistical model that is used for classification tasks. It is used to predict the probability that an event belongs to a particular class or category.</p><p>In logistic regression, the dependent variable is a binary variable that takes on one of two values, such as “yes” or “no,” “success” or “failure,” or “healthy” or “ill.” The independent variables, also known as predictors or explanatory variables, can be continuous or categorical variables.</p><p>The goal of logistic regression is to find the best-fitting model to describe the relationship between the dependent variable and the independent variables. This is done by estimating the probability that an event belongs to a particular class using a logistic function. The logistic function is defined as:</p><p>P(x) = e^(b0 + b1<em>x) / (1 + e^(b0 + b1</em>x))</p><p>where P(x) is the probability that an event belongs to a particular class, x is the predictor variable, b0 is the intercept, and b1 is the coefficient for the predictor variable.</p><p>To fit a logistic regression model, we need to find the values of b0 and b1 that maximize the likelihood of the observed data. This is done using an optimization algorithm such as gradient descent.</p><p>Once the model is fit, we can use it to make predictions about the probability that an event belongs to a particular class. We can then use a threshold value to classify events as belonging to one class or the other. For example, if the probability of an event belonging to the “yes” class is greater than 0.5, we can classify it as “yes,” and if the probability is less than 0.5, we can classify it as “no.”</p><p>Logistic regression is a widely used and powerful tool for classification tasks and is particularly well-suited for cases where the dependent variable is binary. It is also relatively easy to implement and interpret, making it a popular choice among practitioners.</p><p>Here is an example of how to fit a logistic regression model in R:</p><pre># load the necessary libraries<br>library(tidyverse)<br>library(broom)<br><br># read in the data<br>data &lt;- read_csv(&quot;data.csv&quot;)<br><br># fit the model<br>model &lt;- glm(dependent_variable ~ predictor1 + predictor2 + predictor3, <br>             data = data, family = &quot;binomial&quot;)<br><br># summarize the model<br>summary(model)<br><br># make predictions using the model<br>predictions &lt;- predict(model, newdata = data, type = &quot;response&quot;)<br><br># convert the predictions to a binary outcome<br>predictions &lt;- ifelse(predictions &gt; 0.5, &quot;yes&quot;, &quot;no&quot;)<br><br># calculate the accuracy of the predictions<br>accuracy &lt;- mean(predictions == data$dependent_variable)<br><br># print the accuracy<br>print(accuracy)</pre><p>This code fits a logistic regression model to the data in the file “data.csv,” which should have a column for the dependent variable and columns for the predictor variables. The dependent variable should be a binary variable that takes on one of two values, such as “yes” or “no.” The predictor variables can be continuous or categorical variables.</p><p>The glm() the function is used to fit the logistic regression model. The family argument is set to &quot;binomial&quot; to specify that we are fitting a logistic regression model.</p><p>The summary() the function is used to summarize the model, and the predict() function is used to make predictions using the model. The type argument is set to &quot;response&quot; to return the predicted probabilities rather than the predicted class labels.</p><p>The predictions are then converted to a binary outcome using the ifelse() function, and the accuracy is calculated using the mean() function.</p><p>Finally, the accuracy is printed to the console.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba7b915d819d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[UNDERSTANDING LINEAR REGRESSION]]></title>
            <link>https://medium.com/@bysanisujith2003/understanding-linear-regression-eba0d908584b?source=rss-d41e16d30a4d------2</link>
            <guid isPermaLink="false">https://medium.com/p/eba0d908584b</guid>
            <category><![CDATA[r]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[linear-regression]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[sujith bysani]]></dc:creator>
            <pubDate>Wed, 21 Dec 2022 18:32:30 GMT</pubDate>
            <atom:updated>2022-12-21T18:32:30.064Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EBE3wzWkO0_xNuDS27HbkQ.jpeg" /></figure><p>Linear regression is a statistical method used to model the linear relationship between a dependent variable (also known as the response variable) and one or more independent variables (also known as explanatory variables). It is used to predict the value of the dependent variable based on the values of the independent variables.</p><p>In a linear regression model, the dependent variable is assumed to be a linear function of the independent variables, with an added error term to account for any deviation from the linear relationship. The model is then fit to the data by estimating the model parameters that minimize the error between the predicted values and the observed values.</p><p>Linear regression is often used for predicting a continuous variable, such as the price of a house based on its size and location. It is a simple and widely used method for modeling linear relationships, and it is often used as a starting point for more complex models.</p><p>There are several assumptions that are made when using linear regression, including:</p><ul><li>The relationship between the dependent and independent variables is linear</li><li>The error term is normally distributed and has a mean of zero</li><li>The errors are independent and identically distributed (i.i.d.)</li></ul><p>Violating these assumptions can lead to biased or incorrect results, so it is important to carefully consider whether linear regression is appropriate for a given problem.</p><p>Here is an example of how to fit a linear regression model in R:</p><pre>#Import the data housing1.csv and assign to an object dataset – Dataset available from<br>#https://www.dropbox.com/scl/fo/a7vnbbaoq7aoh48w48yts/h?dl=0&amp;rlkey=rijlse546cuwd0ef0rg0offbu<br>data1&lt;-read.csv(&quot;housing1.csv&quot;)<br><br>#DISPLAY THE STRUCTURE OF THE DATASET<br>structure(data1)<br><br>#FEATURE ENGINEERING AND DATA PARTIONING <br>library(caTools)<br>set.seed(123)<br>sample.split(data1$B,SplitRatio=2/3)<br><br>#FITTING A MODEL FOR LINEAR REGRESSION <br><br>Train=subset(x=data1,split=TRUE)<br>Test=subset(x=data1,split=FALSE)<br>lm(formula=X~B,data=Train)<br><br>#PREDICT THE MODEL <br>y_pred=predict(object=lm,newdata=Test)<br><br>#PLOT THE PREDICTED MODEL<br>library(ggplot2)<br>ggplot(data=data1)+geom_point(aes(x=X,y=B))<br><br>#PERFORMANCE EVALUATION USING RMSE AND R-SQUARE<br>reg=sqrt(sum(y_pred$MEDV)^2)/length(Test$MEDV)<br>plot(reg)</pre><p>This code will fit a linear regression model to the data and we can evaluate it using the RMSE measure, the Formula for it is :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/389/1*_AWwVJKZwf5zKWvsfU0hVw.jpeg" /></figure><p>You can customize the model by changing the formula in the lm function and you can customize the plot by adding additional layers or modifying the aesthetics.</p><p>This is just a basic example of how to fit a linear regression model in R. There are many other options and functions available for more advanced modeling and analysis.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eba0d908584b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[COMMON MISTAKES DONE IN PYTHON]]></title>
            <link>https://medium.com/@bysanisujith2003/common-mistakes-done-in-python-1476f1bef946?source=rss-d41e16d30a4d------2</link>
            <guid isPermaLink="false">https://medium.com/p/1476f1bef946</guid>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[sujith bysani]]></dc:creator>
            <pubDate>Wed, 21 Dec 2022 18:02:09 GMT</pubDate>
            <atom:updated>2022-12-21T18:02:09.411Z</atom:updated>
            <content:encoded><![CDATA[<p>Here are some common mistakes that people make when programming in Python:</p><ol><li>Forgetting to indent code blocks</li></ol><p>In Python, indentation is used to define code blocks, such as those in a for loop or an if statement. If you forget to indent a code block, you may get an IndentationError or your code may not behave as expected.</p><ol><li>Using the wrong syntax for looping and branching statements</li></ol><p>Python has specific syntax for looping and branching statements, such as for loops, while loops, and if statements. If you use the wrong syntax, you may get a SyntaxError or your code may not behave as expected.</p><ol><li>Not using try-except blocks to handle exceptions</li></ol><p>Exceptions are a way to handle errors and other exceptional conditions in Python. If you don’t use try-except blocks to catch and handle exceptions, your code may crash if it encounters an error.</p><ol><li>Not closing file handles</li></ol><p>If you open a file in Python, you should always make sure to close it when you are finished with it. If you forget to close a file handle, you may run out of file descriptors and your code may not behave as expected.</p><ol><li>Not using the right data types</li></ol><p>Python has several built-in data types, such as strings, integers, and lists. It is important to use the right data type for the task at hand, as using the wrong data type may lead to errors or unexpected results.</p><ol><li>Not following PEP 8 style guidelines</li></ol><p>PEP 8 is the official Python style guide, which provides guidelines for how to format your code. If you don’t follow these guidelines, your code may be harder to read and understand for other developers.</p><p>By avoiding these mistakes, you can write more efficient and effective Python code. It is always a good idea to continuously learn and improve your skills as a Python developer.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1476f1bef946" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[BEST PYTHON PRACTICES IN THE FIELD]]></title>
            <link>https://medium.com/@bysanisujith2003/best-python-practices-in-the-field-de45572e395c?source=rss-d41e16d30a4d------2</link>
            <guid isPermaLink="false">https://medium.com/p/de45572e395c</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[python-programming]]></category>
            <dc:creator><![CDATA[sujith bysani]]></dc:creator>
            <pubDate>Wed, 21 Dec 2022 17:59:21 GMT</pubDate>
            <atom:updated>2022-12-21T17:59:21.516Z</atom:updated>
            <content:encoded><![CDATA[<p>Python is a powerful and versatile programming language that is widely used in a variety of fields, from web development and data science to artificial intelligence and machine learning. As with any programming language, it is important to follow best practices in order to write efficient, maintainable, and easily understandable code. This blog will discuss some of the best practices for writing Python code.</p><ol><li>Use PEP 8 to style your code</li></ol><p>PEP 8 is the official Python style guide, which provides guidelines for how to format your code. It covers everything from how to use indentation and white space to how to name variables and functions. Following these guidelines will not only make your code easier to read and understand but will also make it easier for other developers to work with your code.</p><ol><li>Use descriptive variable and function names</li></ol><p>One of the key principles of good code is readability, and using descriptive variables and function names is a key part of this. Avoid using short, abbreviated names, and instead, use names that accurately describe what the variable or function does. This will make your code easier to understand and maintain.</p><ol><li>Use type hints</li></ol><p>Type hints are a way to provide additional information about the types of variables, functions, and other objects in your code. They can be used to help static type checkers (like mypy) catch potential issues before your code is run, and they can also make your code easier to understand for other developers.</p><ol><li>Use exceptions to handle errors</li></ol><p>Exceptions are a way to handle errors and other exceptional conditions in Python. Rather than using if statements to check for error conditions, it is generally better to use exceptions, as they provide a more flexible and maintainable way to handle errors.</p><ol><li>Use unit tests to ensure code quality</li></ol><p>Unit tests are small, standalone tests that test a specific piece of code (a unit) to ensure that it is working correctly. Writing unit tests for your code can help you catch bugs early on and ensure that your code is of high quality. There are several popular testing frameworks for Python, including unit test, pytest, and nose.</p><ol><li>Use version control</li></ol><p>Version control is a way to track changes to your code over time, so you can easily revert back to previous versions if needed. It is especially useful when working on a team, as it allows multiple developers to collaborate on a project without stepping on each other’s toes. There are several popular version control systems for Python, including Git, Mercurial, and Subversion.</p><p>In conclusion, following these best practices will help you write better Python code that is easier to understand, maintain, and debug. Whether you are a beginner or an experienced Python developer, it is always a good idea to continuously improve your skills and knowledge of the language.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de45572e395c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>