Posted on

Use Python for Data Cleaning and Analyzing nicotine dependence

doc(1)

The objective of the project was to study Nicotine Dependence. Nicotine Dependence is an addiction to tobacco products caused by the drug nicotine. At first association between smoking behaviour and Nicotine Dependence was explored. Social behaviour and depression history were then analyzed as explanatory variables. A study at Universiti Teknologi MARA Malaysia concluded that among smokers 5% have high nicotine dependence whereas 18% have moderate nicotine dependence. Another study by the Durham University , UK found that life events and stressful experiences are associated with nicotine dependence.

The data was taken from a survey conducted by National Epidemiologic Survey on Alcohol and Related Conditions (NESARC). Earlier National Institute on Alcohol Abuse and Alcoholism have performed landmark study on Alcohol Abuse and Alcohol Dependence using the NESARC dataset.  The dataset is a representative sample of United States adult population aged over 18. Initially the data consisted of over 43000 data points.

The data was in Comma Separated Value(CSV) format. The variables used for the regression model were.

Variable Name Description
CHECK321 the cigarette smoking status of the individual
S3AQ3B1 the usual frequency when the individual smoked cigarettes
S3AQ3C1 the usual quantity when the individual smoked
TAB12MDX the dependent variable which represented if the respondent had a nicotine dependence in the last 12 months

The dataset contained various missing values. Python was the language used for the data cleaning and analysis purpose. At first using the pandas library in python the dataset was loaded. After loading the the data missing values of the CHECK321 variable were checked. The unknown values of the CHECK321 suggested that the cigarette smoking status of an individual is unknown and so the analysis can not be done for that individual. Hence the data points containing missing values of CHECK321 were deleted. After deleting the missing values we were left with 18000 data points. The target variable TAB12MDX took only two values ‘0’ and ‘1’. ‘1’ denoting the individual is nicotine dependent and ‘0’ denoting that the individual is not nicotine dependent.

telepain

For analysis of the data we split the data and into training and testing set. Training data was used to train our model. Since the target variable is binary we decided to use logistic regression for training the model. For splitting the data we used a python library Scikit Learn also popular as sklearn. The training test split ratio was 80:20. The cleaned data was fed to the model and the model was trained. After training the model we tested the model with the test data we had split earlier. We saw that for 58% of the times our model has correctly predicted whether a person is nicotine dependent.

As the study by the Durham University , UK found that life events and stressful experiences are also associated with nicotine dependence. We decided to introduce two new variables MAJORDEPLIFE and SOCPDLIFE to make our model more accurate.

 

Variable Name Description
MAJORDEPLIFE If the individual suffered depression or not
SOCPDLIFE If the individual has socio-phobia or not

We again split our data into training and testing sets. The model was trained with the testing set now with two new variables. Now with the introduction of two new variables associated with the life events and stressful experience the accuracy of our model increased to 65%. For 65% of the times we predicted correctly whether a person is nicotine dependent or not by seeing is smoking behaviour and social life.
Research concludes that individual who smoke more heavily than those who don’t are more prone to be Nicotine Dependent. Individuals who have a history of Depression or are Socio-phobic are also more prone to be Nicotine Dependent than those without.Our results seems consistent with the previous findings.

 

 

Posted on

Make portions of image responsive on your web page

Images are nowadays an important part of web pages. We make our web pages look more attractive and appealing to the users by adding images. We can make it more attractive by adding responsive images. So the big question is how can we make an image responsive.

 

responsive

 

The basic formats of images that we use in our daily life are JPEGs , PNGs , BMPs etc. These formats identify image as one whole entity.So how our code will identify small portions that are there in the image.One thing that we could do is crop our image and break it into smaller images of the portions that we want to make responsive. This will be like our brute force approach to the problem not a smart approach. We might be able to do the task but it will be a very complicated solution and we will have to take care of various corner cases.Smart approach of this problem is using a different less common image format SVG. SVG stands for Scalable Vector Graphics.

technology-1283624_640 We can change our image format into SVG easily either by using an online converter or using an image editing software as Illustrator. The benefit of SVG is that we can see and manipulate parts of our image as code. We can see the code by opening a SVG image into any text editor. Small portions of image is represented as small part of the code which we can manipulate.We can use SVG as HTML attribute. We can directly put the code in HTML code of our web page and manipulate the code by adding on-click and on-hover events to the different parts of the images.

Posted on

My new year Resolution for 2017

know-yourself-002

UI5CN is a learning platform and the highest form of knowledge we can acquire is wisdom. We might be in many different situations, many plans may be there in our mind, many challenges we can foresee for that plan to become reality. But the big question is not what is stopping us or may stop us but what keeps us going. And the inner why, which is the reason we do what we do.

Let it tell us not to settle for less and it is not ok to, not to strive for greatness.

So let’s start the New Year with new possibility and believe to be more than what we were.
 

Posted on

Sweet Story of SAPUI5/OpenUI5 and Javascript

Javascript has become new norms for developing applications. Processing at the UI end is becoming more fashionable and every major software-related companies are having their own JS framework. For enterprise giant SAP, SAPUI5/Open UI5 is the new framework. Google and Facebook also have their own framework Angular.js and React.js respectively which are few among the top.

 

The world is changing for good, some may disagree!

When we take a closer look at SAP, ABAP or ABAP/4 was used majorly to create enterprise application and there was a lot of development done with SAP ABAP editor which is inbuilt with SAP Frontend UI also eclipse was second popular IDE used to write ABAP code.

 

Old is Gold.

We also saw the introduction of Web-Dynpro a few years back to leverage Java for developing enterprise applications. After Sun Microsystem was acquired by Oracle and Oracle and SAP are a well-known competitor in the ERP marketplace it was clear for SAP to move away from Java world. Then comes the era of Javascript. In the meantime in the Javascript world after ES6 version of Javascript the possibility and things you can perform were impressive and with HTML5 not only you can leverage the responsive nature of building a mobile application but also can make it much much better looking with CSS3.
And With these open source technologies, UI5 was created.

 

Big moment!

Now comes the major challenge to replace all existing application in SAP with UI5, the answer was SAP Fiori, Fiori means flowers in Italian and apps build with UI5 do follow 5 basic guideline principles to make it look beautiful as a flower. SAP Fiori was launched with 25 applications with HCM, Timesheet apps few popular among the first 25 apps. Now the portfolio of Fiori apps is much bigger covering a wide spectrum of functional fields and more than 500+ apps.

 

Victory!

When we try to predict the future with SAPUI5/Open UI5 and Fiori, we are going to see more of open source stacks coming in like Node.js and Angular.js influence with UI5.

Now the major question comes here: Is it worth learning UI5 or if you are already a UI5 developer it is worth spending time to upgrade the skills and the answer is yes!

 

That’s Right!

Till now we have only seen the tip of the iceberg and there is a lot more to come. At UI5CN we spend a lot of our time( as we don’t have anything else to do) to help people who are starting their career with SAP or upgrade their skills to go to the next level.

 

 

Share this blog if you liked it and tweet it if you want more 🙂

Posted on

7 Reasons To Learn UI5

This blog will pinpoint 7 major reason why UI5 is worth considering if you are looking forward to learn it, to set the context check our previous blog the Sweet Story of SAPUI5/OpenUI5 and Javascript. Basically, UI5 is open source Javascript library build with Javascript, jQuery, HTML5 and CSS3. Using UI5 we can create HTML5 applications, which can then be run in web browser.

 

1.Open Source

Free Stuffs, tell me more !

Open UI5 libraries are open source which means that you pay zero licensing cost to use Open UI5 technologies. If you are creating an app with UI5 it comes under Apache License open source version 2.0 licences and the goals of this licence is to reduce the number of frequently asked questions, to allow the license to be reusable without modification by any project, to allow the license to be included by reference instead of listed in every file etc. Read more about Apache License version 2.0 here.

 

2.Integrate with existing JS libraries:

Javascript can do anything !?

SAPUI5 and OpenUI5 are created using with Javascript so the integration with existing pool of Javascript libraries are easy, UI5 internally uses D3JS analytics libraries to leverage graphs and data representation in nice and beautiful visual forms. In our Advanced UI5 Professional course we have covered this in details of how to add an external libraries elements as components in UI5 itself . See more here.

 

3.Pre-Build Elements

Ready Made Stuffs !

UI5 libraries are equipped with 200+ pre-build elements which allows developers to focus on UX designs of their application and the integration with the existing application of these components which are object based and simple once you know the basic working of MVC with UI5.

 

4.MVC

Different person, different task.

An UI5 Application utilizes MVC framework which clearly separated Model, View and Controls for an existing application and designing complex application with this pattern is much simpler.

 

5.Responsive

Responsive.

When you create a UI5 application with responsive component the component change it’s shape and size to adapt depending upon type of device they are currently being operated on. Thanks to media query of CSS3 which allows it to do so. It provides a much needed benefit to make sure that apps are usable independent of what device your end-user is using to run these apps. Even with custom CSS and media query we can make the look and feel of the application even more customised which we covered in details in our Professional UI5 development course.

 

6.Loose coupling Architecture:

Architecture efficiency !

When we talk about big picture of how these UI5 application are deployed in landscape. They are basically following loose coupling architecture which means the UI5 components are independent of the middleware components and backend. This provides a good degree of separation when we talk about coming up with new version of your application. Your middleware can be a oData service provider like SAP Netweaver gateway or SAP Hana system. Middle ware development is one of the curtal part in any application now as most of the data fetching performance is based on that. Learn how it can be done in details here.

 

7.Comprehensive API reference:

Comprehensive

Finally, API reference provided by SAPUI5/OpenUI5 is comprehensive which helps a lot to understand how to use these libraries. The explored provided is a big help to see how individual component will look like and what are the code to be written to include it.

 

Some of the disadvantages related to UI5 is it’s initial high loading time of libraries, that means libraries can take time when they are initially loaded in your web browser this can also be fixed by using early loading concepts .

Check some of our Free and Paid resources to learn UI5 here, these are made by people who knows a lot about UI5 but are too lazy to work as consultant/contractors 🙂

Share if you like it and tweet if you want more !