\Camspiers\StatisticalClassifier\Console\Command\TrainDocumentCommand

Summary

Methods
Properties
Constants
setCache()
No public properties found
No constants found
configure()
getChanges()
execute()
updateSummary()
configureClassifier()
configureModel()
configurePrepare()
getModel()
getDataSource()
cacheDataSource()
getContainer()
getClassifier()
$config
$cache
$container
$classifier
N/A
No private methods found
No private properties found
N/A

Properties

$config

$config : array

Holds the config from the config.json files

Type

array

$cache

$cache : \CacheCache\Cache

Holds the CacheCache\Cache instance

Type

\CacheCache\Cache

$container

$container : \Camspiers\StatisticalClassifier\Console\Command\Symfony\Component\DependencyInjection\ContainerInterface

Holds the container instance for caching

Type

\Camspiers\StatisticalClassifier\Console\Command\Symfony\Component\DependencyInjection\ContainerInterface

Methods

setCache()

setCache(\CacheCache\Cache $cache)

Allow for cache to be stored on command for setter injection

Parameters

\CacheCache\Cache $cache

The cache to store

configure()

configure() : null

Configure the commands options

Returns

null

getChanges()

getChanges(\Symfony\Component\Console\Input\InputInterface $input) : \Camspiers\StatisticalClassifier\DataSource\DataArray

Parameters

\Symfony\Component\Console\Input\InputInterface $input

Returns

\Camspiers\StatisticalClassifier\DataSource\DataArray

execute()

execute(\Symfony\Component\Console\Input\InputInterface $input, \Symfony\Component\Console\Output\OutputInterface $output) : null

Train a classifier with a datasource

Parameters

\Symfony\Component\Console\Input\InputInterface $input

The commands input

\Symfony\Component\Console\Output\OutputInterface $output

The commands output

Returns

null

updateSummary()

updateSummary(\Symfony\Component\Console\Output\OutputInterface $output, \Camspiers\StatisticalClassifier\DataSource\DataSourceInterface $changes, \Camspiers\StatisticalClassifier\DataSource\DataSourceInterface $current) : null

Outputs a summary of what has changes in the model

Parameters

\Symfony\Component\Console\Output\OutputInterface $output

The output object

\Camspiers\StatisticalClassifier\DataSource\DataSourceInterface $changes

The data source with changes

\Camspiers\StatisticalClassifier\DataSource\DataSourceInterface $current

The grouped data source

Returns

null

getModel()

getModel(string $name, bool $svm) : \Camspiers\StatisticalClassifier\Model\CachedModel

Get an CachedModel based off a model name and the Cache instance

Parameters

string $name

The name of the model

bool $svm

Returns

\Camspiers\StatisticalClassifier\Model\CachedModel

The cached model

cacheDataSource()

cacheDataSource(mixed $name)

Parameters

mixed $name

getContainer()

getContainer() : \Camspiers\StatisticalClassifier\Console\Command\Symfony\Component\DependencyInjection\ContainerInterface

Return the dependency injection container fetching it off the app if it doesn't exist

Returns

\Camspiers\StatisticalClassifier\Console\Command\Symfony\Component\DependencyInjection\ContainerInterface —

The container

getClassifier()

getClassifier(\Symfony\Component\Console\Input\InputInterface $input) : \Camspiers\StatisticalClassifier\Classifier\Classifier

Returns a classifier based of the commands input and the specified model (if exists)

Parameters

\Symfony\Component\Console\Input\InputInterface $input

The commands input

Throws

\RuntimeException

Returns

\Camspiers\StatisticalClassifier\Classifier\Classifier

The built classifier