Giter Site home page Giter Site logo

rezamosavi8740 / onlinenewspopularity-analysis Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 11.35 MB

This exercise is the first series of machine learning course at Shahid Beheshti University. This exercise is for regression.

Jupyter Notebook 100.00%
eda linear-regression machine-learning matplotlib numpy pandas polynomial-regression python regression shahid-beheshti-university sklearn

onlinenewspopularity-analysis's Introduction

OnlineNewsPopularity Data

This dataset has been widely used for research and education purposes, particularly in the field of machine learning and data analysis, to explore how different factors influence the popularity of online news articles. However, as it's been some time since my last update, I recommend checking the UCI Machine Learning Repository or other reliable sources for the most up-to-date information on the "OnlineNewsPopularity" dataset.

Summary

In this task, we predict the value of the shares column by pre-processing the data and checking different machine-learning models.

Model results with R2_score and training with linear regression without any preprocessing: 0.013436911487878178

Model results with R2_score and training with polynomial regression by preprocessing: 0.42482892634462005

Checking correlation

It can be seen that most of the features are not related to the target.

Therefore, it is not possible to remove a feature easily, because it is possible that some features have a non-linear relationship with the target, and also because the coefficients are very close to each other.

So, removing features in relation to their relationship with the target is not a good thing.

Checking the distribution of shares

Remove outlier records

IQR :

Due to the deletion of a large part of the data, we abandon this method.

Z-test :

Due to the non-normality of the distribution, we refrain from using this method.

Percentile:

By removing one percentage of outlier data :โ€Œ

Scaling

  • Quantile Transformer

  • power transformer

  • -min-max-

Again scaling

Now we rescale the data that we scaled with the Quantile Transformer method

  • min-mix

A very important point is that all data are normally between 0 and 1.

  • power transformer

  • RobustScaler

  • StandardScaler

using min-max after Quantile

Linear model

R2_score : 0.15420224054686105

Polynomial model

R2_score : 0.42482892634462005

onlinenewspopularity-analysis's People

Contributors

rezamosavi8740 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.