1.4.0
CCC
 
NeighUnique Class Reference

Unique Neighborhood definition. More...

#include <NeighUnique.hpp>

Inheritance diagram for NeighUnique:
ANeigh ASpaceObject ASerializable AStringable

Detailed Description

Unique 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 Unique Neighborhood selects all the active samples. Nevertheless, it 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

 NeighUnique (bool flag_xvalid=false, const ASpace *space=nullptr)
 
 NeighUnique (const NeighUnique &r)
 
NeighUniqueoperator= (const NeighUnique &r)
 
virtual ~NeighUnique ()
 
virtual void getNeigh (int iech_out, VectorInt &ranks) override
 Interface for ANeigh. More...
 
virtual int getMaxSampleNumber (const Db *db) const override
 
virtual bool hasChanged (int iech_out) const override
 
virtual ENeigh getType () const override
 
virtual String toString (const AStringFormat *strfmt=nullptr) const override
 Interface for AStringable. More...
 
- Public Member Functions inherited from ANeigh
 ANeigh (const ASpace *space=nullptr)
 
 ANeigh (const ANeigh &r)
 
ANeighoperator= (const ANeigh &r)
 
virtual ~ANeigh ()
 
virtual bool isConsistent (const ASpace *space) const override
 ASpaceObject Interface. More...
 
virtual int attach (const Db *dbin, const Db *dbout)
 Interface for ANeigh. More...
 
virtual VectorDouble summary (int iech_out)
 
virtual bool getFlagContinuous () const
 
void select (int iech_out, VectorInt &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 setRankColCok (const VectorInt &rankColCok)
 
void setBallSearch (bool status, int leaf_size=10)
 
void attachBall (double(*dist_function)(const double *x1, const double *x2, int size)=nullptr)
 
- Public Member Functions inherited from ASpaceObject
 ASpaceObject (const ASpace *space=nullptr)
 
 ASpaceObject (const ASpace &space)
 
 ASpaceObject (const ASpaceObject &r)
 
ASpaceObjectoperator= (const ASpaceObject &r)
 
virtual ~ASpaceObject ()
 
const ASpacegetSpace () const
 Accessor to the current object space context. More...
 
bool isConsistent () const
 Indicate if I am consistent with my current space context. More...
 
VectorDouble getUnitaryVector () const
 Return unitary vector for the current space context. More...
 
unsigned int getNDim (int ispace=-1) const
 Shortcuts to ASpace methods. More...
 
const VectorDoublegetOrigin (int ispace=-1) const
 Return the current space context origin coordinates. More...
 
double getDistance (const SpacePoint &p1, const SpacePoint &p2, int ispace=0) const
 Return the distance between two space points for the current space context. More...
 
VectorDouble getDistances (const SpacePoint &p1, const SpacePoint &p2) const
 Return all the distances (space composits) between two space points for the current space context. More...
 
double getDistance1D (const SpacePoint &p1, const SpacePoint &p2, int idim) const
 Return the distance along one direction between two space points. More...
 
VectorDouble getIncrement (const SpacePoint &p1, const SpacePoint &p2, int ispace=0) const
 Return the increment vector between two space points for the current space context. More...
 
- Public Member Functions inherited from AStringable
 AStringable ()
 
 AStringable (const AStringable &r)
 
AStringableoperator= (const AStringable &r)
 
virtual ~AStringable ()
 
virtual void display (const AStringFormat *strfmt=nullptr) const final
 
virtual void display (int level) const final
 
- Public Member Functions inherited from ASerializable
 ASerializable ()
 
 ASerializable (const ASerializable &r)
 
ASerializableoperator= (const ASerializable &r)
 
virtual ~ASerializable ()
 
bool deserialize (std::istream &is, bool verbose=true)
 
bool serialize (std::ostream &os, bool verbose=true) const
 
bool dumpToNF (const String &neutralFilename, bool verbose=false) const
 

Static Public Member Functions

static NeighUniquecreate (bool flag_xvalid=false, const ASpace *space=nullptr)
 
static NeighUniquecreateFromNF (const String &neutralFilename, bool verbose=true)
 
- Static Public Member Functions inherited from ASerializable
static String buildFileName (int status, const String &filename, bool ensureDirExist=false)
 
static String getHomeDirectory (const String &sub="")
 
static String getWorkingDirectory ()
 
static String getTestData (const String &subdir, const String &filename)
 
static String getFileIdentity (const String &filename, bool verbose=false)
 
static void setContainerName (bool useDefault, const String &containerName="", bool verbose=false)
 
static void unsetContainerName ()
 
static void setPrefixName (const String &prefixName)
 
static void unsetPrefixName ()
 
static const StringgetContainerName ()
 
static const StringgetPrefixName ()
 
static bool createDirectory (const String &dir)
 
static String getExecDirectory ()
 
static String getDirectory (const String &path)
 

Constructor & Destructor Documentation

◆ NeighUnique() [1/2]

NeighUnique::NeighUnique ( bool  flag_xvalid = false,
const ASpace space = nullptr 
)

◆ NeighUnique() [2/2]

NeighUnique::NeighUnique ( const NeighUnique r)

◆ ~NeighUnique()

NeighUnique::~NeighUnique ( )
virtual

Member Function Documentation

◆ create()

NeighUnique * NeighUnique::create ( bool  flag_xvalid = false,
const ASpace space = nullptr 
)
static

◆ createFromNF()

NeighUnique * NeighUnique::createFromNF ( const String neutralFilename,
bool  verbose = true 
)
static

Create a NeighUniqueborhood by loading the contents of a Neutral File

Parameters
neutralFilenameName of the Neutral File
verboseVerbose flag
Returns

◆ getMaxSampleNumber()

int NeighUnique::getMaxSampleNumber ( const Db db) const
overridevirtual

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

Parameters
dbPointer to the target Db
Returns

Implements ANeigh.

◆ getNeigh()

void NeighUnique::getNeigh ( int  iech_out,
VectorInt ranks 
)
overridevirtual

Interface for ANeigh.

Select the neighborhood

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

Implements ANeigh.

◆ getType()

virtual ENeigh NeighUnique::getType ( ) const
inlineoverridevirtual

Reimplemented from ANeigh.

◆ hasChanged()

bool NeighUnique::hasChanged ( int  iech_out) const
overridevirtual

Reimplemented from ANeigh.

◆ operator=()

NeighUnique & NeighUnique::operator= ( const NeighUnique r)

◆ toString()

String NeighUnique::toString ( const AStringFormat strfmt = nullptr) const
overridevirtual

Interface for AStringable.

Reimplemented from ASpaceObject.


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