The Python code

As we stated earlier, our objective is to demonstrate how to implement various types of ML algorithms within IBM Watson Studio, not provide the theory behind each algorithm; in addition to that, consistent with the last section, we will utilize an existing sample Python script set to illustrate the functionalities and features offered within the Watson Studio platform, and not try to create a new solution.

In this implemented example, we have to do the following:

  • Find a predefined number of training samples closest in distance to a new sample of data that needs to be classified
  • Make sure the label (classification) of the new sample of data is defined by those (training sample) neighbors
  • Set a fixed user-defined constant for the number of neighbors that have to be determined
  • Compute the classification using a majority vote of the nearest neighbors of the new sample
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset