• Home
  • About Us
  • Contact Us
  • Disclaimer
  • Privacy Policy
Saturday, September 13, 2025
newsaiworld
  • Home
  • Artificial Intelligence
  • ChatGPT
  • Data Science
  • Machine Learning
  • Crypto Coins
  • Contact Us
No Result
View All Result
  • Home
  • Artificial Intelligence
  • ChatGPT
  • Data Science
  • Machine Learning
  • Crypto Coins
  • Contact Us
No Result
View All Result
Morning News
No Result
View All Result
Home Machine Learning

Designing Reliable ML Fashions: Alan & Aida Uncover Monotonicity in Machine Studying

Admin by Admin
August 24, 2025
in Machine Learning
0
Blackieshoot clirfccteyy unsplash scaled 1.jpg
0
SHARES
1
VIEWS
Share on FacebookShare on Twitter

READ ALSO

If we use AI to do our work – what’s our job, then?

10 Python One-Liners Each Machine Studying Practitioner Ought to Know


Machine studying fashions are highly effective, however typically they produce predictions that break human instinct.

Think about this: you’re predicting home costs. A 2,000 sq. ft. house is predicted cheaper than a 1,500 sq. ft. residence. Sounds flawed, proper?

That is the place monotonicity constraints step in. They make sure that fashions comply with the logical enterprise guidelines we anticipate.

Let’s comply with two colleagues, Alan and Aida, on their journey to find why monotonicity issues in machine studying.

The Story: Alan & Aida’s Discovery

Alan is a sensible engineer. Aida is a principled scientist. Collectively, they’re constructing a home value prediction mannequin.

Alan proudly exhibits Aida his mannequin outcomes:

“Look! R² is nice, the error is low. We’re able to deploy!”

Aida takes the mannequin out for testing: 

  • For a home with 1500 sq ft → Mannequin predicts $300,000
  • For a home with 2000 sq ft → Mannequin predicts $280,000 😮

Aida frowns as she appears to be like on the predictions:

“Wait a second… Why is that this 2,000 sq. ft. residence predicted cheaper than a 1,500 sq. ft. residence? That doesn’t make sense.”

Alan shrugs:

“That’s as a result of the mannequin discovered noise within the coaching information. It’s not at all times logical. However, the accuracy is sweet general. Isn’t that sufficient?”

Aida shakes her head:

“Probably not. A reliable mannequin should not solely be correct but in addition comply with logic folks can belief. Prospects received’t belief us if larger properties typically look cheaper. We want a assure. This can be a monotonicity drawback.”

And identical to that, Alan learns his subsequent massive ML lesson: metrics aren’t the whole lot.

What’s Monotonicity in ML?

Aida explains:

“Monotonicity means predictions transfer in a constant path as inputs change. It’s like telling the mannequin: as sq. footage goes up, value ought to by no means go down. We name it Monotone rising. Or, as one other instance, as a home age will get older, predicted costs shouldn’t go up. We name this Monotone reducing.”

Alan concludes that: 

“So monotonicity right here issues as a result of it:

  • Aligns with enterprise logic, and
  • Improves belief & interpretability.”

Aida nodded:

  • “Sure, Plus, it helps meet equity & regulatory expectations.”

Visualizing the Drawback

Aida creates a toy dataset in Pandas to indicate the issue:

import pandas as pd

# Instance toy dataset
information = pd.DataFrame({
   "sqft": [1200, 1500, 1800, 2000, 2200, 2250],
   "predicted_price": [250000, 270000, 260000, 280000, 290000, 285000]  # Discover dip at 1800 sqft and 2250 sqft
})

# Type by sqft
data_sorted = information.sort_values("sqft")

# Verify variations in goal
data_sorted["price_diff"] = data_sorted["predicted_price"].diff()

# Discover monotonicity violations (the place value decreases as sqft will increase)
violations = data_sorted[data_sorted["price_diff"] < 0]
print("Monotonicity violations:n", violations)
Monotonicity violations:
    sqft   value  price_diff
2  1800  260000    -10000.0
5  2250  285000     -5000.0

After which she plots the violations:

import matplotlib.pyplot as plt
plt.determine(figsize=(7,5))
plt.plot(information["sqft"], information["predicted_price"], marker="o", linestyle="-.", coloration="steelblue", label="Predicted Worth")


# Spotlight the dips
for sqft, value, price_diff in violations.values:
 plt.scatter(sqft, value, coloration="crimson", zorder=5)
 plt.textual content(x=sqft, y=price-3000, s="Dip!", coloration="crimson", ha="heart")


# Labels and title
plt.title("Predicted Home Costs vs. Sq. Footage")
plt.xlabel("Sq. Footage (sqft)")
plt.ylabel("Predicted Worth ($)")
plt.grid(True, linestyle="--", alpha=0.6)
plt.legend()

Aida factors to the Dips: “Right here’s the issue: 1,800 sq. ft. is priced decrease than 1,500 sq. ft. and a couple of,250 sq. ft. is priced decrease than 2,200 sq. ft.”

Fixing It with Monotonicity Constraints in XGBoost

Alan retrains the mannequin and units a monotonic rising constraint on sq. footage and monotonic reducing constraint on home age.
This forces the mannequin to at all times 

  • improve (or keep the identical) when sq. footage will increase given all different options are fastened. 
  • lower (or keep the identical) when home age will increase given all different options are fastened. 

He makes use of XGBoost that makes it straightforward to implement monotonicity:

import xgboost as xgb
from sklearn.model_selection import train_test_split

df = pd.DataFrame({
   "sqft": [1200, 1500, 1800, 2000, 2200],
   "house_age": [30, 20, 15, 10, 5],
   "value": [250000, 270000, 280000, 320000, 350000]
})

X = df[["sqft", "house_age"]]
y = df["price"]

X_train, X_test, y_train, y_test = train_test_split(X, y, 
                                    test_size=0.2, random_state=42)

monotone_constraints = {
   "sqft": 1,        # Monotone rising
   "house_age": -1   # Monotone reducing
}

mannequin = xgb.XGBRegressor(
   monotone_constraints=monotone_constraints,
   n_estimators=200,
   learning_rate=0.1,
   max_depth=4,
   random_state=42
)

mannequin.match(X_train, y_train)

print(X_test)
print("Predicted value:", mannequin.predict(X_test.values))
  sqft  house_age
1  1500         20
Predicted value: [250000.84]

Alan palms over the brand new mannequin to Aida. “Now the mannequin respects area data. Predictions for bigger homes won’t ever dip under smaller ones.”

Aida exams the mannequin once more:

  • 1500 sq ft → $300,000
  • 2000 sq ft → $350,000
  • 2500 sq ft → $400,000

Now she sees a smoother plot of home costs vs sq. footage.

import matplotlib.pyplot as plt

data2 = pd.DataFrame({
  "sqft": [1200, 1500, 1800, 2000, 2200, 2250],
  "predicted_price": [250000, 270000, 275000, 280000, 290000, 292000]
})

plt.determine(figsize=(7,5))
plt.plot(data2["sqft"], data2["predicted_price"], marker="o", 
                     linestyle="-.", coloration="inexperienced", label="Predicted Worth")

plt.title("Monotonic Predicted Home Costs vs. Sq. Footage")
plt.xlabel("Sq. Footage (sqft)")
plt.ylabel("Predicted Worth ($)")
plt.grid(True, linestyle="--", alpha=0.6)
plt.legend()

Aida: “Good! When properties are of the identical age, a bigger measurement persistently results in the next or equal value. Conversely, properties of the identical sq. footage will at all times be priced decrease if they’re older.”

Alan: “Sure — we gave the mannequin guardrails that align with area data.”

Actual-World Examples

Alan: what different domains can profit from monotonicity constraints? 

Aida: Wherever clients or cash are concerned, monotonicity can affect belief. Some domains the place monotonicity actually issues are:

  • Home pricing → Bigger properties shouldn’t be priced decrease.
  • Mortgage approvals → Increased revenue shouldn’t cut back approval likelihood.
  • Credit score scoring → Longer compensation historical past shouldn’t decrease the rating.
  • Buyer lifetime worth (CLV) → Extra purchases shouldn’t decrease CLV predictions.
  • Insurance coverage pricing → Extra protection shouldn’t cut back the premium.

Takeaways

  • Accuracy alone doesn’t assure trustworthiness.
  • Monotonicity ensures predictions align with frequent sense and enterprise guidelines.
  • Prospects, regulators, and stakeholders usually tend to settle for and use fashions which can be each correct and logical.

As Aida reminds Alan:

“Make fashions not simply sensible, however wise.”


Closing Ideas

Subsequent time you construct a mannequin, don’t simply ask: How correct is it? Additionally ask: Does it make sense to the individuals who’ll use it?

Monotonicity constraints are one in every of many instruments for designing reliable ML fashions — alongside explainability, equity constraints, and transparency.

. . .

Thanks for studying! I usually share insights on sensible AI/ML methods—let’s join on LinkedIn if you happen to’d wish to proceed the dialog.

Tags: AidaAlanDesigningDiscoverLearningMachineModelsMonotonicityTrustworthy

Related Posts

Mike von 2hzl3nmoozs unsplash scaled 1.jpg
Machine Learning

If we use AI to do our work – what’s our job, then?

September 13, 2025
Mlm ipc 10 python one liners ml practitioners 1024x683.png
Machine Learning

10 Python One-Liners Each Machine Studying Practitioner Ought to Know

September 12, 2025
Luna wang s01fgc mfqw unsplash 1.jpg
Machine Learning

When A Distinction Truly Makes A Distinction

September 11, 2025
Mlm ipc roc auc vs precision recall imblanced data 1024x683.png
Machine Learning

ROC AUC vs Precision-Recall for Imbalanced Knowledge

September 10, 2025
Langchain for eda build a csv sanity check agent in python.png
Machine Learning

LangChain for EDA: Construct a CSV Sanity-Examine Agent in Python

September 9, 2025
Jakub zerdzicki a 90g6ta56a unsplash scaled 1.jpg
Machine Learning

Implementing the Espresso Machine in Python

September 8, 2025
Next Post
A 9c6459.jpg

Ethereum Breaks 8-12 months Resistance Towards Bitcoin, Wants Affirmation On The 2W Timeframe

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

POPULAR NEWS

0 3.png

College endowments be a part of crypto rush, boosting meme cash like Meme Index

February 10, 2025
Gemini 2.0 Fash Vs Gpt 4o.webp.webp

Gemini 2.0 Flash vs GPT 4o: Which is Higher?

January 19, 2025
1da3lz S3h Cujupuolbtvw.png

Scaling Statistics: Incremental Customary Deviation in SQL with dbt | by Yuval Gorchover | Jan, 2025

January 2, 2025
0khns0 Djocjfzxyr.jpeg

Constructing Data Graphs with LLM Graph Transformer | by Tomaz Bratanic | Nov, 2024

November 5, 2024
How To Maintain Data Quality In The Supply Chain Feature.jpg

Find out how to Preserve Knowledge High quality within the Provide Chain

September 8, 2024

EDITOR'S PICK

Bitcoin Price Action.webp.webp

Key Ranges and Market Situations

March 3, 2025
13 Dsgcblalxwwl Qtdplxa.gif

Prime 12 Expertise Information Scientists Have to Reach 2025 | by Benjamin Bodner | Dec, 2024

December 31, 2024
Mario mesaglio szccqe2a9pa unsplash scaled 1.jpg

Is Google’s Reveal of Gemini’s Affect Progress or Greenwashing?

August 23, 2025
3981 Twi Social Media Cyber Security Analyist Fb Linkedin 1200x628 V2.jpg

Select the Finest Instruments for Creating Excellent Purposes Utilizing AI

October 2, 2024

About Us

Welcome to News AI World, your go-to source for the latest in artificial intelligence news and developments. Our mission is to deliver comprehensive and insightful coverage of the rapidly evolving AI landscape, keeping you informed about breakthroughs, trends, and the transformative impact of AI technologies across industries.

Categories

  • Artificial Intelligence
  • ChatGPT
  • Crypto Coins
  • Data Science
  • Machine Learning

Recent Posts

  • If we use AI to do our work – what’s our job, then?
  • ‘Sturdy Likelihood’ Of US Forming Strategic Bitcoin Reserve In 2025
  • 3 Methods to Velocity Up and Enhance Your XGBoost Fashions
  • Home
  • About Us
  • Contact Us
  • Disclaimer
  • Privacy Policy

© 2024 Newsaiworld.com. All rights reserved.

No Result
View All Result
  • Home
  • Artificial Intelligence
  • ChatGPT
  • Data Science
  • Machine Learning
  • Crypto Coins
  • Contact Us

© 2024 Newsaiworld.com. All rights reserved.

Are you sure want to unlock this post?
Unlock left : 0
Are you sure want to cancel subscription?