Machine Learning Prediction Task: Contact Lenses Dataset Formulation and Binary Representation

Clinical Context and Supervised Prediction Formulation

The contact lenses prediction task exemplifies a foundational problem in supervised machine learning: learning a predictive mapping from multi-attribute clinical observations to an expert clinical decision. In this setting, the underlying scenario involves 2424 individuals who wish to begin wearing contact lenses and visit an optician for an eye examination. Each individual patient corresponds exactly to one row in a structured tabular dataset, derived with modifications from the Lenses dataset hosted by the University of California, Irvine (UCI) Machine Learning Repository.

During the examination, the optician systematically gathers information across five distinct physiological and demographic attributes, corresponding to the first five columns of the dataset. Based on these observed clinical features, the optician makes a professional determination regarding whether the patient is a viable candidate for contact lenses, which is recorded in the final column. In real-world data science workflows, historical records contain completed determinations, whereas new or unresolved patient consultations contain unknown outcomes. The goal of the prediction task is to infer or guess the optician's decision for patients whose outcome has not yet been determined.

Feature Definitions and Attribute Specifications

The dataset comprises five input attributes representing demographic characteristics and clinical measurements of ocular health, alongside a single binary target variable:

Presbyopic denotes whether the patient presents with presbyopia, a refractive condition associated with the physiological aging of the crystalline lens and ciliary body of the eye, characterized by a diminished ability to focus on near objects. This attribute takes the binary categorical values of Yes\text{Yes} or No\text{No}.

Young indicates the chronological age category of the individual, specifically distinguishing whether the patient is classified as young or not. The attribute takes the binary categorical values of Yes\text{Yes} or No\text{No}.

Spectacle prescription represents the primary refractive correction required by the patient to achieve sharp visual acuity. It classifies individuals into two mutually exclusive categories: Myope\text{Myope}, indicating short-sightedness (myopia) where distant objects appear blurred, and Hypermetrope\text{Hypermetrope}, indicating far-sightedness (hypermetropia) where nearby objects appear blurred.

Astigmatic captures the presence of astigmatism, an ocular condition caused by an irregular curvature of the cornea or lens resulting in an inability of the optical system to focus light evenly onto the retina. This attribute takes the binary categorical values of Yes\text{Yes} or No\text{No}.

Tear production rate measures the physiological output of the lacrimal functional unit, which is vital for maintaining corneal hydration, lens lubrication, and oxygen permeability during contact lens wear. It is categorized qualitatively into two distinct operational levels: Normal\text{Normal} or Reduced\text{Reduced}.

Can use contact lenses is the target classification outcome determined by the optician, indicating whether contact lens wear is clinically recommended and viable for the patient. The permissible values are Yes\text{Yes} or No\text{No}, with unresolved instances denoted by ??????.

Dataset Composition and Instance Categorization

The full cohort comprises 2424 patient records partitioned into historical training cases with verified outcomes and unclassified test cases awaiting clinical decision. The first 1212 rows represent fully resolved clinical decisions where the optician's judgment is recorded:

Patient 11: Presbyopic=No\text{Presbyopic} = \text{No}, Young=Yes\text{Young} = \text{Yes}, Spectacle prescription=Myope\text{Spectacle prescription} = \text{Myope}, Astigmatic=No\text{Astigmatic} = \text{No}, Tear production rate=Normal\text{Tear production rate} = \text{Normal}, Can use contact lenses=Yes\text{Can use contact lenses} = \text{Yes}.

Patient 22: Presbyopic=No\text{Presbyopic} = \text{No}, Young=Yes\text{Young} = \text{Yes}, Spectacle prescription=Myope\text{Spectacle prescription} = \text{Myope}, Astigmatic=Yes\text{Astigmatic} = \text{Yes}, Tear production rate=Reduced\text{Tear production rate} = \text{Reduced}, Can use contact lenses=No\text{Can use contact lenses} = \text{No}.

Patient 33: Presbyopic=No\text{Presbyopic} = \text{No}, Young=Yes\text{Young} = \text{Yes}, Spectacle prescription=Hypermetrope\text{Spectacle prescription} = \text{Hypermetrope}, Astigmatic=No\text{Astigmatic} = \text{No}, Tear production rate=Reduced\text{Tear production rate} = \text{Reduced}, Can use contact lenses=No\text{Can use contact lenses} = \text{No}.

Patient 44: Presbyopic=No\text{Presbyopic} = \text{No}, Young=Yes\text{Young} = \text{Yes}, Spectacle prescription=Hypermetrope\text{Spectacle prescription} = \text{Hypermetrope}, Astigmatic=No\text{Astigmatic} = \text{No}, Tear production rate=Normal\text{Tear production rate} = \text{Normal}, Can use contact lenses=Yes\text{Can use contact lenses} = \text{Yes}.

Patient 55: Presbyopic=No\text{Presbyopic} = \text{No}, Young=No\text{Young} = \text{No}, Spectacle prescription=Myope\text{Spectacle prescription} = \text{Myope}, Astigmatic=No\text{Astigmatic} = \text{No}, Tear production rate=Reduced\text{Tear production rate} = \text{Reduced}, Can use contact lenses=No\text{Can use contact lenses} = \text{No}.

Patient 66: Presbyopic=No\text{Presbyopic} = \text{No}, Young=No\text{Young} = \text{No}, Spectacle prescription=Myope\text{Spectacle prescription} = \text{Myope}, Astigmatic=No\text{Astigmatic} = \text{No}, Tear production rate=Normal\text{Tear production rate} = \text{Normal}, Can use contact lenses=Yes\text{Can use contact lenses} = \text{Yes}.

Patient 77: Presbyopic=No\text{Presbyopic} = \text{No}, Young=No\text{Young} = \text{No}, Spectacle prescription=Myope\text{Spectacle prescription} = \text{Myope}, Astigmatic=Yes\text{Astigmatic} = \text{Yes}, Tear production rate=Normal\text{Tear production rate} = \text{Normal}, Can use contact lenses=Yes\text{Can use contact lenses} = \text{Yes}.

Patient 88: Presbyopic=No\text{Presbyopic} = \text{No}, Young=No\text{Young} = \text{No}, Spectacle prescription=Hypermetrope\text{Spectacle prescription} = \text{Hypermetrope}, Astigmatic=No\text{Astigmatic} = \text{No}, Tear production rate=Reduced\text{Tear production rate} = \text{Reduced}, Can use contact lenses=No\text{Can use contact lenses} = \text{No}.

Patient 99: Presbyopic=No\text{Presbyopic} = \text{No}, Young=No\text{Young} = \text{No}, Spectacle prescription=Hypermetrope\text{Spectacle prescription} = \text{Hypermetrope}, Astigmatic=Yes\text{Astigmatic} = \text{Yes}, Tear production rate=Reduced\text{Tear production rate} = \text{Reduced}, Can use contact lenses=No\text{Can use contact lenses} = \text{No}.

Patient 1010: Presbyopic=No\text{Presbyopic} = \text{No}, Young=No\text{Young} = \text{No}, Spectacle prescription=Hypermetrope\text{Spectacle prescription} = \text{Hypermetrope}, Astigmatic=Yes\text{Astigmatic} = \text{Yes}, Tear production rate=Normal\text{Tear production rate} = \text{Normal}, Can use contact lenses=No\text{Can use contact lenses} = \text{No}.

Patient 1111: Presbyopic=Yes\text{Presbyopic} = \text{Yes}, Young=No\text{Young} = \text{No}, Spectacle prescription=Myope\text{Spectacle prescription} = \text{Myope}, Astigmatic=No\text{Astigmatic} = \text{No}, Tear production rate=Normal\text{Tear production rate} = \text{Normal}, Can use contact lenses=No\text{Can use contact lenses} = \text{No}.

Patient 1212: Presbyopic=Yes\text{Presbyopic} = \text{Yes}, Young=No\text{Young} = \text{No}, Spectacle prescription=Hypermetrope\text{Spectacle prescription} = \text{Hypermetrope}, Astigmatic=Yes\text{Astigmatic} = \text{Yes}, Tear production rate=Normal\text{Tear production rate} = \text{Normal}, Can use contact lenses=No\text{Can use contact lenses} = \text{No}.

The remaining 1212 instances (patients 1313 through 2424) represent consultation cases where the optician has not yet reached or recorded a decision, marked as ??????:

Patient 1313: Presbyopic=No\text{Presbyopic} = \text{No}, Young=Yes\text{Young} = \text{Yes}, Spectacle prescription=Myope\text{Spectacle prescription} = \text{Myope}, Astigmatic=No\text{Astigmatic} = \text{No}, Tear production rate=Reduced\text{Tear production rate} = \text{Reduced}, \text{Can use contact lenses} = {???}$.\n\nPatient 14::\text{Presbyopic} = \text{No},,\text{Young} = \text{Yes},,\text{Spectacle prescription} = \text{Myope},,\text{Astigmatic} = \text{Yes},,\text{Tear production rate} = \text{Normal},,\text{Can use contact lenses} = {???}$.

Patient 1515: Presbyopic=No\text{Presbyopic} = \text{No}, Young=Yes\text{Young} = \text{Yes}, Spectacle prescription=Hypermetrope\text{Spectacle prescription} = \text{Hypermetrope}, Astigmatic=Yes\text{Astigmatic} = \text{Yes}, Tear production rate=Reduced\text{Tear production rate} = \text{Reduced}, \text{Can use contact lenses} = {???}$.\n\nPatient 16::\text{Presbyopic} = \text{No},,\text{Young} = \text{Yes},,\text{Spectacle prescription} = \text{Hypermetrope},,\text{Astigmatic} = \text{Yes},,\text{Tear production rate} = \text{Normal},,\text{Can use contact lenses} = {???}$.

Patient 1717: Presbyopic=No\text{Presbyopic} = \text{No}, Young=No\text{Young} = \text{No}, Spectacle prescription=Myope\text{Spectacle prescription} = \text{Myope}, Astigmatic=Yes\text{Astigmatic} = \text{Yes}, Tear production rate=Reduced\text{Tear production rate} = \text{Reduced}, \text{Can use contact lenses} = {???}$.\n\nPatient 18::\text{Presbyopic} = \text{No},,\text{Young} = \text{No},,\text{Spectacle prescription} = \text{Hypermetrope},,\text{Astigmatic} = \text{No},,\text{Tear production rate} = \text{Normal},,\text{Can use contact lenses} = {???}$.

Patient 1919: Presbyopic=Yes\text{Presbyopic} = \text{Yes}, Young=No\text{Young} = \text{No}, Spectacle prescription=Myope\text{Spectacle prescription} = \text{Myope}, Astigmatic=No\text{Astigmatic} = \text{No}, Tear production rate=Reduced\text{Tear production rate} = \text{Reduced}, \text{Can use contact lenses} = {???}$.\n\nPatient 20::\text{Presbyopic} = \text{Yes},,\text{Young} = \text{No},,\text{Spectacle prescription} = \text{Myope},,\text{Astigmatic} = \text{Yes},,\text{Tear production rate} = \text{Reduced},,\text{Can use contact lenses} = {???}$.

Patient 2121: Presbyopic=Yes\text{Presbyopic} = \text{Yes}, Young=No\text{Young} = \text{No}, Spectacle prescription=Myope\text{Spectacle prescription} = \text{Myope}, Astigmatic=Yes\text{Astigmatic} = \text{Yes}, Tear production rate=Normal\text{Tear production rate} = \text{Normal}, \text{Can use contact lenses} = {???}$.\n\nPatient 22::\text{Presbyopic} = \text{Yes},,\text{Young} = \text{No},,\text{Spectacle prescription} = \text{Hypermetrope},,\text{Astigmatic} = \text{No},,\text{Tear production rate} = \text{Reduced},,\text{Can use contact lenses} = {???}$.

Patient 2323: Presbyopic=Yes\text{Presbyopic} = \text{Yes}, Young=No\text{Young} = \text{No}, Spectacle prescription=Hypermetrope\text{Spectacle prescription} = \text{Hypermetrope}, Astigmatic=No\text{Astigmatic} = \text{No}, Tear production rate=Normal\text{Tear production rate} = \text{Normal}, \text{Can use contact lenses} = {???}$.\n\nPatient 24::\text{Presbyopic} = \text{Yes},,\text{Young} = \text{No},,\text{Spectacle prescription} = \text{Hypermetrope},,\text{Astigmatic} = \text{Yes},,\text{Tear production rate} = \text{Reduced},,\text{Can use contact lenses} = {???}$.

Questions & Discussion

Question: We want to predict CanUseLenses for a person with feature vector (Presbyopic=No,Young=Yes,Prescription=Hypermetrope,Astigmatic=Yes,TearRate=Normal,CanUseLenses=???)(\text{Presbyopic}=\text{No}, \text{Young}=\text{Yes}, \text{Prescription}=\text{Hypermetrope}, \text{Astigmatic}=\text{Yes}, \text{TearRate}=\text{Normal}, \text{CanUseLenses}={???}). Which of the past cases cannot help us make this prediction?

Option A: (Presbyopic=Yes,Young=No,Prescription=Myope,Astigmatic=No,TearRate=Normal,CanUseLenses=No)(\text{Presbyopic}=\text{Yes}, \text{Young}=\text{No}, \text{Prescription}=\text{Myope}, \text{Astigmatic}=\text{No}, \text{TearRate}=\text{Normal}, \text{CanUseLenses}=\text{No})

Option B: (Presbyopic=Yes,Young=No,Prescription=Hypermetrope,Astigmatic=Yes,TearRate=Normal,CanUseLenses=No)(\text{Presbyopic}=\text{Yes}, \text{Young}=\text{No}, \text{Prescription}=\text{Hypermetrope}, \text{Astigmatic}=\text{Yes}, \text{TearRate}=\text{Normal}, \text{CanUseLenses}=\text{No})

Option C: (Presbyopic=No,Young=Yes,Prescription=Hypermetrope,Astigmatic=No,TearRate=Normal,CanUseLenses=???)(\text{Presbyopic}=\text{No}, \text{Young}=\text{Yes}, \text{Prescription}=\text{Hypermetrope}, \text{Astigmatic}=\text{No}, \text{TearRate}=\text{Normal}, \text{CanUseLenses}={???})

Option D: I don't know

Response and Explanation: The correct option is Option C. In supervised machine learning, an instance can only provide supervisory guidance or training signal if its ground-truth target label is known. A row where CanUseLenses=???\text{CanUseLenses}={???} carries no decision information from the optician, which renders it incapable of serving as evidence for training a classification model. Although Option C shares multiple feature values with the target instance, the absence of an outcome label means it provides zero insight into whether those specific characteristics should lead to an affirmative or negative prescription decision.

Conversely, Option A (corresponding to patient row 1111) and Option B (corresponding to patient row 1212) possess definitive negative decisions (CanUseLenses=No\text{CanUseLenses}=\text{No}). Even though their demographic or physiological attributes differ in varying degrees from the query individual, supervised algorithms utilize all labeled instances across the feature space to discover generalized relationships, boundary hyperplanes, or attribute correlations. Consequently, only the portion of the table where the optician's decision is already resolved constitutes usable training data.

Binary Encoding and Machine-Level Representation

Automated learning algorithms cannot natively interpret linguistic terms such as "Hypermetrope", "Normal", or "Reduced". Instead, machine learning frameworks require tabular data to be translated into numeric matrices. In this prediction domain, every categorical feature is mapped directly into binary indicator variables taking values in {0,1}\{0, 1\}.

The binary schema defines concise single-letter column headers and standard indicator encodings:

Column PP represents Presbyopic, where 00 encodes No\text{No} and 11 encodes Yes\text{Yes}.

Column YY represents Young, where 11 encodes Yes\text{Yes} and 00 encodes No\text{No}.

Column HH represents Hypermetrope for the spectacle prescription feature, where 00 encodes Myope\text{Myope} and 11 encodes Hypermetrope\text{Hypermetrope}.

Column AA represents Astigmatic, where 00 encodes No\text{No} and 11 encodes Yes\text{Yes}.

Column RR represents Reduced for the tear production rate feature, where 00 encodes Normal\text{Normal} and 11 encodes Reduced\text{Reduced}.

Column LL represents the target variable Can use contact lenses, where 11 encodes Yes\text{Yes}, 00 encodes No\text{No}, and unresolved query instances retain the unobserved indicator ??????.

Under this binary representation, the 1212 training cases alongside the query instance from row 1616 transform into a standardized numerical format:

Row 11: [P=0,Y=1,H=0,A=0,R=0  ⟹  L=1][P=0, Y=1, H=0, A=0, R=0 \implies L=1]

Row 22: [P=0,Y=1,H=0,A=1,R=1  ⟹  L=0][P=0, Y=1, H=0, A=1, R=1 \implies L=0]

Row 33: [P=0,Y=1,H=1,A=0,R=1  ⟹  L=0][P=0, Y=1, H=1, A=0, R=1 \implies L=0]

Row 44: [P=0,Y=1,H=1,A=0,R=0  ⟹  L=1][P=0, Y=1, H=1, A=0, R=0 \implies L=1]

Row 55: [P=0,Y=0,H=0,A=0,R=1  ⟹  L=0][P=0, Y=0, H=0, A=0, R=1 \implies L=0]

Row 66: [P=0,Y=0,H=0,A=0,R=0  ⟹  L=1][P=0, Y=0, H=0, A=0, R=0 \implies L=1]

Row 77: [P=0,Y=0,H=0,A=1,R=0  ⟹  L=1][P=0, Y=0, H=0, A=1, R=0 \implies L=1]

Row 88: [P=0,Y=0,H=1,A=0,R=1  ⟹  L=0][P=0, Y=0, H=1, A=0, R=1 \implies L=0]

Row 99: [P=0,Y=0,H=1,A=1,R=1  ⟹  L=0][P=0, Y=0, H=1, A=1, R=1 \implies L=0]

Row 1010: [P=0,Y=0,H=1,A=1,R=0  ⟹  L=0][P=0, Y=0, H=1, A=1, R=0 \implies L=0]

Row 1111: [P=1,Y=0,H=0,A=0,R=0  ⟹  L=0][P=1, Y=0, H=0, A=0, R=0 \implies L=0]

Row 1212: [P=1,Y=0,H=1,A=1,R=0  ⟹  L=0][P=1, Y=0, H=1, A=1, R=0 \implies L=0]

Query Instance (Row 1616): [P=0,Y=1,H=1,A=1,R=0  ⟹  L=???][P=0, Y=1, H=1, A=1, R=0 \implies L={???}]

This binary representation strips away semantic domain labels, presenting a pure mathematical classification task. An inductive learning model must infer the boolean function or conditional probability distribution P(L=1∣P,Y,H,A,R)P(L=1 \mid P, Y, H, A, R) solely from the 1212 observed rows to predict the unknown outcome of the query vector [0,1,1,1,0][0, 1, 1, 1, 0].