Linear Regression using Weka and Java

8 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$49.99
List Price:  $69.99
You save:  $20
€42.52
List Price:  €59.53
You save:  €17.01
£37.27
List Price:  £52.19
You save:  £14.91
CA$68.86
List Price:  CA$96.41
You save:  CA$27.55
A$75.34
List Price:  A$105.49
You save:  A$30.14
S$64.47
List Price:  S$90.27
You save:  S$25.79
HK$388.86
List Price:  HK$544.44
You save:  HK$155.57
CHF 39.78
List Price:  CHF 55.69
You save:  CHF 15.91
NOK kr508.40
List Price:  NOK kr711.80
You save:  NOK kr203.40
DKK kr317.68
List Price:  DKK kr444.77
You save:  DKK kr127.09
NZ$86.44
List Price:  NZ$121.02
You save:  NZ$34.58
د.إ183.58
List Price:  د.إ257.03
You save:  د.إ73.45
৳6,107.52
List Price:  ৳8,551.02
You save:  ৳2,443.49
₹4,549.73
List Price:  ₹6,369.99
You save:  ₹1,820.25
RM204.23
List Price:  RM285.94
You save:  RM81.71
₦72,591.97
List Price:  ₦101,634.57
You save:  ₦29,042.60
₨14,005.97
List Price:  ₨19,609.48
You save:  ₨5,603.51
฿1,575.72
List Price:  ฿2,206.14
You save:  ฿630.41
₺2,135.21
List Price:  ₺2,989.46
You save:  ₺854.25
B$270.67
List Price:  B$378.96
You save:  B$108.29
R839.85
List Price:  R1,175.86
You save:  R336
Лв83.15
List Price:  Лв116.42
You save:  Лв33.27
₩73,708.76
List Price:  ₩103,198.16
You save:  ₩29,489.40
₪160.81
List Price:  ₪225.14
You save:  ₪64.33
₱2,930.02
List Price:  ₱4,102.27
You save:  ₱1,172.24
¥7,740.31
List Price:  ¥10,837.05
You save:  ¥3,096.74
MX$898.20
List Price:  MX$1,257.56
You save:  MX$359.35
QR182.14
List Price:  QR255.01
You save:  QR72.87
P660.05
List Price:  P924.12
You save:  P264.07
KSh6,443.71
List Price:  KSh9,021.71
You save:  KSh2,578
E£2,369.56
List Price:  E£3,317.57
You save:  E£948.01
ብር7,778.43
List Price:  ብር10,890.43
You save:  ብር3,111.99
Kz45,607.28
List Price:  Kz63,853.85
You save:  Kz18,246.56
CLP$45,707.35
List Price:  CLP$63,993.95
You save:  CLP$18,286.60
CN¥352.01
List Price:  CN¥492.84
You save:  CN¥140.83
RD$3,174.56
List Price:  RD$4,444.65
You save:  RD$1,270.08
DA6,479.50
List Price:  DA9,071.82
You save:  DA2,592.32
FJ$112.66
List Price:  FJ$157.74
You save:  FJ$45.07
Q382.83
List Price:  Q536
You save:  Q153.16
GY$10,455.70
List Price:  GY$14,638.82
You save:  GY$4,183.11
ISK kr6,301.73
List Price:  ISK kr8,822.93
You save:  ISK kr2,521.20
DH458.73
List Price:  DH642.26
You save:  DH183.52
L841.87
List Price:  L1,178.68
You save:  L336.81
ден2,617.77
List Price:  ден3,665.09
You save:  ден1,047.32
MOP$400.62
List Price:  MOP$560.91
You save:  MOP$160.28
N$838.51
List Price:  N$1,173.99
You save:  N$335.47
C$1,839.31
List Price:  C$2,575.18
You save:  C$735.87
रु7,252.24
List Price:  रु10,153.72
You save:  रु2,901.48
S/168.29
List Price:  S/235.62
You save:  S/67.33
K212.38
List Price:  K297.36
You save:  K84.97
SAR187.52
List Price:  SAR262.55
You save:  SAR75.02
ZK1,158.20
List Price:  ZK1,621.58
You save:  ZK463.37
L216.50
List Price:  L303.11
You save:  L86.61
Kč1,034.66
List Price:  Kč1,448.60
You save:  Kč413.94
Ft16,368.18
List Price:  Ft22,916.77
You save:  Ft6,548.58
SEK kr464.96
List Price:  SEK kr650.99
You save:  SEK kr186.02
ARS$71,899.03
List Price:  ARS$100,664.40
You save:  ARS$28,765.36
Bs346.59
List Price:  Bs485.26
You save:  Bs138.66
COP$189,678.03
List Price:  COP$265,564.41
You save:  COP$75,886.38
₡24,999.25
List Price:  ₡35,000.95
You save:  ₡10,001.70
L1,316.40
List Price:  L1,843.07
You save:  L526.66
₲335,662.32
List Price:  ₲469,954.11
You save:  ₲134,291.78
$U1,955.72
List Price:  $U2,738.16
You save:  $U782.44
zł179.59
List Price:  zł251.44
You save:  zł71.85
Already have an account? Log In

Transcript

Okay. So to use these are created linear regression in these are ricotta cross are these are Java project we can do something like this. So, I will do something like fabri static for Main Street arguments okay and I will go and create a new function. So for this new function call your classification podrick study for classification train, train set, stream test set three algorithm in page three index integer test index contains extreme test string algorithm integer tree index in the test index. So I create a new function or method here so I create something that is data sauce sauce equal new data sauce train sec case. So I again do some some QA here I can gather data source here.

I bought this library here okay saw Get Data Set okay instance train equal okay. Still some error data instances instances are created clause okay so I need to handle an exception. So I will do something like this try catch exception Okay then now your brain or your printer I have a message here so yeah message. Okay, so now I don't know anything yeah. Okay. So this is the train set here.

Then train dot set in dot set, set crossing guys to train index Okay, so a train doc cross index equal equal minus one then we said a trained up cross As to train the number of attributes minus one. Okay. Then we do sauce equal new data set, so we'll do something IDs okay. So as you acquire new data so now we gather test asset instances string we change to test. So cross index equal test index. So class index as though Okay, so here is our test on number of IP bills minus one Okay, so I go write something like this.

So he Algol read equate equal to s and in here I suggest not to use equal equal user dot equals linear. We do something like this. Okay should be linear regressions linear regressions so the near New linear regressions okay classifier Capita by CLS equal I mean yeah. Okay. If I want to cross sci fi, then I will do something like deal classifier. So, CK I will have to import maga library first classifier classifiers So, to create a linear regression, I will have to do something like this build classifier, then a training set and for integer i equals zero i less than test set so, number of instances should be high prosperous okay.

And CLS labor equal linea classify instance to be test stock in Stan, hi. Okay. So I can print out a prediction System dot out dot print line. I can print the prediction maybe I print something like this Ah So see the regressions. Here I can do something I see is a request for maybe a prediction. Okay.

So I will rob the linear regression classification here in our regression prediction here

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.