Compocyte.core.models.fit_methods

Functions

dataloaders_from_dask(x, y, batch_size, ...)

dataloaders_from_dense(x, y, batch_size, ...)

fit(model, x, y[, standardize_idx])

fit_logreg(model, x, y, **fit_kwargs)

fit_torch(model, x, y[, epochs, batch_size, ...])

fit_trees(model, x, y, **fit_kwargs)

predict(model, x[, threshold, monte_carlo])

predict_logits(model, x)

samples_per_class(y)

set_threads(num_threads, parallelize)

to_categorical(y, num_classes[, dtype])

Simplified from keras to avoid dependency and premature conversion to a Tensor.

Classes

Compocyte.core.models.fit_methods.to_categorical(y, num_classes, dtype='float32')[source]

Simplified from keras to avoid dependency and premature conversion to a Tensor.

class Compocyte.core.models.fit_methods.DaskBatchDataset(X, y)[source]

Bases: IterableDataset

__init__(X, y)[source]
set_epoch(epoch)[source]
Compocyte.core.models.fit_methods.predict_logits(model, x)[source]
Compocyte.core.models.fit_methods.predict(model, x, threshold=-1, monte_carlo=None)[source]
Parameters:

monte_carlo (int)

Compocyte.core.models.fit_methods.samples_per_class(y)[source]
Compocyte.core.models.fit_methods.set_threads(num_threads, parallelize)[source]
Compocyte.core.models.fit_methods.dataloaders_from_dask(x, y, batch_size, num_workers)[source]
Compocyte.core.models.fit_methods.dataloaders_from_dense(x, y, batch_size, num_workers)[source]
Compocyte.core.models.fit_methods.fit_torch(model, x, y, epochs=40, batch_size=64, starting_lr=0.01, max_lr=0.1, momentum=0.5, parallelize=True, num_threads=1, beta=0.8, gamma=2.0, class_balance=True, max_cells=1000000)[source]
Parameters:
Compocyte.core.models.fit_methods.fit_logreg(model, x, y, **fit_kwargs)[source]
Parameters:

model (LogisticRegression)

Compocyte.core.models.fit_methods.fit_trees(model, x, y, **fit_kwargs)[source]
Parameters:

model (BoostedTrees)

Compocyte.core.models.fit_methods.fit(model, x, y, standardize_idx=None, **fit_kwargs)[source]
Parameters:
Returns:

_description_

Return type:

_type_