types
Module
The skll.types
module contains custom type aliases that are used throughout
the SKLL code in type hints and docstrings.
Class map that maps new labels (string) to list of old labels (list of string).
Confusion matrix represented by a list of list of integers.
Feature dictionary that maps a string to other dictionaries or other objects.
List of feature dictionaries.
An iterator over two FeatureSets, usually test and train.
Mapping from example ID to fold ID; the example ID may be a float or a string but the fold ID is always a string.
A float or a string; this is useful or SKLL IDs that can be both.
Generator over two numpy
arrays containing indices - usually for train and test
data.
A float, integer, or a string; this is useful for SKLL labels that can be any of them.
Learning curve sizes can either be a numpy
array (or a list) containing
floats or integers.
- skll.types.FeatGenerator
alias of
Generator
[Tuple
[Union
[float
,str
],Optional
[Union
[float
,int
,str
]],Dict
[str
,Any
]],None
,None
]
Generator that yields a 3-tuple containing:
An example ID (float or string).
A label (integer, float, or string).
A feature dictionary.
A string path or Path object.
- skll.types.SparseFeatureMatrix
alias of
csr_matrix
A scipy
sparse matrix to hold SKLL features in FeatureSets.
- skll.types.ComputeEvalMetricsResults
alias of
Tuple
[Optional
[List
[List
[int
]]],Optional
[float
],Dict
[Union
[float
,int
,str
],Any
],Optional
[float
],Dict
[str
,Optional
[float
]]]
Learner evaluate task results 5-tuple containing:
The confusion matrix for a classifier,
None
for a regressor.Accuracy for a classifier,
None
for a regressor.The dictionary of results.
Score for the grid objective,
None
if no grid search was performed.The dictionary of scores for any additional metrics.
- skll.types.EvaluateTaskResults
alias of
Tuple
[Optional
[List
[List
[int
]]],Optional
[float
],Dict
[Union
[float
,int
,str
],Any
],Dict
[str
,Any
],Optional
[float
],Dict
[str
,Optional
[float
]]]
Learner evaluate task results 6-tuple containing:
The confusion matrix for a classifier,
None
for a regressor.Accuracy for a classifier,
None
for a regressor.The dictionary of results.
The dictionary containing the model parameters.
Score for the grid objective, None if no grid search
The dictionary of score for any additional metrics.
- skll.types.CrossValidateTaskResults
alias of
Tuple
[List
[Tuple
[Optional
[List
[List
[int
]]],Optional
[float
],Dict
[Union
[float
,int
,str
],Any
],Dict
[str
,Any
],Optional
[float
],Dict
[str
,Optional
[float
]]]],List
[float
],List
[Dict
[str
,Any
]],Optional
[Dict
[Union
[float
,str
],str
]],Optional
[List
[skll.learner.Learner
]]]
Learner cross-validate task results 5-tuple containing:
The confusion matrix, overall accuracy, per-label precision/recall/F1, model parameters, objective function score, and evaluation metrics (if any) for each fold.
The grid search scores for each fold.
The list of dictionaries of grid search CV results, one per fold, with keys such as “params”, “mean_test_score”, etc, that are mapped to lists of values associated with each combination of hyper-parameters.
The dictionary containing the test-fold number for each,
None
if folds were not saved.The list of learners, one for each fold,
None
if the models were not saved.
- skll.types.VotingCrossValidateTaskResults
alias of
Tuple
[List
[Tuple
[Optional
[List
[List
[int
]]],Optional
[float
],Dict
[Union
[float
,int
,str
],Any
],Dict
[str
,Any
],Optional
[float
],Dict
[str
,Optional
[float
]]]],Optional
[Dict
[Union
[float
,str
],str
]],Optional
[List
[skll.learner.voting.VotingLearner
]]]
Voting Learner cross-validate task results 3-tuple containing:
The confusion matrix, overall accuracy, per-label precision/recall/F1, model parameters, objective function score, and evaluation metrics (if any) for each fold.
The dictionary containing the test-fold number for each,
None
if folds were not saved.The list of voting learners, one for each fold,
None
if the models were not saved.