Giter Site home page Giter Site logo

guilhermedom / adaline-celsius-to-fahrenheit Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 408 KB

Adaline regressor learning the Celsius to Fahrenheit formula.

License: MIT License

Jupyter Notebook 100.00%
adaline celsius-to-fahrenheit linear-regression python scikit-learn tensorflow

adaline-celsius-to-fahrenheit's Introduction

Adaline Converting Celsius to Fahrenheit

Adaline regressor learning the Celsius to Fahrenheit formula.


Problem Overview

Temperatures are measured using 3 main metrics: Celsius, Fahrenheit and Kelvin. Each one of them can be obtained from any other using a linear function. The Celsius to Fahrenheit conversion formula, for instance, is as follows:

$$ Fahrenheit = 1.8 * Celsius + 32 $$

Since it is a very simple formula, many machine learning algorithms are able to learn it and predict the conversion given a value in Celsius. Algorithms that have to fit coefficients for a weighted function can be interpreted intuitively in this task. The fitted coefficients, in this case, must be 1.8 for the single variable and 32 for the bias (or intercept).

We have a very simple dataset with only 30 instances and 2 variables. The independent variable is composed of random degrees Celsius. The dependent variable was built by calculating the corresponding degrees Fahrenheit for each instance. As this task is rather simple, this small dataset has more than enough data for a good model to learn the Celsius to Fahrenheit formula. Our data points are plotted in the next figure. The linear correlation between Celsius and Fahrenheit degrees is visible as the two variables plotted against each other form a line.

adaline_celsius_to_fahrenheit_correlation

Analysis Introduction

Out of the many possible algorithm choices for building a model for this task, an Adaline regressor was the chosen one. Adaline is a neural network composed of a single neuron in a single layer, with no activation function. Adaline is a close variation of the Perceptron, with the only difference being the lack of an activation function. This leads to Adaline models being fit using the output of the neuron directly instead of the output of the activation function for the neuron.

A simple regressor model like Adaline is applicable on this task given its simplicity. Since we have such a simple model, we can easily interpret it while maintaining a great performance.

In our tests, the Adaline regressor was able to correctly learn the conversion formula of degrees Celsius to degrees Fahrenheit. The next figure illustrates how the regression line perfectly intersects with all data points from our dataset.

adaline_celsius_to_fahrenheit_regressor

adaline-celsius-to-fahrenheit's People

Contributors

guilhermedom avatar

Watchers

 avatar  avatar  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.