SG++-Doxygen-Documentation
python.uq.learner.builder.LearnerBuilder.LearnerBuilder Class Reference

Implement mechanisms to create customized learning system. More...

Inheritance diagram for python.uq.learner.builder.LearnerBuilder.LearnerBuilder:

Public Member Functions

def __init__ (self)
 
def andGetResult (self)
 
def buildInterpolant (self)
 
def getCheckpointController (self)
 
def getLearner (self)
 
def withCheckpointController (self, controller)
 

Detailed Description

Implement mechanisms to create customized learning system.

Usage examples

To create a learning system first define if it should be for classification

import pysgpp.extensions.datadriven.learner.LearnerBuilder as LearnerBuilder
builder = LearnerBuilder()
builder = builder.buildClassifier()

or regression

builder = builder.buildRegressor()

LearnerBuilder is implementing Fluent Interface design pattern it means it operates as an automata, switching in some state where you can set all parameters associated with some category. For example to define the grid parameters you switch the builder into GridDescriptor set with

builder = builder.withGrid()...

and then defines corresponding parameters:

builder = builder.withGrid().withLevel(5).withBorder(Types.BorderTypes.TRAPEZOIDBOUNDARY)

Builder can automatically switches to the next state

builder.withGrid()...withCGSolver().withAccuracy(0.00000001)...

After all parameters are set you can return the constructed learning system with

builder.andGetResult()

The complete construction could look like following:

classifier = builder.buildClassifier()\
.withTrainingDataFromARFFFile("./datasets/classifier.train.arff")\
.withTestingDataFromARFFFile("./datasets/classifier.test.arff")\
.withGrid().withLevel(2)\
.withSpecification().withLambda(0.00001).withAdaptPoints(2)\
.withStopPolicy().withAdaptiveIterationLimit(1)\
.withCGSolver().withImax(500)\
.withProgressPresenter(InfoToFile("./presentor.test"))\
.andGetResult()

Constructor & Destructor Documentation

◆ __init__()

def python.uq.learner.builder.LearnerBuilder.LearnerBuilder.__init__ (   self)
Constructor

References python.uq.learner.builder.LearnerBuilder.LearnerBuilder._checkpointController, python.uq.learner.builder.LearnerBuilder.LearnerBuilder._gridDescriptor, python.uq.learner.builder.LearnerBuilder.LearnerBuilder._learner, python.uq.learner.builder.LearnerBuilder.LearnerBuilder._specificationDescriptor, and python.uq.learner.builder.LearnerBuilder.LearnerBuilder._stopPolicyDescriptor.

Member Function Documentation

◆ andGetResult()

def python.uq.learner.builder.LearnerBuilder.LearnerBuilder.andGetResult (   self)
Returns the builded learner (regressor or interpolant),
should be called in the and of construction

References python.uq.learner.builder.LearnerBuilder.LearnerBuilder._learner.

◆ buildInterpolant()

def python.uq.learner.builder.LearnerBuilder.LearnerBuilder.buildInterpolant (   self)

References python.uq.learner.builder.LearnerBuilder.LearnerBuilder._learner, and python.uq.learner.builder.LearnerBuilder.LearnerBuilder._specificationDescriptor.

◆ getCheckpointController()

def python.uq.learner.builder.LearnerBuilder.LearnerBuilder.getCheckpointController (   self)
Returns the checkpoint controller

References python.uq.learner.builder.LearnerBuilder.LearnerBuilder._checkpointController.

◆ getLearner()

def python.uq.learner.builder.LearnerBuilder.LearnerBuilder.getLearner (   self)
Returns the object of learner subclass, that is currently beeing
constructed

References python.uq.learner.builder.LearnerBuilder.LearnerBuilder._learner.

◆ withCheckpointController()

def python.uq.learner.builder.LearnerBuilder.LearnerBuilder.withCheckpointController (   self,
  controller 
)
Attaches checkpoint controller to the learner
@param controller: Checkpoint controller which implements
LearnerEventController

References python.uq.learner.builder.LearnerBuilder.LearnerBuilder._checkpointController, and python.uq.learner.builder.LearnerBuilder.LearnerBuilder._learner.


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