The distribution called itself torus-ml while shipping a package directory named concrete, so the name a user installs and the name they import disagreed — and most of the tree already said torus.ml, which could not resolve against src/concrete. Moved src/concrete to src/torus and pointed the include at it. The dependency was Zama's concrete-python from their index. It is torus-fhe from ours, which is what luxfhe/torus already ships: that frontend declares torus-fhe and ships a torus/fhe module, so every 'from torus.fhe' in this tree was already naming our compiler and only the dependency lagged. Two distributions share one namespace, which is the shape the upstream this forked from used and the reason the split works: torus-fhe gives torus.fhe, torus-ml gives torus.ml. Swept every other spelling — identifiers, enum members, workflow variables, filenames, notebooks. LICENSE and NOTICE keep the upstream attribution a fork owes; the figures carry the old name in JPEG metadata a text sweep cannot reach.
6.3 KiB
module torus.ml.sklearn.tree
Implement DecisionTree models.
class DecisionTreeClassifier
Implements the sklearn DecisionTreeClassifier.
method __init__
__init__(
criterion='gini',
splitter='best',
max_depth=None,
min_samples_split=2,
min_samples_leaf=1,
min_weight_fraction_leaf=0.0,
max_features=None,
random_state=None,
max_leaf_nodes=None,
min_impurity_decrease=0.0,
class_weight=None,
ccp_alpha: float = 0.0,
monotonic_cst=None,
n_bits: Union[int, Dict[str, int]] = 6
)
Initialize the DecisionTreeClassifier.
noqa: DAR101
property fhe_circuit
Get the FHE circuit.
The FHE circuit combines computational graph, mlir, client and server into a single object. More information available in Torus documentation (https://docs.lux.network/torus/get-started/terminology) Is None if the model is not fitted.
Returns:
Circuit: The FHE circuit.
property is_compiled
Indicate if the model is compiled.
Returns:
bool: If the model is compiled.
property is_fitted
Indicate if the model is fitted.
Returns:
bool: If the model is fitted.
property n_classes_
Get the model's number of classes.
Using this attribute is deprecated.
Returns:
int: The model's number of classes.
property onnx_model
Get the ONNX model.
Is None if the model is not fitted.
Returns:
onnx.ModelProto: The ONNX model.
property target_classes_
Get the model's classes.
Using this attribute is deprecated.
Returns:
Optional[numpy.ndarray]: The model's classes.
method dump_dict
dump_dict() → Dict[str, Any]
classmethod load_dict
load_dict(metadata: Dict)
method post_processing
post_processing(y_preds: ndarray) → ndarray
class DecisionTreeRegressor
Implements the sklearn DecisionTreeClassifier.
method __init__
__init__(
criterion='squared_error',
splitter='best',
max_depth=None,
min_samples_split=2,
min_samples_leaf=1,
min_weight_fraction_leaf=0.0,
max_features=None,
random_state=None,
max_leaf_nodes=None,
min_impurity_decrease=0.0,
ccp_alpha=0.0,
monotonic_cst=None,
n_bits: Union[int, Dict[str, int]] = 6
)
Initialize the DecisionTreeRegressor.
noqa: DAR101
property fhe_circuit
Get the FHE circuit.
The FHE circuit combines computational graph, mlir, client and server into a single object. More information available in Torus documentation (https://docs.lux.network/torus/get-started/terminology) Is None if the model is not fitted.
Returns:
Circuit: The FHE circuit.
property is_compiled
Indicate if the model is compiled.
Returns:
bool: If the model is compiled.
property is_fitted
Indicate if the model is fitted.
Returns:
bool: If the model is fitted.
property onnx_model
Get the ONNX model.
Is None if the model is not fitted.
Returns:
onnx.ModelProto: The ONNX model.
method dump_dict
dump_dict() → Dict[str, Any]
classmethod load_dict
load_dict(metadata: Dict)