Attributes: Defining Your Data

Definition: A quality or characteristic describing an observation, such as colour or size, equivalent to feature in machine learning contexts.

Attributes in Code vs. AI

  • In OOP: An attribute is a property of a class (User.email).
  • In AI/ML: An attribute (or feature) is an input variable (Age, Income).
  • In Vibe Coding: An attribute is a specific detail you want the AI to include.

Prompting for Attributes

When asking AI to generate data or mock objects, you must be explicit about the attributes.

  • Bad Prompt: “Generate some users.”
    • Result: [{name: "John"}, {name: "Jane"}]
  • Good Prompt: “Generate 5 users with attributes: UUID, hashed_password, last_login_iso_date, and subscription_tier (enum: free, pro).”
    • Result: Perfect, production-ready JSON.

Feature Engineering with AI

If you are doing ML, you can ask the AI to “suggest attributes.”

  • Scenario: You want to predict house prices.
  • Prompt: “I have a dataset of houses. What derived attributes (features) should I create to improve my model?”
  • AI Answer: “Create ‘price_per_sqft’, ‘age_of_roof’, and ‘distance_to_school’.”

The “Vibe” of Data

In the vibe coding era, you often deal with unstructured text. You can use AI to Extract Attributes.

  • Prompt: “Read this email and extract the attributes: sender_sentiment, urgency_level, and action_items.”
    This turns messy human text into clean structured data for your code to consume.

Similar Posts

Leave a Reply