concept attribute in category machine learning

This is an excerpt from Manning's book Collective Intelligence in Action.
Associated with each item is metadata, which may be in the form of professionally developed keywords, user-generated tags, keywords extracted by an algorithm after analyzing the text, ratings, popularity ranking, or just about anything that provides a higher level of information about the item and can be used to correlate items together. Think about metadata as a set of attributes that help qualify an item.
Data mining is the automated process of analyzing data to discover previously unknown patterns and create predictive models. Mining algorithms need test data in order to learn. A dataset is composed of a number of examples. Each example consists of values for a set of attributes. An attribute can be continuous or discrete. Discrete values that have an ordering associated with them are known as ordinal, while those that don’t have any ordering are called nominal.
1. Create the attributes.
For continuous attributes, such as age, we need to simply pass in the name of the attribute in the constructor:
Attribute ageAttribute = new Attribute("age");For nominal attributes, we first need to create a FastVector that contains the various values that the attribute can take. In the case of attribute gender, we do this with the following code:
FastVector genderAttributeValues = new FastVector(2); genderAttributeValues.addElement("male"); genderAttributeValues.addElement("female");The constructor for nominal attributes takes in the name of the attribute and a Fast-Vector containing the various values that this attribute can take. Therefore, we create the genderAttribute as follows:
Attribute genderAttribute = new Attribute("gender", genderAttributeValues);Next, we need to create the dataset for the data contained in table 7.4. A dataset is represented by Instances, which is composed of a number of Instance. Each Instance has values associated with each of the attributes. The code for creating the Instances is shown in listing 7.3.