1.8.0
CCC
 
Loading...
Searching...
No Matches
gstlrn::NeighMoving Class Reference

Moving Neighborhood definition. More...

#include <NeighMoving.hpp>

Inheritance diagram for gstlrn::NeighMoving:
gstlrn::ANeigh gstlrn::ASpaceObject gstlrn::ASerializable gstlrn::ICloneable gstlrn::AStringable

Detailed Description

Moving Neighborhood definition.

The Neighborhood is usually meant to select a sub-population from the input Data Base, containing the active samples close to the target.

The Moving Neighborhood selects these active samples based on a series of criteria (the corresponding parameters are given between parentheses), such as:

  • the selected samples should belong to a circle (ellipse) centered on the target sample (circle radius, ellipse orientation and extensions)
  • the minimum and maximum number of selected samples
  • the previous circle can be subdivided into angular sectors: the selected samples are taken regularly per sector (maximum number of samples per sector)

The neighborhood also offers the possibility to suppress any sample which would be too close to (or coincide with) the target: this is the cross-validation option.

Public Member Functions

 NeighMoving (bool flag_xvalid=false, Id nmaxi=1000, double radius=TEST, Id nmini=1, Id nsect=1, Id nsmax=ITEST, const 1 &coeffs=1(), const 1 &angles=1(), bool useBallTree=false, Id leaf_size=10, const ASpaceSharedPtr &space=ASpaceSharedPtr())
 
 NeighMoving (const NeighMoving &r)
 
NeighMovingoperator= (const NeighMoving &r)
 
virtual ~NeighMoving ()
 
Id attach (const Db *dbin, const Db *dbout=nullptr) override
 Interface for ANeigh.
 
void getNeigh (Id iech_out, 1 &ranks) override
 
bool hasChanged (Id iech_out) const override
 
 summary (Id iech_out) override
 
Id getNSampleMax (const Db *db) const override
 
ENeigh getType () const override
 
bool getFlagContinuous () const override
 
String toString (const AStringFormat *strfmt=nullptr) const override
 Interface for AStringable.
 
void addBiTargetCheck (ABiTargetCheck *abpc)
 
bool getFlagSector () const
 
Id getNMaxi () const
 
Id getNMini () const
 
Id getNSect () const
 
Id getNSMax () const
 
double getDistCont () const
 
const BiTargetCheckDistancegetBiPtDist () const
 
bool getFlagAniso () const
 
bool getFlagRotation () const
 
double getRadius () const
 
const & getAnisoRotMats () const
 
const & getAnisoCoeffs () const
 
double getAnisoCoeff (Id i) const
 
const std::vector< ABiTargetCheck * > & getBipts () const
 
const ABiTargetCheckgetBipts (Id rank) const
 
void setNMaxi (Id nmaxi)
 
void setNMini (Id nmini)
 
void setNSect (Id nsect)
 
void setNSMax (Id nsmax)
 
void setDistCont (double distCont)
 
 getEllipsoid (const 1 &target, Id count=360) const
 
 getSectors (const 1 &target) const
 
 getZoomLimits (const 1 &target, double percent=20) const
 
- Public Member Functions inherited from gstlrn::ANeigh
 ANeigh (const ASpaceSharedPtr &space=ASpaceSharedPtr())
 
 ANeigh (const ANeigh &r)
 
ANeighoperator= (const ANeigh &r)
 
virtual ~ANeigh ()
 
bool isConsistent (const ASpace *space) const override
 ASpaceObject Interface.
 
void displayDebug (1 &ranks) const
 
void select (Id iech_out, 1 &ranks)
 
bool isUnchanged () const
 
void setIsChanged (bool status=false)
 
void reset ()
 
bool getFlagXvalid () const
 
bool getFlagKFold () const
 
void setFlagXvalid (bool flagXvalid)
 
void setFlagKFold (bool flagKFold)
 
void setFlagSimu (bool flagSimu)
 
void setBallSearch (bool status, Id leaf_size=10)
 
void attachBall ()
 
- Public Member Functions inherited from gstlrn::ASpaceObject
 ASpaceObject (const ASpaceSharedPtr &space=ASpaceSharedPtr())
 
 ASpaceObject (const ASpaceObject &r)
 
ASpaceObjectoperator= (const ASpaceObject &r)
 
virtual ~ASpaceObject ()
 
ASpaceSharedPtr getSpace () const
 Accessor to the current object space context.
 
bool isConsistent () const
 Indicate if I am consistent with my current space context.
 
void setSpace (ASpaceSharedPtr &&space)
 
 getUnitaryVector () const
 Return unitary vector for the current space context.
 
bool isConsistent (const ASpaceSharedPtr &space) const
 Indicate if I am consistent with the provided space.
 
size_t getNDim (Id ispace=-1) const
 Shortcuts to ASpace methods.
 
const & getOrigin (Id ispace=-1) const
 Return the current space context origin coordinates.
 
double getDistance (const SpacePoint &p1, const SpacePoint &p2, Id ispace=0) const
 Return the distance between two space points for the current space context.
 
 getDistances (const SpacePoint &p1, const SpacePoint &p2) const
 Return all the distances (space composits) between two space points for the current space context.
 
 getIncrement (const SpacePoint &p1, const SpacePoint &p2, Id ispace=0) const
 Return the increment vector between two space points for the current space context.
 
void getIncrementInPlace (const SpacePoint &p1, const SpacePoint &p2, 1 &ptemp, Id ispace=-1) const
 
- Public Member Functions inherited from gstlrn::AStringable
 AStringable ()
 
 AStringable (const AStringable &r)
 
AStringableoperator= (const AStringable &r)
 
virtual ~AStringable ()
 
virtual void display (const AStringFormat *strfmt=nullptr) const final
 
virtual void display (Id level) const final
 
- Public Member Functions inherited from gstlrn::ASerializable
 ASerializable ()
 
 ASerializable (const ASerializable &r)
 
ASerializableoperator= (const ASerializable &r)
 
 ASerializable (ASerializable &&r) noexcept
 
ASerializableoperator= (ASerializable &&r) noexcept
 
virtual ~ASerializable ()
 
bool dumpToNF (const String &NFFilename, const EFormatNF &format=EFormatNF::fromKey("DEFAULT"), bool verbose=false) const
 Dump the contents of an object into an Output File using a given Output NF Format.
 
void setDefaultFormatNF (const EFormatNF &format)
 
- Public Member Functions inherited from gstlrn::ICloneable
 ICloneable ()
 
virtual ~ICloneable ()
 
virtual ICloneableclone () const =0
 
std::shared_ptr< ICloneablecloneShared () const
 
std::unique_ptr< ICloneablecloneUnique () const
 

Static Public Member Functions

static NeighMovingcreate (bool flag_xvalid=false, Id nmaxi=1000, double radius=TEST, Id nmini=1, Id nsect=1, Id nsmax=ITEST, const 1 &coeffs=1(), const 1 &angles=1(), bool useBallTree=false, Id leaf_size=10, const ASpaceSharedPtr &space=ASpaceSharedPtr())
 
static NeighMovingcreateFromNF (const String &NFFilename, bool verbose=true)
 
- Static Public Member Functions inherited from gstlrn::ASerializable
static String buildFileName (Id status, const String &filename, bool ensureDirExist=false)
 
static String getFileIdentity (const String &filename, bool verbose=false)
 
static void setPrefixName (const String &prefixName)
 
static void unsetPrefixName ()
 
static const StringgetPrefixName ()
 

Constructor & Destructor Documentation

◆ NeighMoving() [1/2]

gstlrn::NeighMoving::NeighMoving ( bool  flag_xvalid = false,
Id  nmaxi = 1000,
double  radius = TEST,
Id  nmini = 1,
Id  nsect = 1,
Id  nsmax = ITEST,
const 1 &  coeffs = 1(),
const 1 &  angles = 1(),
bool  useBallTree = false,
Id  leaf_size = 10,
const ASpaceSharedPtr space = ASpaceSharedPtr() 
)

◆ NeighMoving() [2/2]

gstlrn::NeighMoving::NeighMoving ( const NeighMoving r)

◆ ~NeighMoving()

gstlrn::NeighMoving::~NeighMoving ( )
virtual

Member Function Documentation

◆ addBiTargetCheck()

void gstlrn::NeighMoving::addBiTargetCheck ( ABiTargetCheck abpc)

◆ attach()

Id gstlrn::NeighMoving::attach ( const Db dbin,
const Db dbout = nullptr 
)
overridevirtual

Interface for ANeigh.

Initialize the neighborhood search

Parameters
[in]dbininput Db structure
[in]dboutoutput Db structure (optional)

Reimplemented from gstlrn::ANeigh.

◆ create()

NeighMoving * gstlrn::NeighMoving::create ( bool  flag_xvalid = false,
Id  nmaxi = 1000,
double  radius = TEST,
Id  nmini = 1,
Id  nsect = 1,
Id  nsmax = ITEST,
const 1 &  coeffs = 1(),
const 1 &  angles = 1(),
bool  useBallTree = false,
Id  leaf_size = 10,
const ASpaceSharedPtr space = ASpaceSharedPtr() 
)
static

◆ createFromNF()

NeighMoving * gstlrn::NeighMoving::createFromNF ( const String NFFilename,
bool  verbose = true 
)
static

Create a NeighMovingborhood by loading the contents of a Neutral File

Parameters
NFFilenameName of the Neutral File
verboseVerbose flag
Returns

◆ getAnisoCoeff()

double gstlrn::NeighMoving::getAnisoCoeff ( Id  i) const
inline

◆ getAnisoCoeffs()

const & gstlrn::NeighMoving::getAnisoCoeffs ( ) const
inline

◆ getAnisoRotMats()

const & gstlrn::NeighMoving::getAnisoRotMats ( ) const
inline

◆ getBiPtDist()

const BiTargetCheckDistance * gstlrn::NeighMoving::getBiPtDist ( ) const
inline

◆ getBipts() [1/2]

const std::vector< ABiTargetCheck * > & gstlrn::NeighMoving::getBipts ( ) const
inline

◆ getBipts() [2/2]

const ABiTargetCheck * gstlrn::NeighMoving::getBipts ( Id  rank) const
inline

◆ getDistCont()

double gstlrn::NeighMoving::getDistCont ( ) const
inline

◆ getEllipsoid()

gstlrn::NeighMoving::getEllipsoid ( const 1 &  target,
Id  count = 360 
) const

◆ getFlagAniso()

bool gstlrn::NeighMoving::getFlagAniso ( ) const
inline

◆ getFlagContinuous()

bool gstlrn::NeighMoving::getFlagContinuous ( ) const
inlineoverridevirtual

Reimplemented from gstlrn::ANeigh.

◆ getFlagRotation()

bool gstlrn::NeighMoving::getFlagRotation ( ) const
inline

◆ getFlagSector()

bool gstlrn::NeighMoving::getFlagSector ( ) const

◆ getNeigh()

void gstlrn::NeighMoving::getNeigh ( Id  iech_out,
1 &  ranks 
)
overridevirtual

Select the neighborhood

Parameters
iech_outValid Rank of the sample in the output Db
ranksVector of sample ranks in neighborhood (empty when error)

Implements gstlrn::ANeigh.

◆ getNMaxi()

Id gstlrn::NeighMoving::getNMaxi ( ) const
inline

◆ getNMini()

Id gstlrn::NeighMoving::getNMini ( ) const
inline

◆ getNSampleMax()

Id gstlrn::NeighMoving::getNSampleMax ( const Db db) const
overridevirtual

Given a Db, returns the maximum number of samples per NeighMovingborhood

Parameters
dbPointer to the target Db
Returns

Implements gstlrn::ANeigh.

◆ getNSect()

Id gstlrn::NeighMoving::getNSect ( ) const
inline

◆ getNSMax()

Id gstlrn::NeighMoving::getNSMax ( ) const
inline

◆ getRadius()

double gstlrn::NeighMoving::getRadius ( ) const
inline

◆ getSectors()

gstlrn::NeighMoving::getSectors ( const 1 &  target) const

Generate the end-points of the sectors. By default, the extension is set to radius

Parameters
targetCoordinates of the Target
Returns

◆ getType()

ENeigh gstlrn::NeighMoving::getType ( ) const
inlineoverridevirtual

Reimplemented from gstlrn::ANeigh.

◆ getZoomLimits()

gstlrn::NeighMoving::getZoomLimits ( const 1 &  target,
double  percent = 20 
) const

◆ hasChanged()

bool gstlrn::NeighMoving::hasChanged ( Id  iech_out) const
overridevirtual

Reimplemented from gstlrn::ANeigh.

◆ operator=()

NeighMoving & gstlrn::NeighMoving::operator= ( const NeighMoving r)

◆ setDistCont()

void gstlrn::NeighMoving::setDistCont ( double  distCont)
inline

◆ setNMaxi()

void gstlrn::NeighMoving::setNMaxi ( Id  nmaxi)
inline

◆ setNMini()

void gstlrn::NeighMoving::setNMini ( Id  nmini)
inline

◆ setNSect()

void gstlrn::NeighMoving::setNSect ( Id  nsect)
inline

◆ setNSMax()

void gstlrn::NeighMoving::setNSMax ( Id  nsmax)
inline

◆ summary()

gstlrn::NeighMoving::summary ( Id  iech_out)
overridevirtual

Returns the main Neighborhood Parameters for a given target as a vector:

  • 0 : Number of active samples
  • 1 : Minimum distance
  • 2 : Maximum distance
  • 3 : Number of non-empty sectors
  • 4 : Number of consecutive empty sectors
Parameters
[in]iech_outValid Rank of the sample in the output Db

Reimplemented from gstlrn::ANeigh.

◆ toString()

String gstlrn::NeighMoving::toString ( const AStringFormat strfmt = nullptr) const
overridevirtual

Interface for AStringable.

Reimplemented from gstlrn::ASpaceObject.


The documentation for this class was generated from the following files: