SG++-Doxygen-Documentation
Loading...
Searching...
No Matches
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

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

Protected Attributes

 _checkpointController
 
 _gridDescriptor
 
 _learner
 
 _specificationDescriptor
 
 _stopPolicyDescriptor
 

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__()

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

Member Function Documentation

◆ andGetResult()

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, and python.uq.learner.builder.SimulationLearnerBuilder.SimulationLearnerBuilder._learner.

◆ buildInterpolant()

◆ getCheckpointController()

python.uq.learner.builder.LearnerBuilder.LearnerBuilder.getCheckpointController (   self)

◆ getLearner()

python.uq.learner.builder.LearnerBuilder.LearnerBuilder.getLearner (   self)

◆ withCheckpointController()

python.uq.learner.builder.LearnerBuilder.LearnerBuilder.withCheckpointController (   self,
  controller 
)

Member Data Documentation

◆ _checkpointController

python.uq.learner.builder.LearnerBuilder.LearnerBuilder._checkpointController
protected

◆ _gridDescriptor

python.uq.learner.builder.LearnerBuilder.LearnerBuilder._gridDescriptor
protected

◆ _learner

◆ _specificationDescriptor

python.uq.learner.builder.LearnerBuilder.LearnerBuilder._specificationDescriptor
protected

◆ _stopPolicyDescriptor

python.uq.learner.builder.LearnerBuilder.LearnerBuilder._stopPolicyDescriptor
protected

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