type_gneighborfinder.html

来自「一个由Mike Gashler完成的机器学习方面的includes neural」· HTML 代码 · 共 50 行

HTML
50
字号
<html><head><title>Generated Documentation</title></head><body>	<image src="headerimage.png">	<br><br><table><tr><td><big><big><big style="font-family: arial;"><b>GNeighborFinder</b></big></big></big><br><br></td><td> This finds the k-nearest neighbors of a point in Euclidean space. It divides the data with a kd-tree until every hyper-rectangle contains at most a maximum number of points. Each hyper-rectangle is linked to its immediate neighbors in each dimension. It searches outward using these links to efficiently find the nearest neighbors. It doesn't stop until it has searched a hyper-volume large enough to guarantee that it has found the k nearest neighbors.</td></tr></table><br><br><big><big><i>Statics (public)</i></big></big><br><div style="margin-left: 40px;">void <big><b>Test</b></big>()<br></div><br><big><big><i>Constructors (public)</i></big></big><br><div style="margin-left: 40px;"><big><b>GNeighborFinder</b></big>(<a href="type_GArffRelation.html">GArffRelation</a>* pRelation, <a href="type_GArffData.html">GArffData</a>* pData, int nMaxPointsPerLeaf)<br><div style="margin-left: 80px;"><font color=brown> This instance will use pData to hold the vectors. (So if you call AddVector, the new vector will be added to pData.) But it doesn't take ownership of pData. You are still responsible to delete it after you delete this GNeighborFinder. nMaxPointsPerLeaf tells how many vectors are contained by each hyper-rectangle before it is divided. (Experimental results are still needed to determine how to select this value. If it's too small, the algorithm will waste time with empty hyper-rectangles. If it's too big, the algorithm will waste time examining unnecessary data points. Perhaps the number of neighbors might be a good value.)</font></div><br></div><br><big><big><i>Destructors</i></big></big><br><div style="margin-left: 40px;"><big><b>~GNeighborFinder</b></big>()<br></div><br><big><big><i>Public</i></big></big><br><div style="margin-left: 40px;">void <big><b>AddVector</b></big>(double* pVector)<br><div style="margin-left: 80px;"><font color=brown> Add a reference-to-pVector to the GArffData collection that was passed in to the constructor, and indexes it in the kd-tree.</font></div><br>double <big><b>DropVector</b></big>(int* nIndex)<br><div style="margin-left: 80px;"><font color=brown> Drops a vector from the known instances. You are responsible to delete[] the vector that this returns.</font></div><br>void <big><b>FindNeighbors</b></big>(int* pOutNeighbors, double* pOutSquaredDistances, int nNeighbors, double* pVector, int nExclude)<br><div style="margin-left: 80px;"><font color=brown> pOutNeighbors and pOutSquaredDistances should both be arrays of size nNeighbors. When it returns, these arrays will hold the indexes into the data set of the nearest neighbors, and the squared distances respectively. nExclude is an index that you don't want to get in the results. For example, if you are passing in a vector from the data set, you may wish to exclude its index because you already know it's close to itself. If you don't wish to exclude any indexes, just set nExclude to -1. If there are not enough points in the data set to fill the neighbor array, the empty ones will be set to -1.</font></div><br></div><br><big><big><i>Protected</i></big></big><br><div style="margin-left: 40px;">GNeighborFinderLeaf* <big><b>FindCell</b></big>(double* pVector)<br><div style="margin-left: 80px;"><font color=brown> Returns the leaf hyper-rectangle that would contain the specified vector</font></div><br>void <big><b>GetNeighborsFromCell</b></big>(GNeighborFinderLeaf* pCell, double* pVector, int* pOutNeighbors, double* pOutSquaredDistances, int nNeighbors, int* pnWorstNeighbor, int nExclude)<br>void <big><b>InsertVector</b></big>(double* pVector, int nIndex)<br><div style="margin-left: 80px;"><font color=brown> Adds a new vector to the kd-tree. pVector must already be added to m_pData, and nIndex must be the index in m_pData to the vector.</font></div><br>void <big><b>Split</b></big>(int nDimension, double dPivot)<br><div style="margin-left: 80px;"><font color=brown> Splits all affected hyper-rectangles at the specified location</font></div><br></div><br></body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?