File size: 960 Bytes
d4a5429
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import datafit.datafit as df
def getResponse(data, model, LabelT, LabelS):
    print(data.columns)

    # Transform using the pre-trained LabelEncoder
    data["Sequence"] = LabelS.transform(data["Sequence"])

    # Apply normalization if needed
    data, _ = df.normalization(data)

    # Make predictions
    response = model.predict(data)

    # Assuming 'response' is a binary prediction (0 or 1)
    # If it's a probability, you might need to adjust the logic accordingly
    print("Raw Predictions:")
    print(response)

    # If you want to interpret the predictions directly (0 or 1)
    predicted_labels = response.astype(int)
    print("Predicted Labels:")
    print(predicted_labels)

    # If you want to use inverse_transform for better interpretation
    # Uncomment the following lines
    inverse_labels = LabelT.inverse_transform(predicted_labels)
    print("Inverse Transformed Labels:")
    print(inverse_labels)

    return inverse_labels