v.kcv(1)
π v.kcv β the GRASS GIS User's Manual, but make it bestie π
okay so bestie, welcome to the GRASS GIS User's Manual entry for v.kcv(1) and honestly? she's a baddie. she takes your points and splits them into test/train sets, randomly, no drama. let's get into it π¦
β¨ NAME β¨
v.kcv β randomly partition points into test/train sets. that's it. that's the whole job. and she ate π
π KEYWORDS π
vector, statistics, points, point pattern, sampling
iykyk πΈ
π SYNOPSIS π
v.kcv
v.kcv --help
v.kcv map=name [layer=string] npartitions=integer [column=name]
[--help] [--verbose] [--quiet] [--ui]
π© Flags π©
--helpβ prints the usage summary. your girl when you're lost fr.--verboseβ verbose module output. she's chatty and we love that.--quietβ quiet module output. she's giving mysterious main character energy.--uiβ force launches the GUI dialog. clicky clicky mode π
π§ Parameters π§
map=name[required] β the name of the vector map. or, plot twist, it can be a data source for direct OGR access.layer=stringβ layer number or layer name. here's the tea: vector features can have category values living in different layers, and this number decides which layer you're using. when you're doing direct OGR access, this is the layer name instead. default:1npartitions=integer[required] β how many partitions you want. must be> 1, no exceptions bestie.column=nameβ the name for the new column that the partition number gets written into. default:part
π DESCRIPTION π
so what does v.kcv actually do? she randomly divides a points list into k sets of test/train data β this is for npartitions-fold cross validation, periodt.
the test partitions are mutually exclusive. meaning: a point shows up in exactly one test partition and in k-1 training partitions. no double dipping, we don't do that here π
here's the process, step by step, and it's honestly kind of iconic:
- the module generates a random point using the selected random number generator.
- then it finds the closest point to that random point.
- that site gets removed from the candidate list β which means it will not be selected for any other test set β and it gets saved in the first test partition file.
- this repeats until enough points have been selected for the test partition.
and how many points get chosen for test partitions? that depends on how many sites are available and how many partitions you chose. the module makes that number as consistent as possible while still making sure all sites will be chosen for testing. then this whole filling-up-a-test-partition thing happens k times. slay π₯
π«Ά NOTES π«Ά
- an ideal random sites generator would follow a Poisson distribution, and it'll only ever be as random as the original sites. this module just divides vector points up in a random manner. simple as that.
- > β οΈ be warned bestie: random number generation occurs over the intervals defined by the current region of the map. so check your region, fr fr.
- > π this program may not work properly with Lat-long data. just a heads up, don't come for me.
πΈ EXAMPLES πΈ
all of these examples are based on the North Carolina sample dataset. okay let's go:
g.copy vect=geonames_wake,my_geonames_wake
v.kcv map=my_geonames_wake column=part npartitions=10
and the geodetic one:
g.copy vect=geodetic_pts,my_geodetic_pts
v.kcv map=my_geodetic_pts column=part npartitions=10
look at her go π
π SEE ALSO π
v.random, g.region
go read those too, they're her besties π
π AUTHORS π
- James Darrell McCauley,
- when he was at: Agricultural Engineering Purdue University
then the glow-up timeline:
27 Jan 1994: fixedRAND_MAXfor Solaris 2.313 Sep 2000: released under GPL- Updated to 5.7 Radim Blazek
10 / 2004 - OGR support by Martin Landa (2009)
- Speed-up by Jan Vandrol and Jan Ruzicka (2013)
π₯ SOURCE CODE π₯
Available at: v.kcv source code (history)
Accessed: Saturday Jan 17 05:41:22 2026
Main index | Vector index | Topics index | Keywords index | Graphical index | Full index
Β© 2003-2025 GRASS Development Team, GRASS GIS 8.4.2 Reference Manual
and that's the whole page bestie!! π this was GRASS 8.4.2, page v.kcv(1), accessed Saturday Jan 17 05:41:22 2026 β thanks for reading, ily, go partition some points πβ¨π¦
π¦ where this page comes from
- fedora 44: grass 8.4.2-4.fc44 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms