@@ -355,7 +355,7 @@ fn fit(
355355
356356 let ( estimator, predict, predict_proba) =
357357 Python :: with_gil ( |py| -> ( Py < PyAny > , Py < PyAny > , Py < PyAny > ) {
358- let estimator: Py < PyAny > = PY_MODULE . getattr ( py, "estimator" ) . unwrap ( ) . into ( ) ;
358+ let estimator: Py < PyAny > = PY_MODULE . getattr ( py, "estimator" ) . unwrap ( ) ;
359359
360360 let train: Py < PyAny > = estimator
361361 . call1 (
@@ -373,21 +373,21 @@ fn fit(
373373 . unwrap ( ) ;
374374
375375 let estimator: Py < PyAny > = train
376- . call1 ( py, PyTuple :: new ( py, & [ & dataset. x_train , & dataset. y_train ] ) )
376+ . call1 ( py, PyTuple :: new ( py, [ & dataset. x_train , & dataset. y_train ] ) )
377377 . unwrap ( ) ;
378378
379379 let predict: Py < PyAny > = PY_MODULE
380380 . getattr ( py, "predictor" )
381381 . unwrap ( )
382- . call1 ( py, PyTuple :: new ( py, & [ & estimator] ) )
382+ . call1 ( py, PyTuple :: new ( py, [ & estimator] ) )
383383 . unwrap ( )
384384 . extract ( py)
385385 . unwrap ( ) ;
386386
387387 let predict_proba: Py < PyAny > = PY_MODULE
388388 . getattr ( py, "predictor_proba" )
389389 . unwrap ( )
390- . call1 ( py, PyTuple :: new ( py, & [ & estimator] ) )
390+ . call1 ( py, PyTuple :: new ( py, [ & estimator] ) )
391391 . unwrap ( )
392392 . extract ( py)
393393 . unwrap ( ) ;
@@ -425,7 +425,7 @@ impl Bindings for Estimator {
425425 fn predict ( & self , features : & [ f32 ] , _num_features : usize , _num_classes : usize ) -> Vec < f32 > {
426426 Python :: with_gil ( |py| -> Vec < f32 > {
427427 self . predict
428- . call1 ( py, PyTuple :: new ( py, & [ features] ) )
428+ . call1 ( py, PyTuple :: new ( py, [ features] ) )
429429 . unwrap ( )
430430 . extract ( py)
431431 . unwrap ( )
@@ -435,7 +435,7 @@ impl Bindings for Estimator {
435435 fn predict_proba ( & self , features : & [ f32 ] , _num_features : usize ) -> Vec < f32 > {
436436 Python :: with_gil ( |py| -> Vec < f32 > {
437437 self . predict_proba
438- . call1 ( py, PyTuple :: new ( py, & [ features] ) )
438+ . call1 ( py, PyTuple :: new ( py, [ features] ) )
439439 . unwrap ( )
440440 . extract ( py)
441441 . unwrap ( )
@@ -446,7 +446,7 @@ impl Bindings for Estimator {
446446 fn to_bytes ( & self ) -> Vec < u8 > {
447447 Python :: with_gil ( |py| -> Vec < u8 > {
448448 let save = PY_MODULE . getattr ( py, "save" ) . unwrap ( ) ;
449- save. call1 ( py, PyTuple :: new ( py, & [ & self . estimator ] ) )
449+ save. call1 ( py, PyTuple :: new ( py, [ & self . estimator ] ) )
450450 . unwrap ( )
451451 . extract ( py)
452452 . unwrap ( )
@@ -461,23 +461,23 @@ impl Bindings for Estimator {
461461 Python :: with_gil ( |py| -> Box < dyn Bindings > {
462462 let load = PY_MODULE . getattr ( py, "load" ) . unwrap ( ) ;
463463 let estimator: Py < PyAny > = load
464- . call1 ( py, PyTuple :: new ( py, & [ bytes] ) )
464+ . call1 ( py, PyTuple :: new ( py, [ bytes] ) )
465465 . unwrap ( )
466466 . extract ( py)
467467 . unwrap ( ) ;
468468
469469 let predict: Py < PyAny > = PY_MODULE
470470 . getattr ( py, "predictor" )
471471 . unwrap ( )
472- . call1 ( py, PyTuple :: new ( py, & [ & estimator] ) )
472+ . call1 ( py, PyTuple :: new ( py, [ & estimator] ) )
473473 . unwrap ( )
474474 . extract ( py)
475475 . unwrap ( ) ;
476476
477477 let predict_proba: Py < PyAny > = PY_MODULE
478478 . getattr ( py, "predictor_proba" )
479479 . unwrap ( )
480- . call1 ( py, PyTuple :: new ( py, & [ & estimator] ) )
480+ . call1 ( py, PyTuple :: new ( py, [ & estimator] ) )
481481 . unwrap ( )
482482 . extract ( py)
483483 . unwrap ( ) ;
@@ -495,13 +495,13 @@ fn sklearn_metric(name: &str, ground_truth: &[f32], y_hat: &[f32]) -> f32 {
495495 Python :: with_gil ( |py| -> f32 {
496496 let calculate_metric = PY_MODULE . getattr ( py, "calculate_metric" ) . unwrap ( ) ;
497497 let wrapper: Py < PyAny > = calculate_metric
498- . call1 ( py, PyTuple :: new ( py, & [ name] ) )
498+ . call1 ( py, PyTuple :: new ( py, [ name] ) )
499499 . unwrap ( )
500500 . extract ( py)
501501 . unwrap ( ) ;
502502
503503 let score: f32 = wrapper
504- . call1 ( py, PyTuple :: new ( py, & [ ground_truth, y_hat] ) )
504+ . call1 ( py, PyTuple :: new ( py, [ ground_truth, y_hat] ) )
505505 . unwrap ( )
506506 . extract ( py)
507507 . unwrap ( ) ;
@@ -530,13 +530,13 @@ pub fn confusion_matrix(ground_truth: &[f32], y_hat: &[f32]) -> Vec<Vec<f32>> {
530530 Python :: with_gil ( |py| -> Vec < Vec < f32 > > {
531531 let calculate_metric = PY_MODULE . getattr ( py, "calculate_metric" ) . unwrap ( ) ;
532532 let wrapper: Py < PyAny > = calculate_metric
533- . call1 ( py, PyTuple :: new ( py, & [ "confusion_matrix" ] ) )
533+ . call1 ( py, PyTuple :: new ( py, [ "confusion_matrix" ] ) )
534534 . unwrap ( )
535535 . extract ( py)
536536 . unwrap ( ) ;
537537
538538 let matrix: Vec < Vec < f32 > > = wrapper
539- . call1 ( py, PyTuple :: new ( py, & [ ground_truth, y_hat] ) )
539+ . call1 ( py, PyTuple :: new ( py, [ ground_truth, y_hat] ) )
540540 . unwrap ( )
541541 . extract ( py)
542542 . unwrap ( ) ;
@@ -549,7 +549,7 @@ pub fn regression_metrics(ground_truth: &[f32], y_hat: &[f32]) -> HashMap<String
549549 Python :: with_gil ( |py| -> HashMap < String , f32 > {
550550 let calculate_metric = PY_MODULE . getattr ( py, "regression_metrics" ) . unwrap ( ) ;
551551 let scores: HashMap < String , f32 > = calculate_metric
552- . call1 ( py, PyTuple :: new ( py, & [ ground_truth, y_hat] ) )
552+ . call1 ( py, PyTuple :: new ( py, [ ground_truth, y_hat] ) )
553553 . unwrap ( )
554554 . extract ( py)
555555 . unwrap ( ) ;
@@ -566,7 +566,7 @@ pub fn classification_metrics(
566566 let mut scores = Python :: with_gil ( |py| -> HashMap < String , f32 > {
567567 let calculate_metric = PY_MODULE . getattr ( py, "classification_metrics" ) . unwrap ( ) ;
568568 let scores: HashMap < String , f32 > = calculate_metric
569- . call1 ( py, PyTuple :: new ( py, & [ ground_truth, y_hat] ) )
569+ . call1 ( py, PyTuple :: new ( py, [ ground_truth, y_hat] ) )
570570 . unwrap ( )
571571 . extract ( py)
572572 . unwrap ( ) ;
@@ -591,7 +591,7 @@ pub fn cluster_metrics(
591591 let calculate_metric = PY_MODULE . getattr ( py, "cluster_metrics" ) . unwrap ( ) ;
592592
593593 let scores: HashMap < String , f32 > = calculate_metric
594- . call1 ( py, ( num_features, PyTuple :: new ( py, & [ inputs, labels] ) ) )
594+ . call1 ( py, ( num_features, PyTuple :: new ( py, [ inputs, labels] ) ) )
595595 . unwrap ( )
596596 . extract ( py)
597597 . unwrap ( ) ;
0 commit comments