SShortSingh.
Back to feed

Why a Single Train/Test Split Can Mislead Your ML Model's Accuracy

0
·1 views

A single 80/20 data split can produce misleading accuracy scores because the result depends heavily on which data points land in the test set. Cross-validation addresses this by dividing data into k equal folds, training the model k times, and validating on a different fold each round. This ensures every data point is used for both training and validation, producing a more reliable mean accuracy with a standard deviation. Best practices include fitting preprocessors inside each fold to prevent data leakage, stratifying splits for imbalanced datasets, and preserving a separate final test set untouched during tuning. The trade-off is k times the computational cost, but the payoff is a statistically honest performance estimate.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Developer builds ruleset to strip AI writing patterns from AI-generated text

A developer published a post on DEV Community describing a tool called Alchemy, a Markdown-based ruleset designed to remove telltale AI writing patterns from AI-generated content. The tool targets recurring signals such as em-dash overuse, filler phrases like 'in today's fast-paced digital landscape,' and words like 'delve' and 'robust' that research shows spiked sharply in frequency after ChatGPT's release. Its design draws on empirical sources, including a 2025 study by Kobak et al. finding 'delve' appeared at roughly 28 times its pre-ChatGPT rate in biomedical papers, and Pangram Labs data on inflated phrase frequencies. Alchemy works by flagging density of co-occurring tics rather than penalising any single word, and integrates with AI coding agents via a single init command. The tool is MIT-licensed and available on GitHub for anyone to read or adapt.

0
ProgrammingDEV Community ·

Browser Security Model Explained: SOP, CORS, XSS, CSRF and How They Work Together

Modern web browsers operate as hostile execution environments where untrusted code from one tab can sit dangerously close to sensitive user sessions in another. The browser's security model — built around policies like Same-Origin Policy (SOP) and Cross-Origin Resource Sharing (CORS) — was designed to counter threats such as session hijacking, cross-site scripting, and cross-site request forgery. SOP restricts how scripts from one origin can interact with resources from another, defined by a combination of protocol, host, and port, though it blocks reading responses rather than sending requests, which is why CSRF attacks remain possible. CORS allows servers to deliberately opt in to cross-origin access via HTTP headers, but a common misconfiguration — reflecting any incoming Origin header back without validation alongside credentials — can completely bypass SOP and expose authenticated data. Understanding these security boundaries is considered essential for developers, as attackers routinely exploit gaps in their implementation to steal user data or hijack sessions.

0
ProgrammingDEV Community ·

Codename One Ships Native Linux App as a Single 5MB Binary for x64 and ARM

Codename One, an open-source framework for building cross-platform apps from Java or Kotlin, has released a native Linux desktop port that compiles to a single self-contained ELF binary. The framework's ParparVM tool translates Java and Kotlin bytecode to C, which is then compiled into a native binary requiring no JVM on the user's machine. The Linux port relies on widely available system libraries including GTK3, Cairo, Pango, GStreamer, and WebKitGTK, covering graphics, media, networking, and browser functionality. To ensure broad compatibility, binaries are compiled against glibc 2.17 from 2013, allowing them to run on virtually any mainstream Linux desktop. The optimized build strips unused code, keeping a typical app around 5MB while launching faster than many native GNOME applications.

0
ProgrammingDEV Community ·

Developer runs modern LLMs on a 2013 GTX 770 with a five-byte firmware patch

A developer has demonstrated that NVIDIA's Kepler-generation GTX 770, officially abandoned by NVIDIA after driver version 470.256.02, can still run modern large language model inference workloads on Linux kernel 7.x. Two core obstacles were overcome: the legacy driver source code failed to compile against kernels 6.15 and above due to removed APIs, and the CUDA initialization routine returned an error caused by a hardcoded version check inside the proprietary libcuda.so library. Community-sourced kernel patches resolved the compilation issues, while a targeted five-byte binary patch to the shared library bypassed the version mismatch that blocked CUDA from initializing. Additional changes to llama.cpp source code and the use of CUDA 10.2 tooling with Clang allowed the project to build and run successfully on the GPU's older sm_30 architecture. Benchmark results showed the GTX 770 delivering roughly 1.8 times faster prompt processing compared to CPU-only inference, with the project framed as both an e-waste reduction effort and a practical exercise in low-level systems engineering.

Why a Single Train/Test Split Can Mislead Your ML Model's Accuracy · ShortSingh