<?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 Urvashi Thakre on Medium]]></title>
        <description><![CDATA[Stories by Urvashi Thakre on Medium]]></description>
        <link>https://medium.com/@thakreurvashi0805?source=rss-a0d7075cf285------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Urvashi Thakre on Medium</title>
            <link>https://medium.com/@thakreurvashi0805?source=rss-a0d7075cf285------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 15 Nov 2026 05:59:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@thakreurvashi0805/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[Flight Price Prediction Using Machine Learning]]></title>
            <link>https://medium.com/geekculture/flight-price-prediction-using-machine-learning-f18b4bdc70e6?source=rss-a0d7075cf285------2</link>
            <guid isPermaLink="false">https://medium.com/p/f18b4bdc70e6</guid>
            <category><![CDATA[data-scientist]]></category>
            <category><![CDATA[visualization]]></category>
            <category><![CDATA[predictions]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Urvashi Thakre]]></dc:creator>
            <pubDate>Thu, 13 May 2021 08:02:58 GMT</pubDate>
            <atom:updated>2021-05-13T08:02:58.929Z</atom:updated>
            <content:encoded><![CDATA[<p>The tourism industry is changing fast and this is attracting a lot more travelers each year. The airline industry is considered as one of the most sophisticated industry in using complex pricing strategies. Now-a-days flight prices are quite unpredictable. The ticket prices change frequently. Customers are seeking to get the lowest price for their ticket, while airline companies are trying to keep their overall revenue as high as possible. Using technology it is actually possible to reduce the uncertainty of flight prices. So here we will be predicting the flight prices using efficient machine learning techniques.</p><h3>Dataset</h3><p>We will be using two datasets, train data and test data. You can download the data set using this link:<em> </em><a href="https://github.com/urvashithakre/Flight-Price-Prediction-Using-Machine-Learning"><em>https://github.com/urvashithakre/Flight-Price-Prediction-Using-Machine-Learning</em></a> . The train data comprises of 10683 rows and 11 attributes whereas the test data has 2671 rows.</p><p><strong>Let’s start with the coding!</strong></p><ol><li>Lets import the necessary libraries first.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/318/0*OWExN-aF8eixNyoQ.png" /></figure><p>2. Import training data and display the first five rows to take the overall view of the data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/971/0*30BgoK2fYTAzS2uK.png" /></figure><p>3. We will check whether the data contains any null values using isna() and sum() method and then drop the NaN values using dropna() method so that there are no discrepancies in our data by which we can predict precisely.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/274/0*h3ksDPpdavTP1jbA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/286/0*hNppqb9x6KrCthRz.png" /></figure><p>3. Now that our data is clean with no NaN values we will have a look at the datatypes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/270/0*8W015VxDVAYEeY9N.png" /></figure><p>It can be observed that Date_of_Journey , Dep_Time and Arrival_Time have been assigned as object by default. We will convert this datatype into timestamp to use this column for prediction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/0*eO24VsdpjKV2vOjZ.png" /></figure><p>4. Separate the column “Date_of_Journey” into “journey_day” and “journey_month” to help our machine learning model understand and use the column for prediction. After doing so we will delete the “Date_of_Journey” column which will no longer be useful to us.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/995/0*xmZp4IsPVKX3-bAn.png" /></figure><p>5. Now we will be dealing with the “ Dep_time” and Arrival_Time” feature because the machine learning model won’t be able to understand what the time is or what day it is. We will be fetching minutes and hours from both these columns as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/370/0*G31yfleqQ1VUthTR.png" /></figure><p>6. Now we will be processing the “Duration” column as in some cases there is no Hour(hr) term or minutes (m) term in the colum. We will be using the split function and then append ‘0h’ or ‘0m’ wherever needed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/417/0*xaMtBVQ3FLACkd2L.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/403/0*8jmwlVNueRlX77FN.png" /></figure><p>7. Let’s separate the ‘Duration’ attribute into ‘Duration_hours’ and ‘Duration_mins’ using the apply function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/0*1-c5UFIdUkkxEb2Q.png" /></figure><p>8. To extract categorical data or continuous features we will iterate every column in the dataset and whosoever has the datatype object we will consider that column as categorical data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/0*H2S88p56_olFTD5v.png" /><figcaption>Categorical Data</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/0*GZYjCoBWJgiqQLzf.png" /><figcaption>Continuous Data</figcaption></figure><p>9. Now we will handle the categorical data and basically perform Feature Encoding because machine learning works only on numerical data.</p><p>To begin with, first we will plot a boxplot</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/0*FoWrWoxb7WkRjDEv.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*faWF2zYL_LLzzGj1.png" /></figure><p>We can come up with a conclusion that Jet airways has the highest price whereas other airlines had almost similar median with minimal fluctuations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/0*oRvwS4iNWcyBzezk.png" /></figure><p>Airlines with 1 or 2 stops has many outliers and hence their price varies. On the contrary price for airline with 4 stops is not fluctuating.</p><p>10. Here we will be changing the ‘Airline’ feature into integer format using one hot encoding</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1005/0*OSWKZ3zLzWOgxsZ9.png" /></figure><p>All the features are converted to integer values using get_dummies function.</p><p>We will apply the get_dummies function on the ‘Source’ and ‘Destination’ column as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/481/0*6Py2ocbSajUvn4gh.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/0*LFCNY0VvD5GCG1XL.png" /></figure><p>11. The ‘Route’ columns mainly tell us that how many cities they have taken to reach from source to destination . So We split the Route column on the basis of the seperator i.e(→) to extract the information .Regarding the ‘Nan’ values we replace those ‘Nan’ values with ‘None’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/0*ZsTSFixUghLxQ4V1.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/490/0*-dwyZBtZgIBceej5.png" /><figcaption>Filling ‘Route_3’ , ‘Route_4’ , ’Route_5&#39; with None.</figcaption></figure><p>12. To get rid of high dimensionality issue we will be using label encoder class.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/0*BhSJTkM9ZMrRrVWD.png" /></figure><p>13. Dealing with ‘Total_Stops’ attribute and assign 1 for ‘1 stop’, 2 for ‘2 Stops’ and so on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/0*h6d0jg8yQwKI_j96.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/0*eLaysNuuXL1NvAGG.png" /></figure><p>14. Concatenating categorical dataframe with all the dataframes that we have defined earlier. For this we will be using concat() from pandas library. Also, we will be dropping the unnecessary columns present in our data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/0*Tg3ppQUjKfHuzDZv.png" /></figure><p>15. Checking for outliers in ‘price’ column by plotting some plots such as subplot, distplot and boxplot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/292/0*EO62J8ttZWmMFBcL.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/447/0*KcXPTGu2khtRq6Kk.png" /></figure><p>Median plays a very significant role wherever we have outliers. So we will use ‘where’ function to replace all the columns with price&gt;4000 with the median value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/0*G7HAAfkh7XazgywC.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/465/0*MhQltFi8J2-vQvFJ.png" /><figcaption>Minimized outliers</figcaption></figure><p>16. Separating independent and dependent features.</p><p>Now that all our data is numerical after label encoding so we split the data into test and train and drop the price column from the test set because we have to predict the price with our test data set</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/475/0*iWm3h7R73k6D752Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/220/0*PnMXbG5AcM_sfrKf.png" /></figure><p><strong>Feature selection </strong>is nothing but to find the best feature that contributes the most and that has good relationship with the target values. The main reason to apply feature selection is to select important feature so that we don’t face the problem of multiple dimensions.</p><p>We will pass the independent and dependent data to the mutual_info_classif() function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/0*_JxdIJPV07VZ3EvM.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/484/0*9qd2H-f3nwhMAXdT.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/417/0*04zj3FD9EfSY6Ek6.png" /></figure><p>Sorting values according to importance by which we will get to know which column contributes the most and which attribute contributes the least.</p><p>17. Splitting the data into train and test data. We taken 80% data for training and remaining 20% for testing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/519/0*OFb0HqFwPsUXy1OW.png" /></figure><p>18. Let us now define a function to predict the Training score, Predictions, r2 score, Mean absolute error(MAE), Mean square error(MSE) and Root mean square error (RMSE).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/0*vCeDPvfR_yEPEOKW.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/0*7ayGUqY7ICqJfNdm.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/472/0*v0hB9GNP67rUSKlZ.png" /></figure><p>Similarly we can test different methods like LinearRegression(), DecisionTreeRegressor() , KNeighborsRegressor etc.</p><p>19. Cross validating our model. Here we will be using RandomizedSearchCV</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/0*TwvvPUVzFFPKpBKh.png" /><figcaption>Creating a dictionary random_grid with all the parameters and we will pass this dictionary to RandomizedSearchCV</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/867/0*0Qu_GfpBLOmrGoon.png" /><figcaption>Fitting the data.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/312/0*_c-7taUuqfRMElLW.png" /></figure><p>Predicting the values for X_test by plotting a distribution plot</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/443/0*7jjoPLIXWpNy3Yol.png" /></figure><p>We have achieved approximately 83% accuracy but before when we used RandomForest the accuracy was around 80%, that’s the outcome of model hyperparameter tuning. You can see the full code in the jupyter notebook uploaded in this Github <a href="https://github.com/urvashithakre/Flight-Price-Prediction-Using-Machine-Learning">Link</a> .</p><p>Please let me know your thoughts about this article and do comment if you face any issues.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f18b4bdc70e6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/geekculture/flight-price-prediction-using-machine-learning-f18b4bdc70e6">Flight Price Prediction Using Machine Learning</a> was originally published in <a href="https://medium.com/geekculture">Geek Culture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Recognizing Handwritten Digits Using Scikit-learn In Python]]></title>
            <link>https://thakreurvashi0805.medium.com/recognizing-handwritten-digits-using-scikit-learn-in-python-f8294152e924?source=rss-a0d7075cf285------2</link>
            <guid isPermaLink="false">https://medium.com/p/f8294152e924</guid>
            <category><![CDATA[knn-algorithm]]></category>
            <category><![CDATA[scikit-learn]]></category>
            <category><![CDATA[jupyter-notebook]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[digit-recognition]]></category>
            <dc:creator><![CDATA[Urvashi Thakre]]></dc:creator>
            <pubDate>Sun, 18 Oct 2020 15:41:38 GMT</pubDate>
            <atom:updated>2020-10-18T15:41:38.584Z</atom:updated>
            <content:encoded><![CDATA[<p>The handwritten digit recognition is the ability of computers to recognize human handwritten digits. It is a hard task for the machine because handwritten digits are not perfect and can be made with many different flavors. The handwritten digit recognition is the solution to this problem which uses the image of a digit and recognizes the digit present in the image.</p><p>Recognizing handwritten text is a problem that can be traced back to the first automatic machines that needed to recognize individual characters in handwritten documents. Think about, for example, the ZIP codes on letters at the post office and the automation needed to recognize these five digits. Perfect recognition of these codes is necessary in order to sort mail automatically and efficiently. Here we are going to analyze the digits data-set of the Sci-Kit learn library using Jupyter Notebook.</p><p>First we begin with importing the required libraries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/492/1*PKATp8CKRB0oqJqctqUgug.png" /></figure><p>Now we load the Digits dataset into the notebook. After loading the data we can read lots of information about the datasets by calling the DESCR attribute.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/381/1*AIp2DOCz7K_lONCMu4XZ_w.png" /></figure><p>The images of the handwritten digits are contained in a digits.images array. Each element of this array is an image that is represented by an 8x8 matrix of numerical values that correspond to a grayscale from white, with a value of 0, to black, with the value 15.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/487/1*v9l2M5xIlWC8ddoTpxKiFA.png" /></figure><p>Let’s visually check the contents of this result using the matplotlib library.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/1*BbmK6yW47Ir9vAcfiVW03Q.png" /></figure><p>The numerical values represented by images, i.e. the targets, are contained in the digit.targets array.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/408/1*6-ftQpvNs-o_7-Q_J7sS3g.png" /><figcaption>It is observed that the dataset is a training set consisting of 1,797 images.</figcaption></figure><p>This dataset contains 1,797 elements, and so we can consider the first 1,791 as a training set and will use the last six as a validation set. Here we can see in detail these six handwritten digits by using the matplotlib library:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/481/1*Mm3q293BxtgotDiTGHGNvw.png" /></figure><p>Now we train the svc estimator that we defined earlier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/453/1*k-UxF9nkyXi85BMBOURssw.png" /></figure><p>Now we have to test our estimator, making it interpret the six digits of the validation set and then compare them with the actual digits as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/415/1*oY3ok2gyuUvLYaIoFqB43Q.png" /></figure><p>From the above output we can see that the targeted and predicted values are the same. Hence estimator is able to recognize the handwritten digits, interpreting correctly all six digits of the validation set.</p><p>Let’s predict the accuracy of our model using KNN classifier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*CQ4kBGrI56kIF8zixqsRtA.png" /></figure><h3>Conclusion:</h3><p>Thus we can see how easy it is to import a dataset, build a model using Scikit-Learn, train the model, make predictions with it, and finding the accuracy of our prediction(which in our case is <strong><em>98.33%</em></strong>).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f8294152e924" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Performing Analysis of Meteorological Data Using Python]]></title>
            <link>https://thakreurvashi0805.medium.com/performing-analysis-of-meteorological-data-using-python-fcbb2b467f1b?source=rss-a0d7075cf285------2</link>
            <guid isPermaLink="false">https://medium.com/p/fcbb2b467f1b</guid>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[insights]]></category>
            <category><![CDATA[data-analytics]]></category>
            <dc:creator><![CDATA[Urvashi Thakre]]></dc:creator>
            <pubDate>Wed, 14 Oct 2020 12:20:51 GMT</pubDate>
            <atom:updated>2020-10-20T04:24:03.141Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Data analytics</strong> is the process of examining data sets in order to find trends and draw conclusions about the information they contain. Data is extracted from various sources and is cleaned and categorized to analyze various behavioral patterns. However, data collection needs to be supplemented with its analysis for obtaining decision-making insights. Data analytics is an integral component of making strategies in all major organizations as it helps them predict customer trends and behaviors, increase business productivity, and make evidence-backed decisions.</p><p>One type of data that’s easier to find on the net is Weather data. Many sites provide historical data on many meteorological parameters such as pressure, temperature, humidity, wind speed, visibility, etc.</p><p>We are going to analyze Weather data-set. You can find the date-set from the mentioned link(<a href="https://www.kaggle.com/muthuj7/weather-dataset">https://www.kaggle.com/muthuj7/weather-dataset</a>). Our main aim is to perform data cleaning ,data normalizing ,testing the hypothesis and deriving appropriate insights. So lets begin!</p><ol><li>Importing necessary libraries such as Pandas , Numpy, Matplotlib and Seaborn.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/357/1*snasEKdxBRhXiYz0FPTCLg.png" /></figure><p>2. To load the data set using Pandas library. Here I have displayed the first 5 rows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*f_jLewQ6o2DkiaMNjaR9cQ.png" /></figure><p>3. Cleaning the Dataset. Our main aim is to analyze the change in temperature and humidity so we focus on important factors only. Here we Convert Date to a proper format and then resample the data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/993/1*pHiqHGsFf_IB4zaE5OfRbg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/1*sESJbpyFtziJAsf-AwPBoA.png" /></figure><p>4. Plotting a line plot for Temperature vs Humidity from the year 2006 to 2016.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*Py-fBWdFGhVRJ1hyeDqTTg.png" /></figure><p>From the above plot we can say that the humidity remains almost constant lying between 0 to 5. The peaks are between 20 to 25 and lowest dip lies below -5.</p><p>5. Seaborn’s lmplot is a 2D scatterplot with an optional overlaid regression line. This is useful for comparing numeric variables. Here we plot Apparent temperature (C ) vs Humidity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*9PbEH1e1rU8w6Fl4hcmDLA.png" /></figure><p>6. Now we create a bar plot analyzing the Apparent temperature and Humidity with specified years.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*Emxw-HbsSjaEKFGgwbwgJw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*7VoxW7BXP_ozMFtjPIVFiw.png" /></figure><p>From the above insights it can be seen that the Apparent Temperature is lowest between 2011 to 2012 ie. below -8(C) whereas its highest between 2015 to 2016. Humidity is ranging between 0 to 2 throughout.</p><p>7. Plotting temperature and humidity variation for the month of May over the time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*DaXmzt67nAQDzUN5e8HHLg.png" /></figure><p>8. Now we we will plot a line plot for better understanding by analyzing the peaks and dips in the graphs with respect to humidity</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*UV_h0UUwk_bGc3iRgvaZLQ.png" /></figure><p>9. Scatter plot</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*dBoaP4ZjG6EDZmaOW8Psxw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*yAsrvrKe8dZoRsxGMBEoCw.png" /></figure><h4>Conclusion:</h4><p>Over the years we can see that Global Warming is significantly increasing which in turn is deteriorating the weather conditions and ecosystems. Hence from this analysis we have gathered useful insights which say that over the past 10 years the temperature is consistently increasing while in the humidity also there is a slight rise in some years but mostly remained same throughout. Hence we can conclude that Global Warming is indeed having a lot of adverse effects on the weather conditions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fcbb2b467f1b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>