Analysis
Details for performing analysis with Nylon.
All analysis techniques can be specified under the analysis keyword in your specifications file. If the analysis tag is not provided in the specifications file, both cross-validation and accuracy score will be calculated on your model.
1
"analysis": {
2
"type":"cross-val"
3
}
Copied!

Analysis Vocabulary

​Cross Validation​

cross-val: Performs cross validation on the training dataset and returns each folds performance. You can modify the number of folds with the spec parameter. The default number is 5.
1
"analysis": {
2
"type":"cross-val"
3
"spec": 5
4
}
Copied!

​Accuracy Score​

acc-score: Accuracy classification score on the testing set. Note that the set of labels predicted for a sample must exactly match the corresponding set of labels in y_true.
​Confusion Matrix​
confusion: Compute confusion matrix to evaluate the accuracy of a classification.
​Precision & Recall​
pr: Calculates the precision and recall on the testing dataset. Both of these metrics are a measure of success of prediction when the classes are very imbalanced.

Custom Analysis

Finally, custom analysis functions are also supported. They should take in four parameters in this order:
Parameter
Description
JSON File
Paraglide's specifications file
Pandas DataFrame
Your training dataset
Scikit-Learn Model
Fitted model you want to analyze
Label Data
Label data for testing.

Example

1
"analysis" :
2
{
3
"custom": {
4
"loc": "sample",
5
"name": "analyze_func"
6
}
7
}
Copied!
Last modified 9mo ago