0% found this document useful (0 votes)
1 views3 pages

Task3

The document compares classical Machine Learning (ML) and Generative AI (GenAI), highlighting their differing mathematical optimization targets and applications. It also discusses interpolation techniques for handling anomalies in time-series data and the framework for A/B testing in data science, providing Python implementation examples for each. Practical use cases for both ML and GenAI are presented, illustrating their respective strengths in various domains.

Uploaded by

marwanem9090
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views3 pages

Task3

The document compares classical Machine Learning (ML) and Generative AI (GenAI), highlighting their differing mathematical optimization targets and applications. It also discusses interpolation techniques for handling anomalies in time-series data and the framework for A/B testing in data science, providing Python implementation examples for each. Practical use cases for both ML and GenAI are presented, illustrating their respective strengths in various domains.

Uploaded by

marwanem9090
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Classical ML Models vs.

Generative AI
RESEARCH TASK & COMPARATIVE IMPLEMENTATION SUMMARY

1. Theoretical Framework
The architectural paradigm shift between classical Machine Learning (ML) and Generative AI
(GenAI) is fundamentally rooted in their mathematical optimization targets. Classical ML is
predominantly discriminative, seeking to learn the conditional probability distribution P(Y | X).
It maps high-dimensional inputs to predefined discrete or continuous target boundaries,
optimizing structured loss metrics like Cross-Entropy or Mean Squared Error.

Conversely, Generative AI captures the underlying data distribution P(X) or the joint probability
P(X, Y). Instead of drawing boundaries to segregate data, GenAI models map inputs into
continuous latent spaces, allowing them to synthesize entirely new high-fidelity data structures
that mimic the true statistical characteristics of the training sets.

2. Example with Implementation


Below is a side-by-side Python comparison demonstrating text sentiment classification
(Discriminative ML) versus contextual text synthesis using a Transformer model (Generative AI).

import numpy as np

from sklearn.feature_extraction.text import TfidfVectorizer

from sklearn.linear_model import LogisticRegression

from transformers import GPT2LMHeadModel, GPT2Tokenizer

train_reviews = ["Architecture is elegant and efficient.", "Codebase is buggy and


unmaintainable."]

labels = [Link]([1, 0]) # 1=Positive, 0=Negative

3. Practical Use Cases

Classical Machine Learning Generative AI


Predictive Maintenance: Modeling historical Automated Source Code Synthesis:
microcontroller telemetry (temperature Generating
spikes, duty cycles) optimized firmware blocks or boilerplate
to forecast hardware failures. Spring Boot
microservices from raw text specifications.

Interpolation Techniques for Outliers


RESEARCH TASK & ENGINEERING FRAMEWORK

1. Theoretical Framework : In time-series and sequential data processing, anomalies or


transient spikes can compromise subsequent modeling phases. While traditional tabular
cleaning drops rows, sequential processes require maintaining structural alignment over
uniform intervals. Interpolation handling replaces identified statistical anomalies by treating
them as local missing values (NaN) and estimating their true values using adjacent data
distribution trends.

2. Example with Implementation : This complete Python implementation uses a rolling Z-


score to locate anomalies in simulated sensor data, handles them by casting them to null values,
and compares standard linear vs. spline estimations.

import numpy as np , import pandas as pd

[Link](42)

time_idx = pd.date_range(start="2026-07-10", periods=100, freq="min")

signal = [Link]([Link](0, 10, 100)) * 10

df = [Link]({'sensor_val': signal}, index=time_idx)

[Link][25] = 85.0 # Inject extreme sensor anomaly spikes

[Link][70] = -65.0

rolling_mean = df['sensor_val'].rolling(window=7, center=True, min_periods=1).mean()

rolling_std = df['sensor_val'].rolling(window=7, center=True, min_periods=1).std()

z_scores = (df['sensor_val'] - rolling_mean) / rolling_std.

3. Practical Use Cases


Linear / Time-Weighted Interpolation Cubic / Polynomial Splines
Network Bandwidth & Infrastructure: Biometric Signal Processing: Replacing noisy
Smoothing out motion
instantaneous packet loss metrics without artifacts in electrocardiogram (ECG) readouts
skewing where
broader baseline consumption analyses. maintaining smooth waveforms is mandatory.

A/B Testing in Data Science


RESEARCH TASK & STATISTICAL EVALUATION FRAMEWORK

1. Theoretical Framework: A/B Testing is a controlled randomized experiment used to


estimate the causal impact of isolated modifications within software ecosystems. The
framework isolates a user population and splits traffic evenly between a default control baseline
(Group A) and an updated variant (Group B). The experimental lifecycle relies on statistical
hypothesis formulation to eliminate random selection bias and confounding variance.

2. Example with Implementation :This complete Python implementation uses frequentist


statistics to calculate the sample size needed to detect a conversion lift, simulates experimental
event data, and performs a two-sample proportions z-test.

import numpy as np

import [Link] as sm

from [Link] import proportions_ztest

p1 = 0.12 # Baseline conversion rate (Control)

mde = 0.02 # Minimum Detectable Effect target (+2% lift) p2 = p1 + mde

effect_size = [Link].proportion_effectsize(p1, p2)

required_n = [Link]().solve_power(

effect_size=effect_size, alpha=0.05, power=0.80, ratio=1.0)

n_group = int([Link](required_n))

print(f"Required sample size per experimental branch: {n_group}")

3. Practical Use Cases

User Optimization & Conversion Logs Algorithm Validation & Backend Logic
E-Commerce Checkout Funnels: Testing Recommendation Engine Rollouts:
layout variations streamlined multi- Verifying backend machine learning
page vs. single-page multi- changes (e.g., matrix factorization vs.
service modules to decrease friction neural architectures) directly against
and cart abandonment. live user click rates.

You might also like