Posts

Showing posts from February, 2021

Random Forest in Income per Person

Image
  Random Forest in Income per Person Introduction In gap minder data, Income per person is analyzed with the relation of oil consumption, Co2 emission, internet user rate an so on. Because these features are related social welfare, there might be some correlation with income per person. Getting and Preparing Data incomeperperson : Gross Domestic Product per capita oilperperson: O il Consumption per capita co2emissions: CO2 consumtion internetuserate :  Internet users (per 100 people) lifeexpectancy :  life expectancy at birth (years) polityscore :  subtracting an autocracy score from a democracy score. relectricperperson: residential electricity consumption per person urbanrate :  urban population employrate :  Percentage of total population, age above 15, that has been employed   The target data is converted to 12 category and change its data type to string for tree classification.  Data Modelling Target data is income per person and th...

Classification in Income per Person

Image
 Classification in Income per Person Introduction In gap minder data, Income per person is analyzed with the relation of oil consumption, Co2 emission, internet user rate an so on. Because these features are related social welfare, there might be some correlation with income per person. Getting and Preparing Data incomeperperson : Gross Domestic Product per capita oilperperson: O il Consumption per capita co2emissions: CO2 consumtion internetuserate : Internet users (per 100 people) lifeexpectancy : life expectancy at birth (years) polityscore : subtracting an autocracy score from a democracy score. relectricperperson: residential electricity consumption per person urbanrate : urban population employrate : Percentage of total population, age above 15, that has been employed   The target data is converted to 12 category and change its data type to string for tree classification.  Data Modelling Target data is income per person and the rest of the...

Logistic Regresion in Nicotine Dependence and Alcohol Dependence

Image
 Logistic Regresion in Nicotine Dependence and Alcohol Dependence Introduction In nesarc data, logisstic regression is analysed with Nicotine Dependence and Alcohol Conumption. People generally tend to smoke cigarettes while consuming alcohol so there might be a relation between the two features. Getting and Preparing Data Both current alcohol consumers (1) and ex-alcohol consumers (2) are filtered. Data Analysis The p-value of CONUMER is less than 0.05, so it is significantly associated with Nicotine Dependence. When the odd ratio is checked, %60 of alcohol consumers are more likely to have nicotine dependency.. Another explanatory variables "Major depression" has been added to mode. It has also low p-value, and it looks like "Major depression" has more association with Nicotine Dependence. Because the odd raition shows that the people have depression has 3.87 times nicotine dependency. Codes "" import numpy import pandas import statsmodels.api as sm ...

Multiple Regression in Co2 Emission

Image
  Multiple Regression in Co2 Emission Introduction In gapminder data, multiple regression is analysed with Co2 Emissions as a response variable. . Getting and Preparing Data Data Analysis Electric consumption is linearly related to  Co2 Emissions because t he   p-value   is lower than 0.05 so we reject the null hypthothesis that there is definetly an association  between electric consumption and Co2 Emission. When we calculate  electric consumption to polynomial functioni the p-value is increased to 0.08 which we can accept the null hypthothesis, there is no correlation to  Co2 Emissions and electric consumption with factor 2. R-Squared value is 7% which is pretty low indicating that we need more explanatory variables to make our model better fit. Adding More Explantory Variables Oil consumption and urban rate has been aded to model, but their p-values are higher than 0,05 so there is no correlation with these values to CO2 emission. Also, R-squ...