Linear Regression using Weka and Java 2

4 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.93
List Price:  €60.10
You save:  €17.17
£37.46
List Price:  £52.44
You save:  £14.98
CA$69.12
List Price:  CA$96.78
You save:  CA$27.65
A$75.26
List Price:  A$105.37
You save:  A$30.11
S$64.76
List Price:  S$90.67
You save:  S$25.91
HK$389.16
List Price:  HK$544.86
You save:  HK$155.69
CHF 40.18
List Price:  CHF 56.26
You save:  CHF 16.07
NOK kr505.23
List Price:  NOK kr707.37
You save:  NOK kr202.13
DKK kr320.68
List Price:  DKK kr448.97
You save:  DKK kr128.29
NZ$86.53
List Price:  NZ$121.15
You save:  NZ$34.62
د.إ183.58
List Price:  د.إ257.03
You save:  د.إ73.45
৳6,116.06
List Price:  ৳8,562.98
You save:  ৳2,446.91
₹4,497.02
List Price:  ₹6,296.19
You save:  ₹1,799.17
RM205.50
List Price:  RM287.72
You save:  RM82.22
₦72,526.70
List Price:  ₦101,543.19
You save:  ₦29,016.48
₨14,014.55
List Price:  ₨19,621.49
You save:  ₨5,606.94
฿1,592.73
List Price:  ฿2,229.95
You save:  ฿637.22
₺2,125.87
List Price:  ₺2,976.39
You save:  ₺850.52
B$271.91
List Price:  B$380.70
You save:  B$108.78
R846.14
List Price:  R1,184.67
You save:  R338.52
Лв83.98
List Price:  Лв117.58
You save:  Лв33.60
₩73,675.26
List Price:  ₩103,151.26
You save:  ₩29,476
₪161.74
List Price:  ₪226.45
You save:  ₪64.71
₱2,947.66
List Price:  ₱4,126.96
You save:  ₱1,179.30
¥7,766.44
List Price:  ¥10,873.64
You save:  ¥3,107.20
MX$908.54
List Price:  MX$1,272.04
You save:  MX$363.49
QR182.21
List Price:  QR255.11
You save:  QR72.89
P664.14
List Price:  P929.85
You save:  P265.71
KSh6,466.31
List Price:  KSh9,053.35
You save:  KSh2,587.04
E£2,373.62
List Price:  E£3,323.27
You save:  E£949.64
ብር7,753.82
List Price:  ብር10,855.98
You save:  ብር3,102.15
Kz45,840.83
List Price:  Kz64,180.83
You save:  Kz18,340
CLP$46,084.78
List Price:  CLP$64,522.38
You save:  CLP$18,437.60
CN¥353.43
List Price:  CN¥494.83
You save:  CN¥141.40
RD$3,201.94
List Price:  RD$4,482.97
You save:  RD$1,281.03
DA6,487.24
List Price:  DA9,082.66
You save:  DA2,595.41
FJ$112.99
List Price:  FJ$158.20
You save:  FJ$45.20
Q382.91
List Price:  Q536.11
You save:  Q153.19
GY$10,458.56
List Price:  GY$14,642.82
You save:  GY$4,184.26
ISK kr6,395.49
List Price:  ISK kr8,954.20
You save:  ISK kr2,558.70
DH461.70
List Price:  DH646.42
You save:  DH184.71
L850.55
List Price:  L1,190.84
You save:  L340.29
ден2,645.65
List Price:  ден3,704.12
You save:  ден1,058.47
MOP$400.86
List Price:  MOP$561.24
You save:  MOP$160.37
N$847.22
List Price:  N$1,186.17
You save:  N$338.95
C$1,839.66
List Price:  C$2,575.68
You save:  C$736.01
रु7,191.23
List Price:  रु10,068.30
You save:  रु2,877.06
S/168.03
List Price:  S/235.26
You save:  S/67.22
K212.12
List Price:  K296.99
You save:  K84.86
SAR187.61
List Price:  SAR262.67
You save:  SAR75.05
ZK1,155.73
List Price:  ZK1,618.12
You save:  ZK462.38
L218.58
List Price:  L306.03
You save:  L87.45
Kč1,038.96
List Price:  Kč1,454.63
You save:  Kč415.67
Ft16,243.25
List Price:  Ft22,741.85
You save:  Ft6,498.60
SEK kr469.93
List Price:  SEK kr657.94
You save:  SEK kr188.01
ARS$71,553.30
List Price:  ARS$100,180.35
You save:  ARS$28,627.04
Bs345.44
List Price:  Bs483.64
You save:  Bs138.20
COP$189,920.36
List Price:  COP$265,903.70
You save:  COP$75,983.34
₡24,418.74
List Price:  ₡34,188.19
You save:  ₡9,769.45
L1,316.61
List Price:  L1,843.36
You save:  L526.75
₲343,808.75
List Price:  ₲481,359.76
You save:  ₲137,551.01
$U1,953.05
List Price:  $U2,734.43
You save:  $U781.37
zł181.59
List Price:  zł254.25
You save:  zł72.65
Already have an account? Log In

Transcript

Ok, I can also add one more line here I can do something like this System dot out dot println lie then I can print the instance so test dot instance I say two I am prediction is a classification table here okay. So, after I create these are linear regression model here. So, I will explain about what all this means. So, let's say this is the classification method. So, we have this our training set and then the test set algorithm training dice and the testing test. So, they are data sauce sauce equal new data salsa train set.

So, in the string sorry are put into our location or the training Data okay instances equal train instances train because sauce gather data set from these are data ah training data location then train dot cyclocross index to be a trading desk. So for crossing that what are these cohere mean is that for let's say, data here. So let's say I have Iris data. Okay, let's say I have Iris data here. So I want to set our variable to be less cost variables. So let's say I want to say these are variable here to the class variable.

So I will set the variable using the index, so the index will be 0123 and four. So the fourth index will be our variable class here. So let's see, I want to set this variable to be a class variable, I will set index to be 401234. So let's see, class indices not found not set. I will set a class in class using the number of variables on number of attributes minus one. So let's say I have all the variables here, so 123455 variables, so five minus one will be four.

So one, two Three four. So, if I say the class index is not being set, there we take the last variable last column as a class variable. So now we look into Java code here. So for training data, we set a class index. Then for testing data, we also do the same thing. So we import the testing data and then we set our class index.

Then eat algorithm is equal to linear linear regression linear equal new linear regression. classifier c is equal new linear classifier, we build a classifier using our training set. So for integer i equals zero, i less than the number of instances observation of roles in this testing testing set I pass brass. So dhaba classification label equal linear classifier observation or the role and then I print out Ah install the role roll and then I print out a prediction issue is cross label here. So, this is what a cause mean. So, a in these are linear regression

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.