public class CBR
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected LearningAttributeWeights |
learn
Decides the weights of the attributes for the current execution.
|
protected Retain |
retain
Computes all the steps of the Retain phase of a CBR.
|
protected Review |
review
Evaluates the case base in search of any redundant, innecessary or non
beneficial cases, and drops them if found.
|
protected Revise |
revise
Computes all the steps of the Revise phase of a CBR.
|
protected Population |
test
Test population
|
protected Population |
train
Train population
|
Constructor and Description |
---|
CBR(CBR cbr)
Copy constructor.
|
CBR(Population train,
Population test,
GlobalDistance distancia_global,
Selection seleccio,
Reuse reuse,
Revise revise,
Retain retain,
java.lang.String classe)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
afegeixFiltrat(ContextReasoning f)
Adds a filtering method to this CBR
|
void |
afegeixLearn(LearningAttributeWeights l)
Adds a weights learning method to this CBR
|
void |
afegeixRetain(Retain r)
Adds a retain method to this CBR.
|
void |
afegeixReuse(Reuse r)
Adds a reuse method to this CBR.
|
void |
afegeixReview(Review r)
Adds a review method to this CBR.
|
void |
afegeixRevise(Revise r)
Adds a revise method to this CBR.
|
CBR |
clone()
Creates a clone of this CBR.
|
void |
freeMemory()
Clears the CBR data.
|
java.lang.String |
getClasse()
Method to get the attribute for wich the CBR attempts classification.
|
Classificacio |
getClassification()
Returns the classification of the train cases
|
ClassificacioParametres |
getClassifications()
Returns the parameter classifications of the train cases
|
MatriuDistancies |
getDistanceMatrix()
Returns the computeDistance matrix.
|
java.math.BigDecimal[] |
getGamma()
This method is a remnant of previous attempts to build a MultiAgent CBR
Following its trace it's clear that this method always returns null
|
double |
getGmin(java.lang.String[] timestamps,
java.lang.Double[] CGMsamples)
Function that calculates the minimum glucose value of a given glucose curve
of CGM samples (in mg/dl).
|
java.math.BigDecimal[] |
getPesos()
Method to get the current attribute weights.
|
Retain |
getRetain()
Returns the retain implementation of this CBR
|
Reuse |
getReuse()
Returns the reuse implementation of this CBR
|
Review |
getReview()
Returns the review implementation of this CBR
|
Revise |
getRevise()
Returns the revise implementation of this CBR
|
SeleccioIndividus |
getSeleccioIndividus()
Returns the selected individuals in the retrieve phase
|
Population |
getTest()
Method to get the test population of this CBR
|
Population |
getTrain()
Method to get the train population of this CBR
|
float[] |
getWeights()
Returns the current attribute weights of the train population
|
Attribute[] |
learnWeights()
Attribute weight learning phase.
|
Attribute[] |
learnWeights(CBR cbr,
Attribute[] a)
Attribute weight learning phase.
|
Attribute[] |
learnWeightsCyclic() |
void |
pepperDataNormalization(Population p) |
Population |
retain()
Retain phase of the CBR.
|
Population |
retainPEPPER()
Especific retain for PEPPER project
|
MatriuDistancies |
retrieve()
First of the 4 main steps of a CBR.
|
void |
retrievePepper()
Retrieve method for the PEPPER project.
|
void |
reuse()
Reuse phase of the CBR.
|
void |
reusePepper(double bodyWeight,
double Gsp)
Reuse method for the PEPPER project.
|
Population |
review()
Review phase of the CBR.
|
void |
revise()
Revise phase of the CBR.
|
void |
setTest(Individual test,
Attribute[] attributes)
Sets the test population of this CBR to test and its attributes to attributes
|
void |
setTest(Population test)
Sets the test population of this CBR to test
|
void |
setTrain(Population train)
Sets the train population of this CBR to test
|
void |
setWeights(float[] weights)
Modifies the weights of the train and test population of the CBR
|
protected Population train
protected Population test
protected Revise revise
protected Retain retain
protected Review review
protected LearningAttributeWeights learn
public CBR(Population train, Population test, GlobalDistance distancia_global, Selection seleccio, Reuse reuse, Revise revise, Retain retain, java.lang.String classe)
train
- Population case base.test
- Population cases to decide its class.distancia_global
- Method to computeDistance the global computeDistance between populationsseleccio
- Method to select nearest cases from the test population to the train onereuse
- Method to decide the test individuals' classrevise
- Method to revise and correct the classification made in reuseretain
- Method to add test useful cases to the train case baseclasse
- String defining the attribute for wich a classification is attemptedGlobalDistance
,
Selection
,
Reuse
,
Revise
,
Retain
public CBR(CBR cbr)
cbr
- CBR this will be a copy of.public Population getTest()
public Population getTrain()
public java.math.BigDecimal[] getPesos()
public java.math.BigDecimal[] getGamma()
public java.lang.String getClasse()
public MatriuDistancies getDistanceMatrix()
public SeleccioIndividus getSeleccioIndividus()
public void afegeixFiltrat(ContextReasoning f)
f
- ContextReasoning filtering methodpublic void afegeixReuse(Reuse r)
r
- Reuse implementation of a Reuse methodReuse
public void afegeixRevise(Revise r)
r
- Revise implementation of a Revise methodRevise
public void afegeixRetain(Retain r)
r
- Retain implementation of a Retain method.Retain
public void afegeixReview(Review r)
r
- Review
public void afegeixLearn(LearningAttributeWeights l)
l
- LearningAttributeWeights
public Attribute[] learnWeights(CBR cbr, Attribute[] a)
cbr
- CBR other cbr.a
- Attribute[] array with other cbr attributespublic Attribute[] learnWeights()
public Attribute[] learnWeightsCyclic()
public MatriuDistancies retrieve()
public void retrievePepper()
public double getGmin(java.lang.String[] timestamps, java.lang.Double[] CGMsamples)
timestamps
- timestamps of the CGM samples in the following format "yyyy-MM-dd HH:mm:ss"CGMsamples
- CGM samples of blood glucose in (mg/dl)public void pepperDataNormalization(Population p)
public void reuse()
public void reusePepper(double bodyWeight, double Gsp)
bodyWeight
- Gsp
- public void revise()
public Population retain()
public Population retainPEPPER()
public Population review()
public void freeMemory()
public Classificacio getClassification()
public ClassificacioParametres getClassifications()
public Reuse getReuse()
public Revise getRevise()
public Retain getRetain()
public Review getReview()
public void setWeights(float[] weights)
weights
- public float[] getWeights()
public void setTest(Population test)
test
- Population to be set as this CBR's test populationpublic void setTest(Individual test, Attribute[] attributes)
test
- Population to be set as this CBR's test populationattributes
- Attribute[] attributes of the test populationpublic void setTrain(Population train)
train
- Population to be set as this CBR's train populationpublic CBR clone()
clone
in class java.lang.Object