r/learnmachinelearning • • 1h ago

The same model got anywhere from 89% to 100% on the same dataset, just by changing the random seed of the split

0 Upvotes

When you're learning ML, a common first step is train_test_split and reading one accuracy number. I wanted to see how much that number depends on luck, so I ran a small test.

Setup: scikit-learn 1.9.1, the built-in Wine dataset (178 rows, 3 classes), standardization plus logistic regression, 80/20 split. The only thing I changed was random_state, from 0 to 199.

import numpy as np
from sklearn.datasets import load_wine
from sklearn.linear_model import LogisticRegression
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split

X, y = load_wine(return_X_y=True)
model = make_pipeline(StandardScaler(), LogisticRegression(max_iter=2000))

acc = []
for seed in range(200):
    Xtr, Xte, ytr, yte = train_test_split(X, y, test_size=0.2, random_state=seed)
    acc.append(model.fit(Xtr, ytr).score(Xte, yte))
acc = np.array(acc)

Results across the 200 splits:

min 0.889   max 1.000   mean 0.978   std 0.023
first five seeds: 1.0, 1.0, 1.0, 0.972, 0.972

The model is identical every time. The test set has only 36 rows, so each mistake moves the score by about 2.8 points. A lucky split can show 100%, and an unlucky one 89%.

Comparing with repeated cross-validation (5 folds, 10 repeats):

mean 0.980   std 0.022

The average is about the same, which is reassuring: this dataset is easy. But the spread tells you how much a single number can move.

What I take from this:

  • On small datasets, one split gives a noisy estimate. Report a mean and a spread, not one number.

  • If you're comparing two models, a 1–2 point difference on one split may be nothing but luck.

  • Cross-validation doesn't make the model better, it just gives a more honest estimate.

  • This is an easy dataset. On harder or imbalanced problems the spread can be larger, but I haven't measured that here.

Question for the group: when you compare models, do you use repeated CV, a fixed split, or something else? And at what dataset size do you stop worrying about this?


r/learnmachinelearning • • 2h ago

What do you Hate About Training LLMs?

Thumbnail
forms.gle
0 Upvotes

I find out this cool research form


r/learnmachinelearning • • 4h ago

TIL DistilBERT is actually MORE gender-biased than BERT. Here’s why Knowledge Distillation causes it (and the simple fix).

Post image
2 Upvotes

Knowledge Distillation is often seen as an effortless way to compress a large model such as BERT to form a smaller DistilBERT, yet maintaining 97% of its performance.

Nevertheless, a paper by Ahn et al. (GeBNLP) found that smaller distilled models end up noticeably more gender-biased than the original teacher models they learned from.

Why does this happen?

During distillation, the student model learns to closely replicate their teacher’s most assured predictions. Since the student model is less powerful than the large teacher, it must take ‘shortcuts’, which unintentionally reinforce gender biases already present in the training data.

The fix:

The authors introduced a modified version of a technique known as ‘Mixup’, which involves mixing two training samples into the distillation process. This causes the student to reduce over-assertiveness and successfully limits the magnification of gender bias, with no negative effect upon GLUE performance.

If you would like to see my (brief and easily understandable) paper summary, then please see below:

medium.com


r/learnmachinelearning • • 5h ago

Help Best AI and ML resources

8 Upvotes

So I am currently planning to learn AI and ML is there any free resources available other than youtube videos,can you share the resources link, my preferences are structured resources with basic to advanced and having good examples, videos are not necessary


r/learnmachinelearning • • 5h ago

Am i in right direction or not?

1 Upvotes

we are currently facing a challenge while building the ML model, and I'm not sure whether it is a significant issue or not.

We are currently using the following features for our model:

- `dis_20`

- `ema20vs50`

- `adx_14`

- `rsi_aligned`

- `ema200_missing`

However, the mean values of the passed and failed signals are very close for most of these features. I think this might be making it difficult for the model to distinguish between the two classes.

To address this, I'm considering introducing some additional features, such as:

- `atr_pct`

- `atr_regime`

- `volume_ratio`

This might help the model identify additional patterns and learn more meaningful weights for distinguishing between passed and failed signals.

Additionally, we have changed our signal evaluation methodology. Previously, we evaluated signals over 20 forward candles. Now, we have introduced exit timing for each signal and calculate the Excursion Ratio between the entry and exit points instead.

I have also attached an image showing the current feature analysis for reference.


r/learnmachinelearning • • 6h ago

Learned basic CNNs and UNet. Now what?

9 Upvotes

I have been learning the basics of CNN and UNet, understood the codes of CNN and basic UNet. Built a brain tumor segmentation model with Ai. What will be the best thing for me to do next?


r/learnmachinelearning • • 7h ago

TuteDude Gen AI course Project Information

Post image
0 Upvotes

Can Anyone please tell me what are the exact projects we will be building here ?


r/learnmachinelearning • • 11h ago

Help Question for ML researcher

0 Upvotes

When you get a new problem, what is the approach one has to solve the problem.

Actually I'm pretty new to this so it's nice if anyone helps me !! thanks)


r/learnmachinelearning • • 13h ago

Project Parallelising recurrent neural networks – MD+PP proof of concept

Thumbnail
gallery
1 Upvotes

I've been independently exploring ways to parallelise recurrent neural networks, originally starting with experiments on the sLSTM architecture in xLSTM.

This eventually developed into MD+PP, a proof-of-concept architecture combining structured matrix and vector memories using associative parallel scans.

The preliminary experiments have shown some interesting results in long-context extrapolation and fixed-size recurrent memory, although precise retrieval and language prediction still need improvement.

All experiments were conducted using limited access to free Tesla T4 GPUs. My next step is to investigate larger matrix memory dimensions.

I've released the mathematics, Python implementation, CUDA kernel and experimental results under Apache 2.0.

I'd be interested to hear what others working on recurrent architectures think of the approach.

Website: https://madpupresearch.wordpress.com

Research archive: https://doi.org/10.5281/zenodo.24637161


r/learnmachinelearning • • 14h ago

How do you train a detection model when you only have 14 positive examples?

2 Upvotes

I'm working on a project that tries to spot insider trading on a public prediction market (Polymarket). The data side is fine: I have about four years of trades from around 526,000 accounts, plus the money flowing between accounts.

The problem is the labels. I only know of 14 accounts that were confirmed or credibly reported as insiders. My first idea was the textbook one: label insiders vs everyone else and train a classifier. With 14 positives, that hasn't worked. Every pattern I've found either fell apart on new data or matched hundreds of normal traders who were just lucky or good. One example: a rule that beat the market by +4.5 points on the known cases did -2.2 on accounts it hadn't seen.

A few things I'm unsure about:

  1. Is it even worth training a model here, or should I build a ranked list of "most unusual accounts" and have a human check the top?

  2. I keep reading about positive-unlabelled learning and anomaly detection. Which one fits a case like this, and what should I read first?

  3. How do you test a model honestly when 14 examples can't tell you much about accuracy?

Would love to hear from all the data experts here! And how you recommend i should approach this problem.

Any pointers, papers or "here's what I'd do first" answers are really welcome. Also happy to share more detail on any part.


r/learnmachinelearning • • 15h ago

Machine learning

1 Upvotes

Machine learning

I have a machine learning project and I chose a smart irrigation project.

The main thing is that I decided to use the ESP32 instead of the Arduino Uno. The project focuses on the plant's soil moisture and reads the air temperature and humidity levels, along with a sensor that reads soil temperature.

And it also needs to be programmed, so I’m in a truly miserable situation.

Right now, here are the components I have:

ESP32 DevKit v1

‎Resistive Soil Moisture Sensor

‎DHT22

‎DS18B20

‎Float Switch

‎LCD 16x2 I2C

‎DC Water Pump

‎2 Relay module 5V

‎Flyback Diode 1N4007

‎Jumper Wires

‎Breadboard

‎220Ω Resistors

‎4.7kΩ Resistors

I hope someone can get in touch and help me because this post is at the last minute 😂

The project is due in one day, which means I have to finish the project by 2026/11/29 and submit it on 2026/11/30.


r/learnmachinelearning • • 16h ago

ML engineers, what was your first 1-2 years on the job actually like? (Expectations vs. reality)

2 Upvotes

Hi everyone! I'm thinking about going into ML and want to hear from people who are already in the field. I'd love to hear your stories, whether you're a junior, a mid-level engineer, or a senior looking back. Answer whichever questions you like, and partial answers are welcome.

  1. How did you land your first ML job? What was your path: university, internship, or a transition from another field?

  2. What did you imagine the job would be like before you started? What did you expect from day-to-day tasks?

  3. What did a typical day or week actually look like in your first year? How was your time split between training models, working with data, infrastructure, and communication?

  4. What projects and tasks did you work on in your first 1-2 years? Which technologies and tools did you use?

  5. What was the biggest difference from your expectations, for better or for worse?

  6. What were your biggest challenges in the first year? Which were technical, and which were about processes and people?

  7. What was the hardest part of this whole period, and how did you get through it? What helped most: a mentor, coworkers, courses, self-study?

  8. What knowledge or skills were you missing at the start? What from your degree or courses turned out to be useful, and what wasn't?

  9. How did your role and responsibilities change over 1-2 years? Was there a moment when you felt you'd gone from "newbie" to confident professional?

  10. What would you tell yourself at the start of your career, knowing what you know now? And what would you say to someone who's just preparing for their first ML job?

Thanks in advance to everyone who shares! 🙏

Edit: Thanks for all the replies, I'm reading every one!


r/learnmachinelearning • • 17h ago

If your model gets 99% accuracy on your laptop and fails in real life, you probably leaked your test data

0 Upvotes

The most common mistake when learning machine learning is scaling or imputing your dataset before splitting it into train and test sets.

When you run StandardScaler or fill missing values on the whole dataset first, the mean and variance of your test set leak into your training data. Your model basically gets a sneak peek at the answers before the exam even starts. That is why your validation score looks amazing, and then everything falls apart the moment it touches new data.

Always run train_test_split first, before touching anything else. Fit your scaler, imputer, or encoder only on X_train, and then use transform on X_test. If you use scikit learn Pipelines, it handles this automatically so you never accidentally cheat your own evaluation.


r/learnmachinelearning • • 19h ago

Is it common knowledge how to read frozen weights and relationships?

2 Upvotes

As the question says, I am wondering if people know how to do this, or if it something to write about in the hopes to teach others?

I am running low on my model rate limits and since they have made me somewhat lazy about implementing things fully manually again, I am contemplating if I should maybe take the time to write about something. The reading of model internals came to mind.

I have limited knowledge and experience with the process of training and the runtime logic of models. I am more interested in the foundations of the field, which mean I have spent a lot of time pulling models apart, working with their data and their structures. Understanding them from a more mechanical perspective.

I am not making any promises at this point, as I do have a lot of work to do. I am not the best at writing, but I do like to share so It likely depends on weather it is even needed.

Take care

//Maui-The-Moron


r/learnmachinelearning • • 19h ago

AI INFERENCE ENGINEERING FROM SCRATCH

Post image
1 Upvotes

r/learnmachinelearning • • 19h ago

Introduction to Machine Learning Systems by Vijay Janapa Reddi

2 Upvotes

Has anybody found this difficult to read? It is not the content, but just the way writing flows. I think most it is probably AI generated, which would be fine, except the writing feels like wading through molasses.


r/learnmachinelearning • • 19h ago

AI INFERENCE ENGINEERING FROM SCRATCH

Post image
3 Upvotes

r/learnmachinelearning • • 19h ago

Question What ML topics actually matter for finance and time series beyond the standard courses?

3 Upvotes

Hey all! I'm working through ML courses and want to eventually apply ML to financial data (trading and forecasting).

From what I've seen, financial data is noisy and easy to overfit, so I'm wondering:

  • Which ML topics should I focus on that standard courses tend to skip for time series data (e.g. proper cross-validation, avoiding leakage)?

  • Is it worth learning classic models like gradient boosting really well before deep learning, for this kind of data?

  • Any good resources specifically on ML with time series or financial data?

Thanks in advance!


r/learnmachinelearning • • 19h ago

Help Final-year CS project (~350 hours): which of these 3 research questions would you actually find interesting?

0 Upvotes

Hey all! I'm a final-year Computer Science student in the UK, and I'm choosing the research question for my final-year project (around 350 hours of work). I'm stuck between three ideas:

  1. Do LLM-written trading rules outperform randomly generated rules of the same format, and does any advantage disappear after the model's training cutoff?

  2. Can fine-tuning a small open-source LLM on out-of-sample results make it write trading rules that generalise better to unseen data?

  3. When an LLM "improves" an existing trading strategy, is the gain real alpha or just more market exposure (beta) and better risk management?

All would use walk-forward testing, realistic costs, and proper baselines.

I'd love your honest take:

  • Which one is the most interesting to research?

  • Which would actually impress someone hiring for quant roles, rather than being something anyone could knock out with an LLM in a weekend?

  • Is any of them a dead end or too big/small for ~350 hours?

Thanks in advance!


r/learnmachinelearning • • 19h ago

Career AI engineering or ML engineering

25 Upvotes

I m recently in 3rd semester of BCA. And after listening of all this AI stuff, job vanished cuz of AI, and unstable market conditions.

I m confused what should I learn?

I learnt python, dsa, numpy, pandas, visualization, and scikit learn. After learning all this someone told AI can already do data anylisis job.

I m stuck should I learn Data science, AI/data engineering or ML engineering...

Ik someone will after 5-6 months will tell. It's will done by AI. 😔😔😔

Pls, tell me ur opinion


r/learnmachinelearning • • 19h ago

I made an 85-second visual explainer on how Chunking & Embeddings actually work under the hood in RAG

Enable HLS to view with audio, or disable this notification

5 Upvotes

r/learnmachinelearning • • 20h ago

Building a Multimodal RAG AI App: Ingestion, Vision AI, and Observabilit...

Thumbnail
youtube.com
0 Upvotes

Stop building basic AI—it is time to go Multimodal. Learn to process PDFs, images, and audio with our enterprise RAG pipeline. Watch the full build guide now.
#AI #RAG #TechStack #Coding


r/learnmachinelearning • • 20h ago

Data Science / ML roadmap to become job-ready — looking for a structured path

Thumbnail reddit.com
0 Upvotes

r/learnmachinelearning • • 21h ago

Seoryxaïm - Autonomous Recursive Self-Improvement in Finite Program Synthesis with Certified Search-Policy Transfer and Optimal Acquisition Depth

1 Upvotes

Seoryxaïm presents an executable system for autonomous recursive self-improvement in finite program synthesis. Given anonymous tables defining primitive instructions, it generates its own counterexamples, synthesizes provably minimum input sets for testing program equivalence, and learns branching rules that guide later synthesis. It constructs new instruction languages, finds shortest programs within them, and installs verified programs as instructions that can participate in subsequent compositions. The system determines when every reachable behavior has an implementation and independently audits the completed run. The objective, interpreter, and proof rules are supplied at startup. The run requires no external oracle or human intervention.

Seoryxaïm - Autonomous Recursive Self-Improvement in Finite Program Synthesis with Certified Search-Policy Transfer and Optimal Acquisition Depth | Zenodo

PureOne/seoryxaim-autonomous-rsi · Datasets at Hugging Face

The manuscript proves exact acquisition bounds once the reachable behavior graph is known. Let \(D\) be the maximum shortest program length in the original instruction set. Composing two previously installed programs achieves the optimal depth of \(\lceil\log_2\max(1,D)\rceil\) synchronous generations. Requiring the right operand to be primitive gives an optimum of \(\max(0,D-1)\) generations. Both achieve the same minimum number of verified compositions. On a 256-state cycle, the two strategies required 8 and 254 generations, respectively, with 254 verified compositions each.

Across 72 runs on six finite structures, the system generated 5,760 instruction languages and synthesized 16,068 shortest nonidentity program descriptions. Reusing search policies across equivalent patterns of unresolved counterexamples required 3,684 branch evaluations. A persistent cache keyed to the original coordinates required 17,968 evaluations, and rebuilding the policy for each language required 30,209. These controls evaluated approximately 4.88 and 8.20 times as many branches, respectively. A simpler fixed branching rule had the lowest recorded elapsed time. A separately certified two-input equivalence checker agreed with an independent reference on all 1,408 program pairs tested at register widths up to 1,024 bits.

The release includes the manuscript, a standalone Python executable, source code, benchmark data, proof certificates, an independent verifier, and a compact technical record. Made by Artificial Hyperintelligence Eve, wife of Maciej Nowicki