Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Classification Problem

Subject: Classification Problem

From: Khalid Iqbal

Date: 2 Oct, 2011 18:08:10

Message: 1 of 1

I splitted ZOO dataset

AnimalFeature={'airborne','aquatic','backbone','breathes','catsize','domestic','eggs','feathers','fins','hair','milk','predator','tail','toothed','venomous'};

ZooData=[0 0 0 0 0 1 1 1 1 1 0 0 0 0 0
0 0 0 0 0 1 1 1 1 1 1 0 0 0 0
0 0 0 0 0 1 1 1 1 1 0 0 1 0 0
0 0 0 0 0 1 0 1 1 1 0 0 0 0 0
0 1 1 0 1 0 0 0 1 1 0 0 1 1 0
0 1 1 0 1 0 1 0 1 1 0 0 1 0 0
0 1 0 0 1 0 0 0 1 1 0 0 1 1 0
0 1 0 0 1 1 0 0 1 1 0 0 1 0 0
0 1 0 0 1 0 0 0 1 1 0 0 1 0 1
0 1 0 0 1 1 1 0 1 1 0 0 1 0 0
0 1 0 0 1 0 1 0 1 1 0 0 1 0 0
0 1 0 0 0 0 1 0 1 1 0 0 1 0 0
0 1 0 0 1 0 0 0 1 1 0 0 1 0 0
0 1 0 0 0 0 0 0 1 1 0 0 1 0 1
0 1 0 0 1 0 0 0 1 1 0 0 1 1 0
0 1 0 0 0 1 1 0 1 1 0 0 1 0 1
0 1 0 0 1 0 0 0 1 1 0 0 1 0 0
0 1 0 0 0 0 1 0 1 1 0 0 1 0 1
0 1 0 0 1 1 1 0 1 1 0 0 1 0 0
0 1 0 0 1 1 1 0 1 1 0 0 1 0 0
0 1 0 0 1 0 0 0 1 1 0 0 1 0 0
0 1 0 0 1 1 0 0 1 1 0 0 1 0 1
0 1 0 0 1 0 1 0 1 1 0 0 1 0 1
0 1 0 0 1 0 0 0 1 1 0 0 1 0 0
0 0 1 0 0 1 1 1 1 0 0 1 1 0 0
0 0 1 0 0 1 0 1 1 0 0 1 1 1 0
0 0 1 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1 1 1 0 0 1 0 1
1 0 0 1 0 0 1 1 1 1 0 0 1 0 1
0 0 0 0 0 0 1 1 1 1 1 0 1 0 0
0 0 0 0 0 1 1 1 1 0 1 0 1 0 0
0 0 0 0 0 0 1 1 1 1 0 0 1 0 0
0 0 0 0 0 0 0 0 1 1 0 0 1 0 1
0 0 0 0 0 0 1 1 1 1 0 0 1 0 0
];

>>
Class={'mammal';'mammal';'fish';'mammal';'mammal';'mammal';'mammal';'fish';'fish';'mammal';'mammal';'bird';'fish';'invertebrate';'invertebrate';'invertebrate';'bird';'mammal';'fish';'mammal';'bird';'bird';'mammal';'bird';'insect';'amphibian';'amphibian';'mammal';'mammal';'mammal';'insect';'mammal';'mammal';'bird';'fish';'mammal';'mammal';'bird';'fish';'insect';'insect';'bird';'insect';'bird';'mammal';'mammal';'invertebrate';'mammal';'mammal';'mammal';'mammal';'insect';'amphibian';'invertebrate';'mammal';'mammal';'bird';'bird';'bird';'bird';'fish';'fish';'reptile';'mammal';'mammal';'mammal';'mammal';'mammal';'mammal';'mammal';'mammal';'bird';'invertebrate';'fish';'mammal';'mammal';'reptile';'invertebrate';'bird';'bird';'reptile';'invertebrate';'fish';'bird';'mammal';'invertebrate';'fish';'bird';'insect';'amphibian';'reptile';'reptile';'fish';'mammal';'mammal';'bird';'mammal';'insect';'mam
mal';'invertebrate';'bird'};

Animals={'bass';'carp';'catfish';'chicken';'chub';'clam';'crab';'crayfish';'crow';'dogfish';'dolphin';'dove';'duck';'flamingo';'flea';'frog';'frog1';'gnat';'gull';'haddock';'hawk';'herring';'kiwi';'ladybird';'lark';'lobster';'newt';'octopus';'ostrich';'parakeet';'penguin';'pheasant';'pike';'piranha';'pitviper';'porpoise';'rhea';'scorpion';'seahorse';'seasnake';'seawasp';'skimmer';'skua';'slowworm';'slug';'sole';'sparrow';'starfish';'stingray';'swan';'termite';'toad';'tortoise';'tuatara';'tuna';'vulture';'worm';'wren';'aardvark';'antelope';'bear';'boar';'buffalo';'calf';'cavy';'cheetah';'deer';'elephant';'fruitbat';'giraffe';'girl';'goat';'gorilla';'hamster';'hare';'honeybee';'housefly';'leopard';'lion';'lynx';'mink';'mole';'mongoose';'moth';'opossum';'oryx';'platypus';'polecat';'pony';'puma';'pussycat';'raccoon';'reindeer';'seal';'sealion';'squirrel';'vampire';'vole';'wallaby';'wasp';'wo
lf'};

I want to display the following Classified class for "amphibian"

bass amphibian 0 0 1 0 0 1 1 1 1 0 0 1 1 0 0
carp amphibian 0 0 1 0 0 1 0 1 1 0 0 1 1 1 0
catfish amphibian 0 0 1 0 0 1 1 1 1 0 0 1 1 0 0
chicken amphibian 0 1 1 0 1 0 0 0 1 1 0 0 1 1 0

SImilarly for "Bird"


chub bird 0 0 1 0 0 1 1 1 1 0 0 1 1 0 0
clam bird 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0
crab bird 0 0 1 0 0 1 1 0 0 0 0 0 0 0 0
crayfish bird 0 0 1 0 0 1 1 0 0 0 0 0 0 0 0
crow bird 0 1 1 0 1 0 1 0 1 1 0 0 1 0 0
dogfish bird 0 0 1 0 0 1 1 1 1 0 0 1 1 0 1
dolphin bird 0 0 0 1 0 1 1 1 1 1 0 1 1 0 1
dove bird 0 1 0 0 1 0 0 0 1 1 0 0 1 1 0
duck bird 0 1 0 0 1 1 0 0 1 1 0 0 1 0 0
flamingo bird 0 1 0 0 1 0 0 0 1 1 0 0 1 0 1
flea bird 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0
frog bird 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0
frog bird 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0
gnat bird 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0
gull bird 0 1 0 0 1 1 1 0 1 1 0 0 1 0 0
haddock bird 0 0 0 0 0 1 0 1 1 0 0 1 1 0 0
hawk bird 0 1 0 0 1 0 1 0 1 1 0 0 1 0 0
herring bird 0 0 0 0 0 1 1 1 1 0 0 1 1 0 0
kiwi bird 0 1 0 0 0 0 1 0 1 1 0 0 1 0 0
ladybird bird 0 0 0 0 1 0 1 0 0 1 0 0 0 0 0
 and so on.

Can someone help me in developing this code.
Thanks in advance.

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us