1596969720

# Evaluation Metrics for Regression Problems

Hi, today we are going to study about the Evaluation metrics for regression problems. Evaluation Metrics are very important as they tell us, how accurate our model is.

Before we proceed to the evaluation techniques, it is important to gain some intuition.

In the above image, we can see that we have plotted a linear curve, but the curve is not perfect as some points are lying above the line & some are lying below the line.

So, how accurate our model is?

The evaluation metrics aim to solve these problems. Now, without wasting time, let’s jump to the evaluation metrics & see the evaluation techniques.

There are 6 evaluation techniques:

1. M.A.E (Mean Absolute Error)

2. M.S.E (Mean Squared Error)

3. R.M.S.E (Root Mean Squared Error)

4. R.M.S.L.E (Root Mean Squared Log Error)

5. R-Squared

Now, let’s discuss these techniques one by one.

### M.A.E (Mean Absolute Error)

It is the simplest & very widely used evaluation technique. It is simply the mean of difference b/w actual & predicted values.

Below, is the mathematical formula of the Mean Absolute Error.

Mean Absolute Error

The Scikit-Learn is a great library, as it has almost all the inbuilt functions that we need in our Data Science journey.

Below is the code to implement Mean Absolute Error

``````from sklearn.metrics import mean_absolute_error

mean_absolute_error(y_true, y_pred)
``````

Here, ‘y_true’ is the true target values & ‘y_pred’ is the predicted target values.

#artificial-intelligence #evaluation-metric #machine-learning #regression #statistics #deep learning

1596969720

## Evaluation Metrics for Regression Problems

Hi, today we are going to study about the Evaluation metrics for regression problems. Evaluation Metrics are very important as they tell us, how accurate our model is.

Before we proceed to the evaluation techniques, it is important to gain some intuition.

In the above image, we can see that we have plotted a linear curve, but the curve is not perfect as some points are lying above the line & some are lying below the line.

So, how accurate our model is?

The evaluation metrics aim to solve these problems. Now, without wasting time, let’s jump to the evaluation metrics & see the evaluation techniques.

There are 6 evaluation techniques:

1. M.A.E (Mean Absolute Error)

2. M.S.E (Mean Squared Error)

3. R.M.S.E (Root Mean Squared Error)

4. R.M.S.L.E (Root Mean Squared Log Error)

5. R-Squared

Now, let’s discuss these techniques one by one.

### M.A.E (Mean Absolute Error)

It is the simplest & very widely used evaluation technique. It is simply the mean of difference b/w actual & predicted values.

Below, is the mathematical formula of the Mean Absolute Error.

Mean Absolute Error

The Scikit-Learn is a great library, as it has almost all the inbuilt functions that we need in our Data Science journey.

Below is the code to implement Mean Absolute Error

``````from sklearn.metrics import mean_absolute_error

mean_absolute_error(y_true, y_pred)
``````

Here, ‘y_true’ is the true target values & ‘y_pred’ is the predicted target values.

#artificial-intelligence #evaluation-metric #machine-learning #regression #statistics #deep learning

1657356960

## Oyente

An Analysis Tool for Smart Contracts

This repository is currently maintained by Xiao Liang Yu (@yxliang01). If you encounter any bugs or usage issues, please feel free to create an issue on our issue tracker.

## Quick Start

A container with required dependencies configured can be found here. The image is however outdated. We are working on pushing the latest image to dockerhub for your convenience. If you experience any issue with this image, please try to build a new docker image by pulling this codebase before open an issue.

To open the container, install docker and run:

``````docker pull luongnguyen/oyente && docker run -i -t luongnguyen/oyente
``````

To evaluate the greeter contract inside the container, run:

``````cd /oyente/oyente && python oyente.py -s greeter.sol
``````

and you are done!

Note - If need the version of Oyente referred to in the paper, run the container from here

To run the web interface, execute `docker run -w /oyente/web -p 3000:3000 oyente:latest ./bin/rails server`

## Custom Docker image build

``````docker build -t oyente .
docker run -it -p 3000:3000 -e "OYENTE=/oyente/oyente" oyente:latest
``````

Open a web browser to `http://localhost:3000` for the graphical interface.

## Installation

Execute a python virtualenv

``````python -m virtualenv env
source env/bin/activate
``````

Install Oyente via pip:

``````\$ pip2 install oyente
``````

Dependencies:

The following require a Linux system to fufill. macOS instructions forthcoming.

## Full installation

### Install the following dependencies

#### solc

``````\$ sudo add-apt-repository ppa:ethereum/ethereum
\$ sudo apt-get update
\$ sudo apt-get install solc
``````

#### evm from go-ethereum

2. By from PPA if your using Ubuntu

#### z3 Theorem Prover version 4.5.0.

Install z3 using Python bindings

``````\$ python scripts/mk_make.py --python
\$ cd build
\$ make
\$ sudo make install
``````

#### Requests library

``````pip install requests
``````

#### web3 library

``````pip install web3
``````

### Evaluating Ethereum Contracts

``````#evaluate a local solidity contract
python oyente.py -s <contract filename>

#evaluate a local solidity with option -a to verify assertions in the contract
python oyente.py -a -s <contract filename>

#evaluate a local evm contract
python oyente.py -s <contract filename> -b

#evaluate a remote contract
python oyente.py -ru https://gist.githubusercontent.com/loiluu/d0eb34d473e421df12b38c12a7423a61/raw/2415b3fb782f5d286777e0bcebc57812ce3786da/puzzle.sol
``````

And that's it! Run `python oyente.py --help` for a list of options.

## Paper

The accompanying paper explaining the bugs detected by the tool can be found here.

## Miscellaneous Utilities

A collection of the utilities that were developed for the paper are in `misc_utils`. Use them at your own risk - they have mostly been disposable.

1. `generate-graphs.py` - Contains a number of functions to get statistics from contracts.
2. `get_source.py` - The get_contract_code function can be used to retrieve contract source from EtherScan
3. `transaction_scrape.py` - Contains functions to retrieve up-to-date transaction information for a particular contract.

## Benchmarks

Note: This is an improved version of the tool used for the paper. Benchmarks are not for direct comparison.

To run the benchmarks, it is best to use the docker container as it includes the blockchain snapshot necessary. In the container, run `batch_run.py` after activating the virtualenv. Results are in `results.json` once the benchmark completes.

The benchmarks take a long time and a lot of RAM in any but the largest of clusters, beware.

Some analytics regarding the number of contracts tested, number of contracts analysed etc. is collected when running this benchmark.

## Contributing

Checkout out our contribution guide and the code structure here.

``````\$ sudo apt-get install software-properties-common
\$ sudo apt-get update
\$ sudo apt-get install ethereum``````

Author: enzymefinance
Source Code: https://github.com/enzymefinance/oyente

#blockchain #smartcontract #ethereum

1592023980

## 5 Regression algorithms: Explanation & Implementation in Python

Take your current understanding and skills on machine learning algorithms to the next level with this article. What is regression analysis in simple words? How is it applied in practice for real-world problems? And what is the possible snippet of codes in Python you can use for implementation regression algorithms for various objectives? Let’s forget about boring learning stuff and talk about science and the way it works.

#linear-regression-python #linear-regression #multivariate-regression #regression #python-programming

1598352300

## Regression: Linear Regression

Machine learning algorithms are not your regular algorithms that we may be used to because they are often described by a combination of some complex statistics and mathematics. Since it is very important to understand the background of any algorithm you want to implement, this could pose a challenge to people with a non-mathematical background as the maths can sap your motivation by slowing you down.

In this article, we would be discussing linear and logistic regression and some regression techniques assuming we all have heard or even learnt about the Linear model in Mathematics class at high school. Hopefully, at the end of the article, the concept would be clearer.

**Regression Analysis **is a statistical process for estimating the relationships between the dependent variables (say Y) and one or more independent variables or predictors (X). It explains the changes in the dependent variables with respect to changes in select predictors. Some major uses for regression analysis are in determining the strength of predictors, forecasting an effect, and trend forecasting. It finds the significant relationship between variables and the impact of predictors on dependent variables. In regression, we fit a curve/line (regression/best fit line) to the data points, such that the differences between the distances of data points from the curve/line are minimized.

#regression #machine-learning #beginner #logistic-regression #linear-regression #deep learning

1605176864

## How to do Problem Solving as a Developer

In this video, I will be talking about problem-solving as a developer.

#problem solving skills #problem solving how to #problem solving strategies #problem solving #developer