Question
******Please do not import anything else, thank you! import java.util.LinkedList; /** * This method splits the virtual dataset over a nominal attribute. This process *
******Please do not import anything else, thank you!
import java.util.LinkedList;
/**
* This method splits the virtual dataset over a nominal attribute. This process
* has been discussed and exemplified in detail in the assignment description.
*
* @param attributeIndex is the index of the nominal attribute over which we
* want to split.
* @return a set (array) of partitions resulting from the split. The partitions
* will no longer contain the attribute over which we performed the
* split.
*/
public VirtualDataSet[] partitionByNominallAttribute(int attributeIndex) {
// WRITE YOUR CODE HERE!
//Remove the following line when this method has been implemented
return null;
}
Task 4.3*. Complete partitionByNominalAttribute(...). This method splits a (virtual) dataset over a
given nominal attribute. We elaborated what splitting over an attribute means earlier in the description.
Notice that, for a nominal attribute, you will have as many partitions as there are values in the (unique) value
set of the given attribute. This was already illustrated in Figure 5
Original Dataset S outlook temperature umidity windy class sunny het high FALSEN sunnot high TRUE TO overcast high FALSE luss rainy mild High FA FALSE rainy cool normal FALSE yes rainy cal normal TRUE no overcast cool normal TRUE yes sunny Imild highALSE no FALSE sunny cool normal FALSE les ny mild normal FALSE normal TRUE Ives mild overcast her normal FALSE yes rainy Ins TRUE no TRUE Les outlook=rainy outlook=overcast outlook-sunny outlook class yes yes sunny sunny sunny sunny sunny temperature humidity cool normal mild normal hot high hot high mild high windy FALSE TRUE FALSE TRUE FALSE outlook overcast overcast overcast overcast temperature humidity hot high cool normal mild high hot normal windy class FALSE lyes TRUE yes TRUE yes FALSE yes outlook rainy rainy rainy rainy rainy temperature humidity mild high cool normal mild normal cool normal mild high windy class FALSE yes FALSE yes FALSE yes TRUE no TRUE no no no no Figure 5: The result of splitting the dataset of Figure 1 over "outlook; in the three resulting partitions, the outlook column is shaded red, indicating that the outlook attribute is dropped from the partitionsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started