GET YOUR HANDS ON BLACKSWAN 🦢
Upload your database, select a column to perform a prediction over, and get insights within seconds.
pip install algorithmeai
# Load the AWS API Wrapper
from algorithmeai import BlackSwanClassifier
# Generate a model (up to 10 000 rows) over the first boolean column
model = BlackSwanClassifier("train.csv")
# Get confidence% for each rows
model.get_confidence("backtest.csv")
# Get auc for the model
model.get_auc("backtest.csv")
# Improve model
model.improve()
# Improve recall of the model
model.improveRecall()
# Improve precision of the model
model.improvePrecision()
# Safely save your model
model.to_json("final-model.json")
# Load model from json
new_model = BlackSwanClassifier("final-model.json")
# Generate an array of population items
population = new_model.make_population("backtest.csv")
# Get audit for item
item = population[0]
audit = new_model.get_audit(item)
# Get global feature importan ce
new_model.get_global_feature_importance("backtest.csv")
The audit of a running datapoint exemple on Cancer History
###Algorithme.ai : RAG on item {'CancerHistory': 0.0, 'GeneticRisk': 1.0, 'PhysicalActivity': 3.523088842, 'Diagnosis': 0.0, 'Gender': 0.0, 'AlcoholIntake': 4.717826086, 'Age': 21.0, 'BMI': 24.94591564, 'Smoking': 0.0} • Confidence percentage 0.0% • Feature importance {'Diagnosis': 0.0, 'Age': 0.18, 'Gender': 0.14, 'BMI': 0.16, 'Smoking': 0.1, 'GeneticRisk': 0.14, 'PhysicalActivity': 0.1, 'AlcoholIntake': 0.08, 'CancerHistory': 0.1} ### Insights ### ##Insight number 1 The datapoint satisfies all of the following conditions: The numeric field BMI is less than [26.328191025] The numeric field Age is less than [45.0] The numeric field Smoking is less than [0.5] The numeric field Gender is less than [0.5] This datapoint is a lookalike of the following datapoint: {'Diagnosis': 0.0, 'Age': 38.0, 'Gender': 0.0, 'BMI': 22.64010539, 'Smoking': 0.0, 'GeneticRisk': 1.0, 'PhysicalActivity': 0.4778136468, 'AlcoholIntake': 4.403252887, 'CancerHistory': 0.0} ##Insight number 2 The datapoint satisfies all of the following conditions: The numeric field GeneticRisk is greater or equal to [0.5] The numeric field GeneticRisk is less than [1.5] The numeric field Gender is less than [0.5] The numeric field Age is less than [29.0] This datapoint is a lookalike of the following datapoint: {'Diagnosis': 0.0, 'Age': 24.0, 'Gender': 0.0, 'BMI': 34.15289832, 'Smoking': 0.0, 'GeneticRisk': 1.0, 'PhysicalActivity': 3.948072829, 'AlcoholIntake': 3.370960583, 'CancerHistory': 0.0} ##Insight number 3 The datapoint satisfies all of the following conditions: The numeric field PhysicalActivity is greater or equal to [2.6949629766500003] The numeric field Age is less than [24.5] The numeric field Smoking is less than [0.5] The numeric field BMI is greater or equal to [24.35776272] The numeric field PhysicalActivity is less than [6.7000818755000005] This datapoint is a lookalike of the following datapoint: {'Diagnosis': 0.0, 'Age': 20.0, 'Gender': 0.0, 'BMI': 26.35004053, 'Smoking': 0.0, 'GeneticRisk': 0.0, 'PhysicalActivity': 4.830662452, 'AlcoholIntake': 1.899799761, 'CancerHistory': 0.0} ##Insight number 4 The datapoint satisfies all of the following conditions: The numeric field Gender is less than [0.5] The numeric field BMI is less than [29.273775635] The numeric field GeneticRisk is less than [1.5] The numeric field CancerHistory is less than [0.5] The numeric field Smoking is less than [0.5] The numeric field AlcoholIntake is greater or equal to [4.018008075] This datapoint is a lookalike of the following datapoint: {'Diagnosis': 0.0, 'Age': 35.0, 'Gender': 0.0, 'BMI': 25.56371071, 'Smoking': 0.0, 'GeneticRisk': 1.0, 'PhysicalActivity': 3.789559098, 'AlcoholIntake': 4.68474627, 'CancerHistory': 0.0} ##Insight number 5 The datapoint satisfies all of the following conditions: The numeric field Age is less than [58.0] The numeric field CancerHistory is less than [0.5] The numeric field AlcoholIntake is greater or equal to [4.37311485] The numeric field Gender is less than [0.5] The numeric field GeneticRisk is less than [1.5] This datapoint is a lookalike of the following datapoint: {'Diagnosis': 0.0, 'Age': 42.0, 'Gender': 0.0, 'BMI': 29.51169002, 'Smoking': 0.0, 'GeneticRisk': 1.0, 'PhysicalActivity': 8.19398231, 'AlcoholIntake': 4.724923928, 'CancerHistory': 0.0} ##Insight number 6 The datapoint satisfies all of the following conditions: The numeric field Gender is less than [0.5] The numeric field CancerHistory is less than [0.5] The numeric field PhysicalActivity is greater or equal to [1.83302951125] The numeric field GeneticRisk is less than [1.5] The numeric field Age is less than [49.0] This datapoint is a lookalike of the following datapoint: {'Diagnosis': 0.0, 'Age': 31.0, 'Gender': 0.0, 'BMI': 28.66743532, 'Smoking': 1.0, 'GeneticRisk': 1.0, 'PhysicalActivity': 3.565589212, 'AlcoholIntake': 3.52748326, 'CancerHistory': 0.0} ##Insight number 7 The datapoint satisfies all of the following conditions: The numeric field AlcoholIntake is greater or equal to [4.3688827555] The numeric field GeneticRisk is less than [1.5] The numeric field Age is less than [49.5] The numeric field BMI is less than [28.090149965000002] The numeric field CancerHistory is less than [0.5] This datapoint is a lookalike of the following datapoint: {'Diagnosis': 0.0, 'Age': 35.0, 'Gender': 0.0, 'BMI': 25.56371071, 'Smoking': 0.0, 'GeneticRisk': 1.0, 'PhysicalActivity': 3.789559098, 'AlcoholIntake': 4.68474627, 'CancerHistory': 0.0} ##Insight number 8 The datapoint satisfies all of the following conditions: The numeric field Smoking is less than [0.5] The numeric field Age is less than [26.0] The numeric field Gender is less than [0.5] This datapoint is a lookalike of the following datapoint: {'Diagnosis': 0.0, 'Age': 23.0, 'Gender': 0.0, 'BMI': 27.93172641, 'Smoking': 0.0, 'GeneticRisk': 2.0, 'PhysicalActivity': 5.391937941, 'AlcoholIntake': 0.7043430198, 'CancerHistory': 0.0} ##Insight number 9 The datapoint satisfies all of the following conditions: The numeric field BMI is less than [27.718865625] The numeric field PhysicalActivity is greater or equal to [2.550523364] The numeric field Age is less than [25.5] The numeric field BMI is greater or equal to [24.43024775] This datapoint is a lookalike of the following datapoint: {'Diagnosis': 0.0, 'Age': 20.0, 'Gender': 0.0, 'BMI': 26.49501059, 'Smoking': 0.0, 'GeneticRisk': 1.0, 'PhysicalActivity': 3.50709788, 'AlcoholIntake': 2.236364841, 'CancerHistory': 0.0} ##Insight number 10 The datapoint satisfies all of the following conditions: The numeric field Age is less than [51.5] The numeric field CancerHistory is less than [0.5] The numeric field GeneticRisk is less than [1.5] The numeric field PhysicalActivity is greater or equal to [0.9846454493000001] The numeric field Gender is less than [0.5] This datapoint is a lookalike of the following datapoint: {'Diagnosis': 0.0, 'Age': 32.0, 'Gender': 0.0, 'BMI': 29.71828805, 'Smoking': 0.0, 'GeneticRisk': 1.0, 'PhysicalActivity': 1.573715833, 'AlcoholIntake': 1.157914956, 'CancerHistory': 0.0} ##Insight number 11 The datapoint satisfies all of the following conditions: The numeric field Smoking is less than [0.5] The numeric field BMI is less than [25.083833470000002] The numeric field BMI is greater or equal to [24.259496265000003] The numeric field AlcoholIntake is greater or equal to [3.0805728109999997] This datapoint is a lookalike of the following datapoint: {'Diagnosis': 0.0, 'Age': 48.0, 'Gender': 1.0, 'BMI': 24.51558234, 'Smoking': 0.0, 'GeneticRisk': 0.0, 'PhysicalActivity': 0.5282589391, 'AlcoholIntake': 3.848861537, 'CancerHistory': 0.0} for {'CancerHistory': 0.0, 'GeneticRisk': 1.0, 'PhysicalActivity': 3.523088842, 'Diagnosis': 0.0, 'Gender': 0.0, 'AlcoholIntake': 4.717826086, 'Age': 21.0, 'BMI': 24.94591564, 'Smoking': 0.0} with hash 808c172b75ec8f20e5127b77419aef8d784d1b3aafc89fdda8e3f4ca5583f153
© 2025 Algorithme. All rights reserved.