lal.core package¶
Submodules¶
lal.core.model module¶
This is a combination of the weighting methodology and the matching methodology.
The feature weights are used to scale the training and testing features, and then used to help the matching algorithm which samples are closest to each other based on which one is more important to predict a particular value.
-
class
lal.core.model.
LALGBClassifier
(**kwargs)¶ Bases:
lal.core.model._LALGBBaseModel
This is when our training labels are categorical.
-
predict
(**kwargs)¶ We choose most probable label our samples in the testing dataset has.
- Parameters
train_data (numpy.array) – The training dataset features
train_labels (numpy.array) – The training dataset labels
test_data (numpy.array) – The testing dataset features
- Returns
-
predict_proba
(**kwargs)¶ This predicts the probability of our test data having any of the available labels in the training dataset
- Parameters
train_data (numpy.array) – The training dataset features
train_labels (numpy.array) – The training dataset labels
test_data (numpy.array) – The testing dataset features
- Returns
-
-
class
lal.core.model.
LALGBRegressor
(**kwargs)¶ Bases:
lal.core.model._LALGBBaseModel
This is when our training labels are continuous.
-
predict
(**kwargs)¶ We predict the possible value our testing dataset will have, based on the continuous variables.
- Parameters
train_data (numpy.array) – The training dataset features
train_labels (numpy.array) – The training dataset labels
test_data (numpy.array) – The testing dataset features
- Returns
-
lal.core.nn module¶
This matching methodology and the distance measure calculations exist here. Please consider the remaining code base to learn more about which algorithms are available.
-
class
lal.core.nn.
EMDCosineMatcher
(training_weights, testing_weights, thrsh)¶ Bases:
lal.core.nn._CosineDistance
,lal.core.nn._EMDMatcher
This is the Earth Mover Distance Matching algorithm with the cosine distance measure.
-
class
lal.core.nn.
EMDMahalanobisMatcher
(training_weights, testing_weights, thrsh)¶ Bases:
lal.core.nn._MahalanobisDistance
,lal.core.nn._EMDMatcher
This is the Earth Mover Distance Matching algorithm with the mahalanobis distance measure.
-
class
lal.core.nn.
EMDPowerMatcher
(p, training_weights, testing_weights, thrsh)¶ Bases:
lal.core.nn._PowerDistance
,lal.core.nn._EMDMatcher
This is the Earth Mover Distance Matching algorithm with the p-norm distance measure.
-
class
lal.core.nn.
KNNCosineMatcher
(k)¶ Bases:
lal.core.nn._CosineDistance
,lal.core.nn._KNNBase
This is the K-Nearest Neighbor algorithm with the cosine distance measure.
-
class
lal.core.nn.
KNNMahalanobisMatcher
(k)¶ Bases:
lal.core.nn._MahalanobisDistance
,lal.core.nn._KNNBase
This is the K-Nearest Neighbor algorithm with the mahalanobis distance measure.
-
class
lal.core.nn.
KNNPowerMatcher
(k, p)¶ Bases:
lal.core.nn._PowerDistance
,lal.core.nn._KNNBase
This is the K-Nearest Neighbor algorithm with the p-norm distance measure.
-
class
lal.core.nn.
NNLinearSumCosineMatcher
¶ Bases:
lal.core.nn._CosineDistance
,lal.core.nn._NNLinearSumBase
This is the Exhaustive-Hungarian Matching algorithm with the cosine distance measure.
-
class
lal.core.nn.
NNLinearSumMahalanobisMatcher
¶ Bases:
lal.core.nn._MahalanobisDistance
,lal.core.nn._NNLinearSumBase
This is the Exhaustive-Hungarian Matching algorithm with the mahalanobis distance measure.
-
class
lal.core.nn.
NNLinearSumPowerMatcher
(p)¶ Bases:
lal.core.nn._PowerDistance
,lal.core.nn._NNLinearSumBase
This is the Exhaustive-Hungarian Matching algorithm with the p-norm distance measure.
lal.core.weights module¶
Given the type of regression task, we decide the optimal parameters for the base learner, by default is the Xgboost mode, and then use the feature importance to devise feature weights for each feature in the training set.
-
class
lal.core.weights.
GBMClassifierWeight
¶ Bases:
lal.core.weights._GBMWeightsBase
This is for our classification-task
-
class
lal.core.weights.
GBMRegressorWeight
¶ Bases:
lal.core.weights._GBMWeightsBase
This is for our regression-task.