fast.ai: A Fresh take on Learning and Teaching ML

In this video Rachel Thomas provides an interesting take on learning ML: instead of promoting the typical bottom-up approach, fast.ai promotes a top-down approach. From a pedagogical perspective this seems counter intuitive. Surely you need to know the building blocks before you can move on to the theory that builds on the building blocks?  Indeed, that is how traditional education proceeds. However,  when consultants provide feedback to executives they tend to take a top-down approach. Why is that?

The main reason for taking a top-down approach when writing up/presenting technical findings is that you can provide a roadmap for where you are heading. This means that when you step into the details, the stakeholders can, because they now have a map of where you are heading, know how the details relate to the bigger picture. This is precisely why I think the fast.ai approach to learning ML can be effective.  Rachel Thomas provides further motivation for their approach in their video: How to Learn Deep Learning (when you’re not a computer science PhD)

Inheritance

In this post we will look at how different types of inheritance can be translated to OWL. We consider the case where Person is specialized by Employee and Client (Fig. 1). In a UML class diagram if inheritance is not annotated the default annotation {incomplete, disjoint} is assumed. incomplete means there are instances of Person which are neither of type Employee nor Client. disjoint means there is no instance of Person that is both of type Employee and of type Client. The set representation is given in Fig. 2 and the OWL translation in Fig. 3.

InheritanceDefault

Fig. 1

InheritanceDefaultSet

Fig. 2

InheritanceDefaultOWL

Fig. 3

The annotation {complete, disjoint} means every instance of Person is either a instance of Employee or an instance of Client(Fig. 4). The corresponding Venn diagram is  given in Fig. 5 and the OWL translation in Fig. 6.

InheritanceCompleteDisjoint

Fig. 4

InheritanceCompleteDisjointSet

Fig. 5

InheritanceCompleteDisjointOWL

Fig. 6

When overlapping is used rather than disjoint it means an instance of Person may be both of type Employee and of type Client.  Fig. 7 – 9 provides a UML class diagram, Venn diagram and OWL translation as example for the annotation {incomplete, overlapping}. Fig. 10 – 12 provides a UML class diagram, Venn diagram and OWL translation as example for the annotation {complete, overlapping}.

InheritanceIncompleteOverlapping

Fig. 7

InheritanceIncompleteOverlappingSet

Fig. 8

InheritanceIncompleteOverlappingOWL

Fig. 9

InheritanceCompleteOverlapping

Fig. 10

InheritanceCompleteOverlappingSet

Fig. 11

InheritanceCompleteOverlappingOWL

Fig. 12

A Brief Introduction to Protégé and Reasoners

A question you rightfully may be pondering is: Why translate object oriented classes into OWL? The answer is that it can help you to find logical inconsistencies in your class designs. In this post I will introduce the tools that will eventually enable you to find logical inconsistencies in your class designs.

The tool we will use is called Protégé. Download and installations instructions for Protégé can be found at https://protegewiki.stanford.edu/wiki/Install_Protege5.

In this post I will provide two screencasts:

  1. In the first screencast I will show you how to enter the OWL representation of the Person class introduced in the previous post.
  2. In the second screencast I will show you how to run a reasoner and how an inconsistency can arise.

On to the first screencast:

  1. Create a Person class.
  2. Create the data properties.
    1. name
    2. surname
    3. age
  3. Through sub-classing state that the Person class necessarily have a
    1. name,
    2. surname and
    3. age.
  4. If we run the reasoner on this ontology, no inconsistencies will be found.

In the second screencast I show how an inconsistency can arise. The steps are as follows:

  1. Create an individual called sarah of type Person.
  2. Run the reasoner. You will see the reasoner give no errors (nothing happened). This may come as a surprise to you since we have not set the name, surname or age data properties for the individual called sarah. In OWL this behaviour is expected due to what is called the open world assumption. OWL makes no assumption with regards to knowledge that is not stated explicitly. Since we did not state that the sarah individual does not have, for example, a name, the reasoner found no error in our ontology. This is different from typical database behaviour where absence of information is often assumed to indicate that the information does not exist, which is referred to as the closed world assumption.
  3. Now let us change our sarah individual to state that it does not have a name. This is achieved by stating that the sarah individual is of type name max 0 xsd:string. This states that the sarah individual can have a maximum of 0 name data properties of type xsd:string.
    SarahDoesNotHaveName
  4. If we run the reasoner now it shows that we have an inconsistency. We can ask Protégé to explain the inconsistency.ExplainSarahInconsistency
  5. The explanation states that sarah is of type Person and of type name max 0 xsd:string. But Person is a subclass of name some xsd:string. This states that individuals of type Person must have at least 1 name property of type xsd:string. Hence, the reason for the inconsistency.

 

Admittedly this example is contrived: there is not much sense in creating a Person class which we state must have a name and then create an individual of type Person which we then state does not have a name. But this was done here to show you how to use a reasoner to find inconsistencies in your ontology and to show you what information you can expect when your ontology is inconsistent.