The examples use the input table kmodes_input, which has 32 observations, on 11 variables, about different models of cars:
Variable |
Type |
Description |
mpg |
Normalized numerical |
Miles/US gallon |
cyl |
Numerical treated as categorical |
Number of cylinders |
disp |
Normalized numerical |
Displacement (cubic inches) |
hp |
Normalized numerical |
Gross horsepower |
drat |
Normalized numerical |
Rear axle ratio |
wt |
Normalized numerical |
Weight (lb/1000) |
qsec |
Normalized numerical |
1/4 mile time |
vs |
Categorical |
Engine (V or straight) |
am |
Categorical |
Transmission (automatic or manual) |
gear |
Numerical treated as categorical |
Number of forward gears |
carb |
Numerical treated as categorical |
Number of carburetors |
KModes Example Input Table kmodes_input (Columns 6-12)
drat |
wt |
qsec |
vs |
am |
gear |
carb |
-0.835197792 |
0.22254417 |
-0.307088658 |
S |
automatic |
3 |
2 |
-1.246659826 |
2.077504765 |
0.073449451 |
S |
automatic |
3 |
4 |
0.24956575 |
0.636460997 |
-1.364760755 |
S |
automatic |
3 |
4 |
-0.685575235 |
2.174596366 |
-0.239934874 |
S |
automatic |
3 |
4 |
0.473999587 |
-0.917004624 |
0.426006817 |
V |
manual |
4 |
1 |
-1.564607761 |
0.309415603 |
-0.54772305 |
S |
automatic |
3 |
2 |
-0.722980874 |
0.360516446 |
-1.124126363 |
S |
automatic |
3 |
4 |
0.043834734 |
-0.457097039 |
-1.314395417 |
S |
manual |
5 |
6 |
0.90416444 |
-1.039646647 |
0.907275602 |
V |
manual |
4 |
1 |
0.90416444 |
-1.310481114 |
0.588295128 |
V |
manual |
4 |
1 |
1.166003916 |
-0.048290296 |
-1.874010283 |
S |
manual |
5 |
4 |
2.493904115 |
-1.637526508 |
0.375641479 |
V |
manual |
4 |
2 |
-0.96611753 |
-0.002299538 |
0.890487156 |
V |
automatic |
3 |
1 |
-0.835197792 |
0.227654255 |
-0.46378082 |
S |
automatic |
3 |
2 |
-1.115740088 |
2.255335698 |
-0.016088927 |
S |
automatic |
3 |
4 |
0.324377029 |
-1.741772228 |
-0.530934604 |
V |
manual |
5 |
2 |
-0.105787824 |
0.360516446 |
-1.818048797 |
S |
manual |
5 |
8 |
0.567513685 |
-0.610399567 |
-0.777165145 |
S |
manual |
4 |
4 |
0.567513685 |
-0.349785269 |
-0.46378082 |
S |
manual |
4 |
4 |
0.604919325 |
-0.068730634 |
2.826754593 |
V |
automatic |
4 |
2 |
0.174754472 |
-0.027849959 |
1.203871481 |
V |
automatic |
4 |
2 |
0.604919325 |
0.227654255 |
0.252526208 |
V |
automatic |
4 |
4 |
0.604919325 |
0.227654255 |
0.588295128 |
V |
automatic |
4 |
4 |
-0.98482035 |
0.871524874 |
-0.251127171 |
S |
automatic |
3 |
3 |
-0.98482035 |
0.524039143 |
-0.139204198 |
S |
automatic |
3 |
3 |
-0.98482035 |
0.575139986 |
0.084641749 |
S |
automatic |
3 |
3 |
-0.96611753 |
0.641571082 |
-0.446992374 |
S |
automatic |
3 |
2 |
1.55876313 |
-1.100967659 |
-0.642857578 |
S |
manual |
5 |
2 |
1.166003916 |
-1.4126828 |
1.147909994 |
V |
manual |
4 |
1 |
0.193457291 |
-0.76881218 |
1.20946763 |
V |
automatic |
3 |
1 |
-1.564607761 |
0.248094592 |
1.326986752 |
V |
automatic |
3 |
1 |
0.960272899 |
-0.44687687 |
0.420410668 |
V |
manual |
4 |
2 |
The kmodes_init table is an additional input that contains three points that serve as initial cluster centers.
KModes Example Input Table kmodes_init (Columns 1-5)
model |
mpg |
cyl |
disp |
hp |
Datsun 710 |
0.449543447 |
4 |
-0.990182091 |
-0.783040459 |
Ferrari Dino |
-0.064813069 |
6 |
-0.691647397 |
0.412942174 |
Lincoln Continental |
-1.607882616 |
8 |
1.849931752 |
0.996348337 |
KModes Example Input Table kmodes_init (Columns 6-12)
drat |
wt |
qsec |
vs |
am |
gear |
carb |
0.473999587 |
-0.917004624 |
0.426006817 |
V |
manual |
4 |
1 |
0.043834734 |
-0.457097039 |
-1.314395417 |
S |
manual |
5 |
6 |
-1.115740088 |
2.255335698 |
-0.016088927 |
S |
automatic |
3 |
4 |