Case study - page prediction

Now we will continue with our running example, the search engine. What we want to do here is to try to predict whether a URL comes from the first page of the search engine results or not. So, it is time to use the material we have covered so far in this chapter.

In Chapter 2, Data Processing Toolbox, we created the following object to store the information about pages:

public class RankedPage {     private String url;     private int position;     private int page;     private int titleLength;     private int bodyContentLength;     private boolean queryInTitle;     private int numberOfHeaders;     private int numberOfLinks; }

First, we can start by adding a few methods to this object, as follows:

  • isHttps: This should tell us if the ...

Get Mastering Java for Data Science now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.