2. 2
Agenda
Quick introduction to Linear Regression
Weka Machine Learning Software
Demo #1 using Weka GUI
Microservices Architecture of Demo #2
Demo #2 with three Microservices, using Weka Java API
➔ Spring Data JPA using H2 database
➔ Centralized Configuration with Spring Cloud Config Server and Git repository
➔ Service Invocation using Feign
➔ Load Balancing with Ribbon
➔ Eureka Naming Server
➔ API Gateway with Zuul
➔ Distributed Tracing with Zipkin, Sleuth and RabbitMQ
➔ Broadcast of configuration changes with Spring Cloud Bus and RabbitMQ
➔ Fault Tolerance with Hystrix
Demo #3 – Full Stack Application with Angular 10
3. 3
Linear Regression - Definition
“Linear regression is a way to explain the
relationship between a dependent variable and
one or more explanatory variables using a
straight line.”
(Wikipedia)
4. 4
Linear Regression - Equation
γ = α + β1x1 + β2x2 + … + βnxn + ε
γ - the dependent variable (the value to be predicted)
α - the intercept (the value of γ when x = 0)
β - the slope of the line (a.k.a. regression coefficient)
x - the independent variable (a.k.a. explanatory variable)
ε - the error term (a.k.a. residual), reflects the unexplained
variation in γ
5. 5
Linear Regression - Graph
The blue points are actual samples.
With linear regression all points can be connected using a single, straight line.
6. 6
Weka
(Waikato Environment for Knowledge Analysis)
Weka is an open source machine learning
software that can be accessed through a GUI,
standard terminal applications, or a Java API
Developed at the University of Waikato, New
Zealand
Licensed under the GNU General Public License
Available at:
https://www.cs.waikato.ac.nz/ml/weka/
8. 8
Weka – ARFF File
ARFF (Attribute-Relation File Format) file is an
ASCII text file that describes a list of instances
sharing a set of attributes
ARFF files were developed by the Machine
Learning Project at the Department of Computer
Science of The University of Waikato for use with
the Weka machine learning software
The ARFF file format is:
@relation <relation-name>
@attribute <attribute-name> <datatype>
@data
13. 13
Choosing LinearRegression model
Click on Classify tab, then Choose > functions > LinearRegression.
In Test options, select Use training set and sellingPrice, then hit Start.
15. 15
Linear Regression Model
sellingPrice =
-26.6882 * houseSize +
7.0551 * lotSize +
43166.0767 * bedrooms +
42292.0901 * upgradedBathroom +
-21661.1208
The regression model tells that granite in the
kitchen doesn’t affect the house’s value.