traveltimes_prediction.models.algorithms package¶
Submodules¶
traveltimes_prediction.models.algorithms.dbscan_wrapper module¶
-
class
traveltimes_prediction.models.algorithms.dbscan_wrapper.
DBScanWrapper
(eps=0.5, min_samples=5, metric='euclidean', algorithm='auto', leaf_size=30, p=None, n_jobs=1)[source]¶ Bases:
traveltimes_prediction.models.base_model.BaseModel
,sklearn.cluster.dbscan_.DBSCAN
Class-wrapper for DBSCAN - allowing to predict the cluster of given sample.
-
dump
()[source]¶ Method for dumping of the important features of algorithm allowing to reconstruct it.
Returns: dict - important features are values in dict with corresponding keys
-
fit
(X, y=None, sample_weight=None)[source]¶ Fit method for retrieving the cluster labels. The predictor of clusters` labels is fitted here too.
Parameters: - X (np.ndarray) – features matrix -> SxF
- y (np.ndarray) – true values vector -> S
- sample_weight –
Returns: self
-
static
load
(dumped_model)[source]¶ Method for loading (setting) the clusterizer from dumped dict.
Parameters: dumped_model (dict) – Returns: self
-
name
= 'DBSCAN'¶
-
traveltimes_prediction.models.algorithms.elastic_net_wrapper module¶
-
class
traveltimes_prediction.models.algorithms.elastic_net_wrapper.
ElasticNetWrapper
(**kwargs)[source]¶ Bases:
sklearn.linear_model.coordinate_descent.ElasticNet
,traveltimes_prediction.models.base_model.BaseModel
Class - wrapper for ElasticNet.
-
dump
()[source]¶ Method for dumping of the model providing descriptors of model in dict.
Returns: dict
-
fit
(X, y, sample_weigth=None)[source]¶ Method for fitting of the estimator.
Parameters: - X (numpy.ndarray) – Matrix of input features.
- y (numpy.ndarray) – Vector of ground truths for X.
- sample_weigth (numpy.ndarray) –
Returns: object - self
-
static
load
(model)[source]¶ Method for loading of the model - recreating it from dumped dict.
Parameters: model (dict) – dumped model Returns: ElasticNetWrapper
-
name
= 'ElasticNet'¶
-
traveltimes_prediction.models.algorithms.linear_regression_wrapper module¶
-
class
traveltimes_prediction.models.algorithms.linear_regression_wrapper.
LinearRegressionWrapper
(**kwargs)[source]¶ Bases:
sklearn.linear_model.base.LinearRegression
,traveltimes_prediction.models.base_model.BaseModel
Class - wrapper for LinearRegression.
-
fit
(X, y, sample_weight=None)[source]¶ Method for fitting of the estimator.
Parameters: - X (numpy.ndarray) –
- y (numpy.ndarray) –
- sample_weight (numpy.ndarray) –
Returns:
-
static
load
(model)[source]¶ Method for recreating model from dumped data.
Parameters: model (dict) – Returns: LinearRegressionWrapper
-
name
= 'LinearRegression'¶
-
traveltimes_prediction.models.algorithms.mbkmeans_wrapper module¶
-
class
traveltimes_prediction.models.algorithms.mbkmeans_wrapper.
MBKMeansWrapper
(**kwargs)[source]¶ Bases:
sklearn.cluster.k_means_.MiniBatchKMeans
Class wrapper for MiniBatchKMeans.
-
fit
(X, y=None)[source]¶ Method for fitting of the model.
Parameters: - X (numpy.ndarray) –
- y (numpy.ndarray) –
Returns: object - self
-
static
load
(model)[source]¶ Method for the loading - recreating of the dumped model.
Parameters: model (dict) – Returns: MBKMeans
-
name
= 'MBKMeans'¶
-
traveltimes_prediction.models.algorithms.ridge_wrapper module¶
-
class
traveltimes_prediction.models.algorithms.ridge_wrapper.
RidgeWrapper
(**kwargs)[source]¶ Bases:
sklearn.linear_model.ridge.Ridge
,traveltimes_prediction.models.base_model.BaseModel
Class - wrapper for RidgeRegression.
-
fit
(X, y, sample_weight=None)[source]¶ Method for prediction.
Parameters: - X (numpy.ndarray) –
- y (numpy.ndarray) –
- sample_weight (numpy.ndarray) –
Returns: object - self
-
static
load
(model)[source]¶ Method for loading of the estimator - recreating it from dumped dict.
Parameters: model (dict) – Returns: instance of RidgeWrapper
-
name
= 'Ridge'¶
-
traveltimes_prediction.models.algorithms.svr_wrapper module¶
-
class
traveltimes_prediction.models.algorithms.svr_wrapper.
SVRWrapper
(**kwargs)[source]¶ Bases:
traveltimes_prediction.models.base_model.BaseModel
,sklearn.svm.classes.SVR
Class - wrapper for SVR.
-
fit
(X, y, sample_weight=None)[source]¶ Method for fitting of the estimator.
Parameters: - X (numpy.ndarray) –
- y (numpy.ndarray) –
- sample_weight (numpy.ndarray) –
Returns: object - self
-
static
load
(model)[source]¶ Method for loading of the already dumped model - recreating it.
Parameters: model (dict) – Returns: instance of SVRWrapper
-
name
= 'SVR'¶
-