Support Vector Machines Exercises Answers

This chapter goes into Support Vector Classification and Regression.

Support Vector Machines Exercises Answers

Question 1

What is the fundamental idea behind Support Vector Machines?

The fundamental idea behind support vector machines is trying to fit the widest possible street between classes of objects. Trying to find the hyper-dimensional plane that maximizes the space between classes.

Question 2

What is a Support Vector?

A support vector is an instance that lies on the edge of the street referenced above. It is an instance that lies as close to the other class as possible while still being classified as being in the appropriate class.

Question 3

Why is it important to scale the inputs when using SVM?

SVMs try to fit the largest possible “street” between the classes (see the first answer), so if the training set is not scaled, the SVM will tend to neglect small features

Question 4

Can an SVM classifier output a confidence score when it classifies an instance? What about a probability?

While an SVM classifier can output a confidence score in the form of the distance between a data point and the decision boundary, it cannot directly output a probability; to get probability estimates, you need to use a technique like Platt scaling or set the probability=True parameter when creating an SVM model in most machine learning libraries, which will then calibrate the scores to produce probabilities

Question 5

Should you use the primal or the dual form of the SVM problem to train a model on a training set with millions of instances and hundreds of features?

The dual hyperparameter should be set to False unless there are more features than training instances, so in this case, the primal form of the SVM problem should be used.

Question 6

Say you trained an SVM classifier with an RBF kernel. It seems to underfit the training set: should you increase or decrease γ(gamma)\gamma (\text{gamma})γ(gamma) ? What about C?

You should increase C and γ\gammaγ if your SVM with an RBF kernel is underfitting the training set. The image below shows an SVM classifier with an RBF kernel using various values of γ\gammaγ and C.

SVM various Values C and gamma

Question 7

How should you set the QP parameters ($ \bm{H} ,,, \bm{f} ,,, \bm{A} ,and, and,and \bm{b} $ ) to solve the soft margin linear SVM classifier problem using an off-the-shelf QP solver?

H=I(n+1)×(n+1) , where n  is the number of features and I is the Identity matrix.f=0, and np-dimensional vector full of 0sA=[t(1)x˙(1)t(p)x˙(p)] where x^(i) is equal to x(i) with an extra bias feature x˙0=1b=-1, and nc-dimensional vector full of -1s\textbf{H} = I_{(n+1) \times (n+1)} \space \text{, where }n \space \text{ is the number of features and }I\text{ is the Identity matrix.}\\[0.25em] \textbf{f}=\textbf{0}\text{, and }n_p\text{-dimensional vector full of 0s}\\[0.25em] \textbf{A}=\begin{bmatrix} -t^{ (1) } \dot{\textbf{x}}^{(1)} \\ \vdots \\ -t^{(p)}\dot{\textbf{x}}^{(p)} \end{bmatrix} \text{ where }\hat{\textbf{x}}^{(i)}\text{ is equal to }\textbf{x}^{(i)}\text{ with an extra bias feature }\dot{\textbf{x}}_0 =1 \\[0.25em] \textbf{b}=\textbf{-1}\text{, and }n_c\text{-dimensional vector full of -1s}\\[0.25em]H=I(n+1)×(n+1) , where n  is the number of features and I is the Identity matrix.f=0, and np-dimensional vector full of 0sA=t(1)x˙(1)t(p)x˙(p) where x^(i) is equal to x(i) with an extra bias feature x˙0=1b=-1, and nc-dimensional vector full of -1s

Note that ppp stands for the number of parameters (features + 1 bias) and ccc the number of constraints.

Question 8

Train a LinearSVC on a linearly separable dataset. Then train an SVC and a SGDClassifier on the same dataset. See if you can get them to produce roughly the same model.

from sklearn.datasets import load_iris

dataset = load_iris()
data, target, target_names, descr = dataset["data"], dataset["target"], dataset["target_names"], dataset["DESCR"]
print(descr)
from sklearn.model_selection import train_test_split
import numpy as np 
np.random.seed(42)
random_state = np.random.randint(100)
X_train, X_test, y_train,y_test  = train_test_split(data,target,test_size=0.2,random_state=random_state)

def get_flower_name(num):
    return target_names[num]
out[10]

.. _iris_dataset:

Iris plants dataset
--------------------

**Data Set Characteristics:**

:Number of Instances: 150 (50 in each of three classes)
:Number of Attributes: 4 numeric, predictive attributes and the class
:Attribute Information:
- sepal length in cm
- sepal width in cm
- petal length in cm
- petal width in cm
- class:
- Iris-Setosa
- Iris-Versicolour
- Iris-Virginica

:Summary Statistics:

============== ==== ==== ======= ===== ====================
Min Max Mean SD Class Correlation
============== ==== ==== ======= ===== ====================
sepal length: 4.3 7.9 5.84 0.83 0.7826
sepal width: 2.0 4.4 3.05 0.43 -0.4194
petal length: 1.0 6.9 3.76 1.76 0.9490 (high!)
petal width: 0.1 2.5 1.20 0.76 0.9565 (high!)
============== ==== ==== ======= ===== ====================

:Missing Attribute Values: None
:Class Distribution: 33.3% for each of 3 classes.
:Creator: R.A. Fisher
:Donor: Michael Marshall (MARSHALL%PLU@io.arc.nasa.gov)
:Date: July, 1988

The famous Iris database, first used by Sir R.A. Fisher. The dataset is taken
from Fisher's paper. Note that it's the same as in R, but not as in the UCI
Machine Learning Repository, which has two wrong data points.

This is perhaps the best known database to be found in the
pattern recognition literature. Fisher's paper is a classic in the field and
is referenced frequently to this day. (See Duda & Hart, for example.) The
data set contains 3 classes of 50 instances each, where each class refers to a
type of iris plant. One class is linearly separable from the other 2; the
latter are NOT linearly separable from each other.

|details-start|
**References**
|details-split|

- Fisher, R.A. "The use of multiple measurements in taxonomic problems"
Annual Eugenics, 7, Part II, 179-188 (1936); also in "Contributions to
Mathematical Statistics" (John Wiley, NY, 1950).
- Duda, R.O., & Hart, P.E. (1973) Pattern Classification and Scene Analysis.
(Q327.D83) John Wiley & Sons. ISBN 0-471-22361-1. See page 218.
- Dasarathy, B.V. (1980) "Nosing Around the Neighborhood: A New System
Structure and Classification Rule for Recognition in Partially Exposed
Environments". IEEE Transactions on Pattern Analysis and Machine
Intelligence, Vol. PAMI-2, No. 1, 67-71.
- Gates, G.W. (1972) "The Reduced Nearest Neighbor Rule". IEEE Transactions
on Information Theory, May 1972, 431-433.
- See also: 1988 MLC Proceedings, 54-64. Cheeseman et al"s AUTOCLASS II
conceptual clustering system finds 3 classes in the data.
- Many, many more ...

|details-end|

import matplotlib.pyplot as plt 
fig, ax = plt.subplots(2,3,layout="constrained",figsize=(16,8))
sepal_length = X_train[:,0]
sepal_width = X_train[:,1]
petal_length = X_train[:,2]
petal_width = X_train[:,3]
print("""According to the Description of the Iris dataset: "One class is linearly separable from the other 2; the latter are NOT linearly separable from each other." 
According to the graph below, the sertosa flower is linearly separable from the other two, so a sertosa vs not-sertosa classifier should be trained.""")
print(target_names)
plots = [
    { "ax": [0,0], "x_label": "Sepal Length (cm)", "y_label": "Sepal Width (cm)", "x": sepal_length, "y": sepal_width },
    { "ax": [0,1], "x_label": "Sepal Length (cm)", "y_label": "Petal Length (cm)", "x": petal_length, "y": sepal_width },
    { "ax": [0,2], "x_label": "Sepal Length (cm)", "y_label": "Petal Width (cm)", "x": sepal_length, "y": petal_width },
    { "ax": [1,0], "x_label": "Sepal Width (cm)", "y_label": "Petal Length (cm)", "x": sepal_width, "y": petal_length },
    { "ax": [1,1], "x_label": "Sepal Width (cm)", "y_label": "Petal Width (cm)", "x": sepal_width, "y": petal_width },
    { "ax": [1,2], "x_label": "Petal Length (cm)", "y_label": "Petal Width (cm)", "x": petal_length, "y": petal_width },
]
import pandas as pd
y_ser = pd.Series(y_train,dtype=int)
cm = [{"c": "b", "m": 's'}, {"c": "y", "m": "v"},{"c": "r", "m": "d"}]
for d in plots:
    Ax = ax[d["ax"][0],d["ax"][1]]
    for i in range(3):
        c = cm[i]["c"]
        m = cm[i]["m"]
        y_indices = y_ser[y_ser==i].index.to_numpy()
        X_values = d["x"][y_indices]
        y_values = d["y"][y_indices]     
        Ax.scatter(X_values,y_values,c=c,marker=m,label=get_flower_name(i))
    Ax.set_xlabel(d["x_label"])
    Ax.set_ylabel(d["y_label"])
    Ax.set_title(d["y_label"] + " vs. " + d["x_label"])
    Ax.legend()
plt.show()
out[11]

According to the Description of the Iris dataset: "One class is linearly separable from the other 2; the latter are NOT linearly separable from each other."
According to the graph below, the sertosa flower is linearly separable from the other two, so a sertosa vs not-sertosa classifier should be trained.
['setosa' 'versicolor' 'virginica']

Jupyter Notebook Image

<Figure size 1600x800 with 6 Axes>

y_train_setosa = np.where(y_train==0,1,0)
y_test_setosa = np.where(y_test==0,1,0)
out[12]
from sklearn.svm import LinearSVC
from sklearn.linear_model import SGDClassifier
from sklearn.pipeline import Pipeline
from sklearn.impute import KNNImputer
from sklearn.preprocessing import StandardScaler
from sklearn.experimental import enable_halving_search_cv
from sklearn.model_selection import HalvingGridSearchCV
"""
Linear SVC
------------------------------------------
Linear Support Vector Classification. Similar to SVC with parameter kernel="linear", but implemented in terms of liblinear rather than libsvm, so it has more flexibility in the choice of penalties and loss functions and shhould scale better to large numbers of samples.
The main differenences between LinearSVC and SVC lie in the loss function used by default, and in the handling of intercept regularization between the two implementations. 

"""
lin_svm_params = [
    {"fit__C": [0.1,0.5,1,10]},
]
lin_svm_pipe = Pipeline(
    steps=[
        ("inpute",KNNImputer(n_neighbors=5)), # All features will need to be imputed so 
        ("scale",StandardScaler()), # Important that 
        ("fit",LinearSVC(penalty="l2",dual=False,max_iter=10000))
    ]
)
lin_svm = HalvingGridSearchCV(lin_svm_pipe,param_grid=lin_svm_params,cv=5,verbose=3,refit=True)
"""
Linear SVC
------------------------------------------
Linear classifiers (SVM, logistic regression, etc.) with SGD training. 
The estimator implements regularized linear models with stochastic gradient descent learning: the gradient loss is estimated at each sample at a time and the model is updated along the way with a dcreasing string schedule (aka learning rate). For best results with the default learning rate, the data should be scaled. 
"""
"""
l1_ratio =0 leads to L2 penalty (same as linear SVM) 
tol=1e-4 is the same as LinearSVM - increasing tol here to try to get the SGD model closed to the Linear SVM

"""
sgd_params = [
    {"fit__l1_ratio": [0,0.15], "fit__tol": [1e-4, 1e-5]},
]
sgd_pipe = Pipeline(
    steps=[
        ("inpute",KNNImputer(n_neighbors=5)),
        ("scale",StandardScaler()),
        ("fit",SGDClassifier(loss="hinge",penalty="l2",tol=1e-4,n_jobs=-1)) # hinge="loss" gives a Linear SVM, l2 penalty is the default for linear SVM models, 
    ]
)
sgd = HalvingGridSearchCV(sgd_pipe,param_grid=sgd_params,cv=5,verbose=3,refit=True)

lin_svm.fit(X_train,y_train_setosa)
sgd.fit(X_train,y_train_setosa)
lin_svm_df = pd.DataFrame(lin_svm.cv_results_)
print("Linear SVM (constant in decision function, weights assigned to features)",(lin_svm.best_estimator_.named_steps["fit"].intercept_,lin_svm.best_estimator_.named_steps["fit"].coef_))
sgd_df = pd.DataFrame(lin_svm.cv_results_)
print("Stochastic Gradient Descent (constant in decision function, weights assigned to features)",(sgd.best_estimator_.named_steps["fit"].intercept_,sgd.best_estimator_.named_steps["fit"].coef_))
lin_svm_pred = lin_svm.predict(X_test)
sgd_pred = sgd.predict(X_test)
from sklearn.metrics import accuracy_score
print("Linear SVC Accuracy:",accuracy_score(lin_svm_pred,y_test_setosa))
print("SGD Accuracy:",accuracy_score(sgd_pred,y_test_setosa))
out[13]

n_iterations: 2
n_required_iterations: 2
n_possible_iterations: 2
min_resources_: 40
max_resources_: 120
aggressive_elimination: False
factor: 3
----------
iter: 0
n_candidates: 4
n_resources: 40
Fitting 5 folds for each of 4 candidates, totalling 20 fits
[CV 1/5] END ....fit__C=0.1;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 2/5] END ....fit__C=0.1;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 3/5] END ....fit__C=0.1;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 4/5] END ....fit__C=0.1;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 5/5] END ....fit__C=0.1;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 1/5] END ....fit__C=0.5;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 2/5] END ....fit__C=0.5;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 3/5] END ....fit__C=0.5;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 4/5] END ....fit__C=0.5;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 5/5] END ....fit__C=0.5;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 1/5] END ......fit__C=1;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 2/5] END ......fit__C=1;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 3/5] END ......fit__C=1;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 4/5] END ......fit__C=1;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 5/5] END ......fit__C=1;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 1/5] END .....fit__C=10;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 2/5] END .....fit__C=10;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 3/5] END .....fit__C=10;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 4/5] END .....fit__C=10;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 5/5] END .....fit__C=10;, score=(train=1.000, test=1.000) total time= 0.0s
----------
iter: 1
n_candidates: 2
n_resources: 120
Fitting 5 folds for each of 2 candidates, totalling 10 fits
[CV 1/5] END ......fit__C=1;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 2/5] END ......fit__C=1;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 3/5] END ......fit__C=1;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 4/5] END ......fit__C=1;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 5/5] END ......fit__C=1;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 1/5] END .....fit__C=10;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 2/5] END .....fit__C=10;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 3/5] END .....fit__C=10;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 4/5] END .....fit__C=10;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 5/5] END .....fit__C=10;, score=(train=1.000, test=1.000) total time= 0.0s
n_iterations: 2
n_required_iterations: 2
n_possible_iterations: 2
min_resources_: 40
max_resources_: 120
aggressive_elimination: False
factor: 3
----------
iter: 0
n_candidates: 4
n_resources: 40
Fitting 5 folds for each of 4 candidates, totalling 20 fits
[CV 1/5] END fit__l1_ratio=0, fit__tol=0.0001;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 2/5] END fit__l1_ratio=0, fit__tol=0.0001;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 3/5] END fit__l1_ratio=0, fit__tol=0.0001;, score=(train=1.000, test=0.875) total time= 0.0s
[CV 4/5] END fit__l1_ratio=0, fit__tol=0.0001;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 5/5] END fit__l1_ratio=0, fit__tol=0.0001;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 1/5] END fit__l1_ratio=0, fit__tol=1e-05;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 2/5] END fit__l1_ratio=0, fit__tol=1e-05;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 3/5] END fit__l1_ratio=0, fit__tol=1e-05;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 4/5] END fit__l1_ratio=0, fit__tol=1e-05;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 5/5] END fit__l1_ratio=0, fit__tol=1e-05;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 1/5] END fit__l1_ratio=0.15, fit__tol=0.0001;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 2/5] END fit__l1_ratio=0.15, fit__tol=0.0001;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 3/5] END fit__l1_ratio=0.15, fit__tol=0.0001;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 4/5] END fit__l1_ratio=0.15, fit__tol=0.0001;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 5/5] END fit__l1_ratio=0.15, fit__tol=0.0001;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 1/5] END fit__l1_ratio=0.15, fit__tol=1e-05;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 2/5] END fit__l1_ratio=0.15, fit__tol=1e-05;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 3/5] END fit__l1_ratio=0.15, fit__tol=1e-05;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 4/5] END fit__l1_ratio=0.15, fit__tol=1e-05;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 5/5] END fit__l1_ratio=0.15, fit__tol=1e-05;, score=(train=1.000, test=1.000) total time= 0.0s
----------
iter: 1
n_candidates: 2
n_resources: 120
Fitting 5 folds for each of 2 candidates, totalling 10 fits
[CV 1/5] END fit__l1_ratio=0.15, fit__tol=0.0001;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 2/5] END fit__l1_ratio=0.15, fit__tol=0.0001;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 3/5] END fit__l1_ratio=0.15, fit__tol=0.0001;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 4/5] END fit__l1_ratio=0.15, fit__tol=0.0001;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 5/5] END fit__l1_ratio=0.15, fit__tol=0.0001;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 1/5] END fit__l1_ratio=0.15, fit__tol=1e-05;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 2/5] END fit__l1_ratio=0.15, fit__tol=1e-05;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 3/5] END fit__l1_ratio=0.15, fit__tol=1e-05;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 4/5] END fit__l1_ratio=0.15, fit__tol=1e-05;, score=(train=1.000, test=1.000) total time= 0.0s
[CV 5/5] END fit__l1_ratio=0.15, fit__tol=1e-05;, score=(train=1.000, test=1.000) total time= 0.0s
Linear SVM (constant in decision function, weights assigned to features) (array([-0.7107095]), array([[-0.16775165, 0.39112568, -0.69600938, -0.70736194]]))
Stochastic Gradient Descent (constant in decision function, weights assigned to features) (array([0.01996008]), array([[-3.29942013, 6.52507668, -6.60397163, -8.02423767]]))
Linear SVC Accuracy: 1.0
SGD Accuracy: 1.0

Question 9

Train an SVM classifier on the MNIST dataset. Since SVM classifiers are binary classifiers, you will need to use one-versus-all to classify all 10 digits. You may want to tune the hyperparameters using small validation sets to speed up the process. What accuracy can you reach?

from sklearn.datasets import fetch_openml
mnist = fetch_openml('mnist_784', version=1)
data, target, description = mnist["data"], mnist["target"], mnist["DESCR"]
print(description)
data = data.to_numpy()
target = target.to_numpy()
X_train, X_test, y_train, y_test = data[:60000], data[60000:], target[:60000], target[60000:]
out[15]

**Author**: Yann LeCun, Corinna Cortes, Christopher J.C. Burges
**Source**: [MNIST Website](http://yann.lecun.com/exdb/mnist/) - Date unknown
**Please cite**:

The MNIST database of handwritten digits with 784 features, raw data available at: http://yann.lecun.com/exdb/mnist/. It can be split in a training set of the first 60,000 examples, and a test set of 10,000 examples

It is a subset of a larger set available from NIST. The digits have been size-normalized and centered in a fixed-size image. It is a good database for people who want to try learning techniques and pattern recognition methods on real-world data while spending minimal efforts on preprocessing and formatting. The original black and white (bilevel) images from NIST were size normalized to fit in a 20x20 pixel box while preserving their aspect ratio. The resulting images contain grey levels as a result of the anti-aliasing technique used by the normalization algorithm. the images were centered in a 28x28 image by computing the center of mass of the pixels, and translating the image so as to position this point at the center of the 28x28 field.

With some classification methods (particularly template-based methods, such as SVM and K-nearest neighbors), the error rate improves when the digits are centered by bounding box rather than center of mass. If you do this kind of pre-processing, you should report it in your publications. The MNIST database was constructed from NIST's NIST originally designated SD-3 as their training set and SD-1 as their test set. However, SD-3 is much cleaner and easier to recognize than SD-1. The reason for this can be found on the fact that SD-3 was collected among Census Bureau employees, while SD-1 was collected among high-school students. Drawing sensible conclusions from learning experiments requires that the result be independent of the choice of training set and test among the complete set of samples. Therefore it was necessary to build a new database by mixing NIST's datasets.

The MNIST training set is composed of 30,000 patterns from SD-3 and 30,000 patterns from SD-1. Our test set was composed of 5,000 patterns from SD-3 and 5,000 patterns from SD-1. The 60,000 pattern training set contained examples from approximately 250 writers. We made sure that the sets of writers of the training set and test set were disjoint. SD-1 contains 58,527 digit images written by 500 different writers. In contrast to SD-3, where blocks of data from each writer appeared in sequence, the data in SD-1 is scrambled. Writer identities for SD-1 is available and we used this information to unscramble the writers. We then split SD-1 in two: characters written by the first 250 writers went into our new training set. The remaining 250 writers were placed in our test set. Thus we had two sets with nearly 30,000 examples each. The new training set was completed with enough examples from SD-3, starting at pattern # 0, to make a full set of 60,000 training patterns. Similarly, the new test set was completed with SD-3 examples starting at pattern # 35,000 to make a full set with 60,000 test patterns. Only a subset of 10,000 test images (5,000 from SD-1 and 5,000 from SD-3) is available on this site. The full 60,000 sample training set is available.

Downloaded from openml.org.

from sklearn.svm import SVC 
from sklearn.model_selection import GridSearchCV
from sklearn.pipeline import Pipeline
from sklearn.impute import KNNImputer 
from sklearn.preprocessing import StandardScaler
from sklearn.experimental import enable_halving_search_cv
from sklearn.model_selection import HalvingGridSearchCV

"""
I am going to try training linear and rbf kernel models because the recommendation from the book is to start with linear and then go to rbf if you have time. I also know that the rbf kernel might take longer to train, but a linear model might not be the best for this dataset
"""
svc_param_grid = [
    {"fit__kernel": ["linear"], "fit__C": [0.5,1,10,100]},
    {"fit__kernel": ["rbf"], "fit__C": [0.5,1,10] }
]
svc_pipe = Pipeline(
    steps=[
        ("impute", KNNImputer(n_neighbors=5)),
        ("scale", StandardScaler()), # Scaling important for SVC
        ("fit", SVC(cache_size=1000,decision_function_shape='ovr')), # incrase cache size (try to speed up), decision_function_shape = "ovr" - multi label classifications "Whether to return a one-vs-rest (‘ovr’) decision function of shape (n_samples, n_classes)"
    ]
)

svc = HalvingGridSearchCV(svc_pipe,param_grid=svc_param_grid,cv=5,verbose=3,refit=True)
svc.fit(X_train,y_train)
print(svc.best_params_)
out[16]

n_iterations: 2
n_required_iterations: 2
n_possible_iterations: 2
min_resources_: 20000
max_resources_: 60000
aggressive_elimination: False
factor: 3
----------
iter: 0
n_candidates: 7
n_resources: 20000
Fitting 5 folds for each of 7 candidates, totalling 35 fits
[CV 1/5] END fit__C=0.5, fit__kernel=linear;, score=(train=0.999, test=0.920) total time= 23.5s
[CV 2/5] END fit__C=0.5, fit__kernel=linear;, score=(train=0.999, test=0.907) total time= 22.6s
[CV 3/5] END fit__C=0.5, fit__kernel=linear;, score=(train=0.999, test=0.907) total time= 23.1s
[CV 4/5] END fit__C=0.5, fit__kernel=linear;, score=(train=1.000, test=0.902) total time= 21.8s
[CV 5/5] END fit__C=0.5, fit__kernel=linear;, score=(train=0.999, test=0.916) total time= 22.3s
[CV 1/5] END fit__C=1, fit__kernel=linear;, score=(train=1.000, test=0.917) total time= 22.2s
[CV 2/5] END fit__C=1, fit__kernel=linear;, score=(train=1.000, test=0.908) total time= 23.8s
[CV 3/5] END fit__C=1, fit__kernel=linear;, score=(train=1.000, test=0.904) total time= 23.8s
[CV 4/5] END fit__C=1, fit__kernel=linear;, score=(train=1.000, test=0.903) total time= 22.6s
[CV 5/5] END fit__C=1, fit__kernel=linear;, score=(train=1.000, test=0.914) total time= 23.5s
[CV 1/5] END fit__C=10, fit__kernel=linear;, score=(train=1.000, test=0.917) total time= 23.3s
[CV 2/5] END fit__C=10, fit__kernel=linear;, score=(train=1.000, test=0.906) total time= 23.8s
[CV 3/5] END fit__C=10, fit__kernel=linear;, score=(train=1.000, test=0.905) total time= 23.9s
[CV 4/5] END fit__C=10, fit__kernel=linear;, score=(train=1.000, test=0.903) total time= 22.7s
[CV 5/5] END fit__C=10, fit__kernel=linear;, score=(train=1.000, test=0.911) total time= 23.6s
[CV 1/5] END fit__C=100, fit__kernel=linear;, score=(train=1.000, test=0.917) total time= 24.2s
[CV 2/5] END fit__C=100, fit__kernel=linear;, score=(train=1.000, test=0.906) total time= 24.1s
[CV 3/5] END fit__C=100, fit__kernel=linear;, score=(train=1.000, test=0.905) total time= 24.1s
[CV 4/5] END fit__C=100, fit__kernel=linear;, score=(train=1.000, test=0.903) total time= 23.3s
[CV 5/5] END fit__C=100, fit__kernel=linear;, score=(train=1.000, test=0.911) total time= 23.1s
[CV 1/5] END fit__C=0.5, fit__kernel=rbf;, score=(train=0.966, test=0.940) total time= 57.6s
[CV 2/5] END fit__C=0.5, fit__kernel=rbf;, score=(train=0.965, test=0.931) total time= 56.4s
[CV 3/5] END fit__C=0.5, fit__kernel=rbf;, score=(train=0.967, test=0.939) total time= 57.0s
[CV 4/5] END fit__C=0.5, fit__kernel=rbf;, score=(train=0.968, test=0.928) total time= 56.8s
[CV 5/5] END fit__C=0.5, fit__kernel=rbf;, score=(train=0.965, test=0.938) total time= 57.1s
[CV 1/5] END fit__C=1, fit__kernel=rbf;, score=(train=0.982, test=0.947) total time= 52.6s
[CV 2/5] END fit__C=1, fit__kernel=rbf;, score=(train=0.984, test=0.945) total time= 51.0s
[CV 3/5] END fit__C=1, fit__kernel=rbf;, score=(train=0.984, test=0.947) total time= 51.7s
[CV 4/5] END fit__C=1, fit__kernel=rbf;, score=(train=0.985, test=0.940) total time= 51.3s
[CV 5/5] END fit__C=1, fit__kernel=rbf;, score=(train=0.983, test=0.950) total time= 51.7s
[CV 1/5] END fit__C=10, fit__kernel=rbf;, score=(train=1.000, test=0.957) total time= 48.7s
[CV 2/5] END fit__C=10, fit__kernel=rbf;, score=(train=1.000, test=0.951) total time= 48.1s
[CV 3/5] END fit__C=10, fit__kernel=rbf;, score=(train=0.999, test=0.955) total time= 47.2s
[CV 4/5] END fit__C=10, fit__kernel=rbf;, score=(train=1.000, test=0.948) total time= 47.5s
[CV 5/5] END fit__C=10, fit__kernel=rbf;, score=(train=0.999, test=0.956) total time= 47.8s
----------
iter: 1
n_candidates: 3
n_resources: 60000
Fitting 5 folds for each of 3 candidates, totalling 15 fits
[CV 1/5] END fit__C=0.5, fit__kernel=rbf;, score=(train=0.973, test=0.953) total time= 6.0min
[CV 2/5] END fit__C=0.5, fit__kernel=rbf;, score=(train=0.973, test=0.954) total time= 6.0min
[CV 3/5] END fit__C=0.5, fit__kernel=rbf;, score=(train=0.973, test=0.956) total time= 6.0min
[CV 4/5] END fit__C=0.5, fit__kernel=rbf;, score=(train=0.974, test=0.949) total time= 5.9min
[CV 5/5] END fit__C=0.5, fit__kernel=rbf;, score=(train=0.973, test=0.960) total time= 6.1min
[CV 1/5] END fit__C=1, fit__kernel=rbf;, score=(train=0.986, test=0.962) total time= 5.5min
[CV 2/5] END fit__C=1, fit__kernel=rbf;, score=(train=0.986, test=0.962) total time= 5.4min
[CV 3/5] END fit__C=1, fit__kernel=rbf;, score=(train=0.986, test=0.963) total time= 5.4min
[CV 4/5] END fit__C=1, fit__kernel=rbf;, score=(train=0.986, test=0.956) total time= 5.3min
[CV 5/5] END fit__C=1, fit__kernel=rbf;, score=(train=0.986, test=0.966) total time= 5.4min
[CV 1/5] END fit__C=10, fit__kernel=rbf;, score=(train=0.999, test=0.970) total time= 5.0min
[CV 2/5] END fit__C=10, fit__kernel=rbf;, score=(train=0.999, test=0.970) total time= 5.0min
[CV 3/5] END fit__C=10, fit__kernel=rbf;, score=(train=0.999, test=0.970) total time= 5.0min
[CV 4/5] END fit__C=10, fit__kernel=rbf;, score=(train=1.000, test=0.965) total time= 4.9min
[CV 5/5] END fit__C=10, fit__kernel=rbf;, score=(train=0.999, test=0.973) total time= 5.0min
{'fit__C': 10, 'fit__kernel': 'rbf'}

Question 10

Train an SVM regressor on the California housing dataset.

import os 
import pandas as pd 
import numpy as np 
from sklearn.model_selection import train_test_split

np.random.seed(42)
random_state = np.random.randint(100)
data = pd.read_csv(os.path.join(os.getcwd(),'..','housing.csv'))
target = data["median_house_value"]
data = data.drop(columns="median_house_value")
X_train, X_test, y_train, y_test = train_test_split(data,target,test_size=0.2,random_state=random_state)
print("X_train Shape:",X_train.shape,"\nX_test Shape:",X_test.shape,"\ny_train Shape:",y_train.shape,"\ny_test Shape:",y_test.shape)
X_train.head()
out[18]

X_train Shape: (16512, 9)
X_test Shape: (4128, 9)
y_train Shape: (16512,)
y_test Shape: (4128,)

longitude latitude housing_median_age total_rooms total_bedrooms \

5368 -123.23 39.77 25.0 2075.0 435.0

14021 -122.36 37.72 10.0 479.0 125.0

4780 -119.34 37.12 23.0 1881.0 380.0

8306 -122.31 38.31 32.0 2577.0 458.0

7471 -116.57 34.00 20.0 260.0 67.0



population households median_income ocean_proximity

5368 991.0 377.0 1.2281 INLAND

14021 355.0 108.0 2.7083 NEAR BAY

4780 64.0 37.0 3.8750 INLAND

8306 1172.0 447.0 3.8796 NEAR BAY

7471 69.0 50.0 3.5208 INLAND

X_train.describe()
out[19]

longitude latitude housing_median_age total_rooms \

count 16512.000000 16512.000000 16512.000000 16512.000000

mean -119.568127 35.633841 28.557049 2638.398195

std 2.000862 2.134379 12.600418 2185.734437

min -124.350000 32.540000 1.000000 2.000000

25% -121.780000 33.930000 18.000000 1444.000000

50% -118.500000 34.260000 29.000000 2128.000000

75% -118.000000 37.720000 37.000000 3152.000000

max -114.310000 41.950000 52.000000 39320.000000



total_bedrooms population households median_income

count 16346.000000 16512.000000 16512.000000 16512.000000

mean 538.681084 1426.656311 500.176902 3.867891

std 422.953148 1120.557035 383.282184 1.892877

min 1.000000 3.000000 1.000000 0.499900

25% 295.000000 789.000000 279.000000 2.566625

50% 435.000000 1164.500000 410.000000 3.533300

75% 648.000000 1726.000000 606.000000 4.740050

max 6445.000000 28566.000000 6082.000000 15.000100

X_train.info()
out[20]

<class 'pandas.core.frame.DataFrame'>
Index: 16512 entries, 5368 to 15358
Data columns (total 9 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 longitude 16512 non-null float64
1 latitude 16512 non-null float64
2 housing_median_age 16512 non-null float64
3 total_rooms 16512 non-null float64
4 total_bedrooms 16346 non-null float64
5 population 16512 non-null float64
6 households 16512 non-null float64
7 median_income 16512 non-null float64
8 ocean_proximity 16512 non-null object
dtypes: float64(8), object(1)
memory usage: 1.3+ MB

import matplotlib.pyplot as plt 
n, bins, patches = plt.hist(X_train["housing_median_age"],bins=7)
plt.gca().set_title("Test Bins for Housing Median Age")
plt.show()
print(bins)
out[21]
Jupyter Notebook Image

<Figure size 640x480 with 1 Axes>

[ 1. 8.28571429 15.57142857 22.85714286 30.14285714 37.42857143
44.71428571 52. ]

from sklearn.preprocessing import StandardScaler
handling_multi_collin = X_train.iloc[:,:-1].copy()
corr = handling_multi_collin.corr()
print("""
total_rooms, total_bedrooms, population, and households demonstrate multicollinearity,
""")
corr.style.background_gradient(cmap='coolwarm')

out[22]


total_rooms, total_bedrooms, population, and households demonstrate multicollinearity,

<pandas.io.formats.style.Styler at 0x1a31767ad90>

print("""
Attempt at removing multicollinearity while keeping information
""")
handling_multi_collin["people_per_bedroom"] = handling_multi_collin["population"]/handling_multi_collin["total_bedrooms"]
handling_multi_collin["bedrooms_per_rooms"] = handling_multi_collin["total_bedrooms"]/handling_multi_collin["total_rooms"]
handling_multi_collin = handling_multi_collin.drop(columns=["total_bedrooms","total_rooms","population"])
corr2 = handling_multi_collin.corr()
corr2.style.background_gradient(cmap='coolwarm')
out[23]


Attempt at removing multicollinearity while keeping information

<pandas.io.formats.style.Styler at 0x1a317813ed0>

fig, ax = plt.subplots(1,2,layout="constrained")
ax[0].hist(X_train["households"])
ax[0].set_title("Households Histogram")
ax[1].hist(X_train["population"])
ax[1].set_title("Population Histogram")
plt.show()
out[24]
Jupyter Notebook Image

<Figure size 640x480 with 2 Axes>

from sklearn.neighbors import KNeighborsTransformer, KernelDensity

knnTrans = KNeighborsTransformer(mode="distance",n_neighbors=6 )
out = knnTrans.fit_transform(X_train.loc[:,["longitude","latitude"]])
print("KNeighborsTransformer Shape:",out.shape,". This is out for being too sparse")
kernDens = KernelDensity(kernel="gaussian")
kernDens.fit(X_train.loc[:,["longitude","latitude"]])
out = kernDens.score_samples(X_train.loc[:,["longitude","latitude"]])
print(out,out.shape,X_train.loc[:,["latitude"]].shape)
fig, ax = plt.subplots(1,1,layout="constrained")
s = ax.scatter(X_train.loc[:,["longitude"]],X_train.loc[:,["latitude"]],cmap=plt.cm.hsv,c=out)
ax.set_title("Kernel Density Estimation for Latitude / Longitude")
ax.set_xlabel("Longitude")
ax.set_ylabel("Latitude")
fig.colorbar(s,cmap=plt.cm.hsv)
plt.show()
print("""
I've tried other ways of doing longitude / latitude - I think I'll give this a shot.
""")
out[25]

KNeighborsTransformer Shape: (16512, 16512) . This is out for being too sparse
[-4.94916807 -3.22681699 -4.62537008 ... -2.72113066 -2.67919814
-3.74916069] (16512,) (16512, 1)

Jupyter Notebook Image

<Figure size 640x480 with 2 Axes>

from sklearn.pipeline import Pipeline
from sklearn.compose import ColumnTransformer
from sklearn.model_selection import train_test_split
from sklearn.impute import SimpleImputer, KNNImputer
from sklearn.preprocessing import OneHotEncoder, StandardScaler
from sklearn.base import BaseEstimator, TransformerMixin

class BinThenOhe(BaseEstimator,TransformerMixin):
    """
    - Transformer created to first put values into bins and then One Hot Encodes it 
    - fit and transform should receive an array of shape (n_features,1)
    """
    def __init__(self,bins_num=7,bins=None):
        self.ohe = OneHotEncoder(sparse_output=False,handle_unknown="ignore")
        self.bins_num = bins_num
        if bins != None:
            self.bins = bins 
    def fit(self,X,y=None):
        X = pd.DataFrame(X,columns=["Col"])
        if not getattr(self,"bins",None):
            n, bins, patches = plt.hist(X,bins=self.bins_num)
            self.bins = bins
            plt.gca().remove()
        for i in range(len(self.bins)):
            if i==0:
                query_str = 'Col <= {}'.format(self.bins[i])
                indices = X.query(query_str).index
                X.loc[indices,0] = i+1
            else:
                query_str = 'Col <= {} and Col > {}'.format(self.bins[i],self.bins[i-1])
                indices = X.query(query_str).index
                X.loc[indices,0] = i+1
        X = X.loc[:,0].astype(np.int64)
        self.ohe.fit(X.to_numpy().reshape(-1,1))
        return self
    def transform(self,X,y=None):
        X = self.ohe.transform(X)
        return X

class TransformHouseValues(BaseEstimator,TransformerMixin):
    """
    - I am not sure whether to just scale the housing age or put it into bins and ohe it, so I will try both
    - This estimator expects one column array - the housing_median_age from the og DataFrame
    - If bin_it = True, then the houses will be put into bins and one hot encoded - else, the bins will be scaled with StandardScaler
    - You can manipulate bins as well - the number of bins to use (default = 7)
    """
    def __init__(self,bin_it=True,bins=7):
        self.bin_it=bin_it
        self.bins=bins
        if type(self.bins) != type(4):
            raise TypeError("Bins should be an integer.")
    def reshapeX(self,X):
        if isinstance(X,pd.Series):
            X = X.to_numpy().reshape(-1,1)
        elif isinstance(X,pd.DataFrame):
            X = X.iloc[:,0].to_numpy().reshape(-1,1)
        elif len(X.shape)==1:
            # If X is a row vector
            X = X.reshape(-1,1)
        return X
    def fit(self,X,y=None):
        X = self.reshapeX(X)
        if self.bin_it:
            self.transformer = BinThenOhe(bins_num=self.bins)
            self.transformer.fit(X,y)
            return self
        else:
            self.transformer = StandardScaler()
            self.transformer.fit(X)
            return self
    
    def transform(self,X,y=None):
        X = self.reshapeX(X)
        X = self.transformer.transform(X)
        return X

class HandleRoomsBedroomsPopulation(BaseEstimator,TransformerMixin):
    """
    - Trying to remove multicollinearity between these attributes
    - Columns in this order:
        - total_rooms	total_bedrooms	population
    - Compute/Return: 
        - people_per_bedroom
        - bedrooms_per_rooms
        - population? - karg for this
    - Should be recieving a NumPy array since this is after the imputer
    """
    def __init__(self,keep_pop=False):
        self.keep_pop = keep_pop
    def fit(self,X,y=None):
        return self
    def transform(self,X,y=None):
        if self.keep_pop:
            ret = np.zeros((X.shape[0],3),dtype=np.float64)
            ret[:,2] = X[:,2]
        else:
            ret = np.zeros((X.shape[0],2),dtype=np.float64)
        ret[:,0] = np.divide(X[:,2],X[:,1],out=np.zeros_like(X[:,2],dtype=np.float64),where=X[:,1]!=0)
        ret[:,1] = np.divide(X[:,1],X[:,0],out=np.zeros_like(X[:,1],dtype=np.float64),where=X[:,0]!=0)
        return ret

class LngLatHandler(BaseEstimator,TransformerMixin):
    """
    Handling Longitude and Latitude to get some data from them
    - Ysing Kernel Density estimation - assuming that the houses had an equal chance of being pulled anywhere from california, this should give you a good estimate of population density 
    -  https://scikit-learn.org/stable/modules/density.html#kernel-density-estimation
    - https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.KernelDensity.html#sklearn.neighbors.KernelDensity
    """
    def __init__(self,kernel="gaussian",bandwidth=1,algorithm="auto"):
        self.kernel = kernel
        self.bandwidth = bandwidth
        self.algorithm = algorithm
        self.kern_func = KernelDensity(kernel=self.kernel,bandwidth=self.bandwidth,algorithm=self.algorithm)
    def fit(self,X,y=None):
        self.kern_func.fit(X)
        return self
    def transform(self,X,y=None):
        out = self.kern_func.score_samples(X)
        out = out.reshape(-1,1)
        return out 

rooms_bed_pop_pipeline = Pipeline(
    steps=[
        ('impute',KNNImputer(n_neighbors=5,weights="uniform")),
        ("rem_collin",HandleRoomsBedroomsPopulation()),
        ("scale",StandardScaler())
    ]
)
ocean_proximity_pipeline = Pipeline(
    steps=[
        ('impute',SimpleImputer(strategy="most_frequent")),
        ('ohe',OneHotEncoder(sparse_output=False,handle_unknown="ignore"))
    ]
)
housing_median_age_pipeline = Pipeline(
    steps=[
        ('impute',SimpleImputer(strategy="median")),
        ("bohe_or_std",TransformHouseValues())
    ]
)
median_income_households_pipeline = Pipeline(
    steps=[
        ('impute',SimpleImputer(strategy="median")),
        ("scale",StandardScaler())
    ]
)
lat_lng_pipeline = Pipeline(
    steps=[
        ('impute',SimpleImputer(strategy="median")),
        ('kernel',LngLatHandler()),
        ("scale",StandardScaler())
    ]
)

col_transformer = ColumnTransformer(
    transformers=[
        ("ocp",ocean_proximity_pipeline,["ocean_proximity"]), # 0-4
        ("mi_h",median_income_households_pipeline,["median_income","households"]), # 5-6
        ('rbpop',rooms_bed_pop_pipeline,["total_rooms","total_bedrooms","population"]), # 7-8
        ("hma",housing_median_age_pipeline,['housing_median_age']), # 
        ("lnglat",lat_lng_pipeline,["longitude","latitude"]) # -1
    ]
)
from sklearn.svm import SVR, NuSVR
from sklearn.model_selection import GridSearchCV

param_grid = [
    {"fit__kernel": ["linear"], "fit__C": [0.5,1,10,100], "transform__hma__bohe_or_std__bin_it": [True, False]},
    {"fit__kernel": ["poly"], "fit__degree": [2,3], "fit__coef0": [0,1], "fit__C": [0.1,1,10],  "transform__hma__bohe_or_std__bin_it": [True, False] },
    {"fit__kernel": ["rbf"], "fit__C": [0.1,1,10], "transform__hma__bohe_or_std__bin_it": [True, False] },
    {"fit__kernel": ["sigmoid"], "fit__coef0": [0,1], "fit__C": [0.5,1,10,100], "transform__hma__bohe_or_std__bin_it": [True, False] }
]
svr_pipe = Pipeline(
    steps=[
        ('transform',col_transformer),
        ('fit',SVR(verbose=True))
    ]
)

svr = GridSearchCV(svr_pipe,param_grid=param_grid,cv=5,verbose=3,refit=True)
svr.fit(X_train,y_train)
from sklearn.metrics import mean_squared_error, mean_absolute_error, r2_score, explained_variance_score, mean_pinball_loss, d2_pinball_score, d2_absolute_error_score
pred = svr.predict(X_test)
print("Mean Squared Error Score:",mean_squared_error(y_test,pred))
print("Mean Absolute Error Score:",mean_absolute_error(y_test,pred))
print("R2 Score Score:",r2_score(y_test,pred))
print("Explained Variance Score:",explained_variance_score(y_test,pred))
print("Mean Pinball Loss Score:",mean_pinball_loss(y_test,pred))
print("D2 Pinball Score:",d2_pinball_score(y_test,pred))
print("D2 Absolute Error Score:",d2_absolute_error_score(y_test,pred))
out[26]

Fitting 5 folds for each of 54 candidates, totalling 270 fits
[LibSVM][CV 1/5] END fit__C=0.5, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=-0.002 total time= 13.2s
[LibSVM][CV 2/5] END fit__C=0.5, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=0.002 total time= 13.0s
[LibSVM][CV 3/5] END fit__C=0.5, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=0.021 total time= 12.8s
[LibSVM][CV 4/5] END fit__C=0.5, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=0.007 total time= 12.9s
[LibSVM][CV 5/5] END fit__C=0.5, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=0.018 total time= 12.8s
[LibSVM][CV 1/5] END fit__C=0.5, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=-0.000 total time= 12.9s
[LibSVM][CV 2/5] END fit__C=0.5, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=0.002 total time= 12.8s
[LibSVM][CV 3/5] END fit__C=0.5, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=0.022 total time= 12.9s
[LibSVM][CV 4/5] END fit__C=0.5, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=0.009 total time= 13.8s
[LibSVM][CV 5/5] END fit__C=0.5, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=0.019 total time= 13.7s
[LibSVM][CV 1/5] END fit__C=1, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=0.054 total time= 13.6s
[LibSVM][CV 2/5] END fit__C=1, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=0.056 total time= 13.9s
[LibSVM][CV 3/5] END fit__C=1, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=0.077 total time= 13.1s
[LibSVM][CV 4/5] END fit__C=1, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=0.060 total time= 13.4s
[LibSVM][CV 5/5] END fit__C=1, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=0.073 total time= 13.0s
[LibSVM][CV 1/5] END fit__C=1, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=0.056 total time= 13.1s
[LibSVM][CV 2/5] END fit__C=1, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=0.058 total time= 13.0s
[LibSVM][CV 3/5] END fit__C=1, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=0.080 total time= 13.1s
[LibSVM][CV 4/5] END fit__C=1, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=0.063 total time= 13.1s
[LibSVM][CV 5/5] END fit__C=1, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=0.076 total time= 14.1s
[LibSVM][CV 1/5] END fit__C=10, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=0.431 total time= 13.6s
[LibSVM][CV 2/5] END fit__C=10, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=0.434 total time= 12.8s
[LibSVM][CV 3/5] END fit__C=10, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=0.459 total time= 13.0s
[LibSVM][CV 4/5] END fit__C=10, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=0.321 total time= 12.9s
[LibSVM][CV 5/5] END fit__C=10, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=0.448 total time= 12.7s
[LibSVM][CV 1/5] END fit__C=10, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=0.441 total time= 12.8s
[LibSVM][CV 2/5] END fit__C=10, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=0.446 total time= 12.8s
[LibSVM][CV 3/5] END fit__C=10, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=0.469 total time= 12.9s
[LibSVM][CV 4/5] END fit__C=10, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=0.333 total time= 12.9s
[LibSVM][CV 5/5] END fit__C=10, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=0.460 total time= 12.8s
[LibSVM][CV 1/5] END fit__C=100, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=0.576 total time= 12.8s
[LibSVM][CV 2/5] END fit__C=100, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=0.579 total time= 12.8s
[LibSVM][CV 3/5] END fit__C=100, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=0.587 total time= 12.8s
[LibSVM][CV 4/5] END fit__C=100, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=-3.278 total time= 12.7s
[LibSVM][CV 5/5] END fit__C=100, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=0.583 total time= 12.7s
[LibSVM][CV 1/5] END fit__C=100, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=0.586 total time= 12.9s
[LibSVM][CV 2/5] END fit__C=100, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=0.591 total time= 12.9s
[LibSVM][CV 3/5] END fit__C=100, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=0.594 total time= 12.8s
[LibSVM][CV 4/5] END fit__C=100, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=-3.412 total time= 12.8s
[LibSVM][CV 5/5] END fit__C=100, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=0.594 total time= 12.8s
[LibSVM][CV 1/5] END fit__C=0.1, fit__coef0=0, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=-0.064 total time= 13.2s
[LibSVM][CV 2/5] END fit__C=0.1, fit__coef0=0, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=-0.061 total time= 13.3s
[LibSVM][CV 3/5] END fit__C=0.1, fit__coef0=0, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=-0.044 total time= 13.1s
[LibSVM][CV 4/5] END fit__C=0.1, fit__coef0=0, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=-0.216 total time= 13.3s
[LibSVM][CV 5/5] END fit__C=0.1, fit__coef0=0, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=-0.043 total time= 13.1s
[LibSVM][CV 1/5] END fit__C=0.1, fit__coef0=0, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=-0.064 total time= 13.2s
[LibSVM][CV 2/5] END fit__C=0.1, fit__coef0=0, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=-0.061 total time= 13.2s
[LibSVM][CV 3/5] END fit__C=0.1, fit__coef0=0, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=-0.044 total time= 13.2s
[LibSVM][CV 4/5] END fit__C=0.1, fit__coef0=0, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=-0.216 total time= 13.1s
[LibSVM][CV 5/5] END fit__C=0.1, fit__coef0=0, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=-0.044 total time= 13.2s
[LibSVM][CV 1/5] END fit__C=0.1, fit__coef0=0, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=-0.062 total time= 13.3s
[LibSVM][CV 2/5] END fit__C=0.1, fit__coef0=0, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=-0.059 total time= 13.3s
[LibSVM][CV 3/5] END fit__C=0.1, fit__coef0=0, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=-0.042 total time= 13.3s
[LibSVM][CV 4/5] END fit__C=0.1, fit__coef0=0, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=-4.018 total time= 13.3s
[LibSVM][CV 5/5] END fit__C=0.1, fit__coef0=0, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=-0.041 total time= 13.2s
[LibSVM][CV 1/5] END fit__C=0.1, fit__coef0=0, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=-0.063 total time= 14.4s
[LibSVM][CV 2/5] END fit__C=0.1, fit__coef0=0, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=-0.060 total time= 13.2s
[LibSVM][CV 3/5] END fit__C=0.1, fit__coef0=0, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=-0.043 total time= 13.2s
[LibSVM][CV 4/5] END fit__C=0.1, fit__coef0=0, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=-2.568 total time= 13.7s
[LibSVM][CV 5/5] END fit__C=0.1, fit__coef0=0, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=-0.042 total time= 13.0s
[LibSVM][CV 1/5] END fit__C=0.1, fit__coef0=1, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=-0.059 total time= 13.2s
[LibSVM][CV 2/5] END fit__C=0.1, fit__coef0=1, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=-0.056 total time= 13.2s
[LibSVM][CV 3/5] END fit__C=0.1, fit__coef0=1, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=-0.039 total time= 13.3s
[LibSVM][CV 4/5] END fit__C=0.1, fit__coef0=1, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=-0.214 total time= 13.2s
[LibSVM][CV 5/5] END fit__C=0.1, fit__coef0=1, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=-0.039 total time= 13.3s
[LibSVM][CV 1/5] END fit__C=0.1, fit__coef0=1, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=-0.060 total time= 13.3s
[LibSVM][CV 2/5] END fit__C=0.1, fit__coef0=1, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=-0.057 total time= 13.4s
[LibSVM][CV 3/5] END fit__C=0.1, fit__coef0=1, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=-0.040 total time= 13.5s
[LibSVM][CV 4/5] END fit__C=0.1, fit__coef0=1, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=-0.215 total time= 13.1s
[LibSVM][CV 5/5] END fit__C=0.1, fit__coef0=1, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=-0.040 total time= 13.0s
[LibSVM][CV 1/5] END fit__C=0.1, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=-0.052 total time= 13.0s
[LibSVM][CV 2/5] END fit__C=0.1, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=-0.049 total time= 13.1s
[LibSVM][CV 3/5] END fit__C=0.1, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=-0.031 total time= 13.1s
[LibSVM][CV 4/5] END fit__C=0.1, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=-3.021 total time= 13.2s
[LibSVM][CV 5/5] END fit__C=0.1, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=-0.032 total time= 13.1s
[LibSVM][CV 1/5] END fit__C=0.1, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=-0.055 total time= 13.0s
[LibSVM][CV 2/5] END fit__C=0.1, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=-0.052 total time= 13.1s
[LibSVM][CV 3/5] END fit__C=0.1, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=-0.034 total time= 13.0s
[LibSVM][CV 4/5] END fit__C=0.1, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=-1.986 total time= 12.9s
[LibSVM][CV 5/5] END fit__C=0.1, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=-0.035 total time= 12.8s
[LibSVM][CV 1/5] END fit__C=1, fit__coef0=0, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=-0.055 total time= 13.0s
[LibSVM][CV 2/5] END fit__C=1, fit__coef0=0, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=-0.052 total time= 13.6s
[LibSVM][CV 3/5] END fit__C=1, fit__coef0=0, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=-0.035 total time= 13.1s
[LibSVM][CV 4/5] END fit__C=1, fit__coef0=0, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=-0.195 total time= 13.1s
[LibSVM][CV 5/5] END fit__C=1, fit__coef0=0, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=-0.035 total time= 12.9s
[LibSVM][CV 1/5] END fit__C=1, fit__coef0=0, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=-0.058 total time= 13.1s
[LibSVM][CV 2/5] END fit__C=1, fit__coef0=0, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=-0.054 total time= 13.0s
[LibSVM][CV 3/5] END fit__C=1, fit__coef0=0, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=-0.037 total time= 13.3s
[LibSVM][CV 4/5] END fit__C=1, fit__coef0=0, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=-0.202 total time= 13.3s
[LibSVM][CV 5/5] END fit__C=1, fit__coef0=0, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=-0.037 total time= 13.6s
[LibSVM][CV 1/5] END fit__C=1, fit__coef0=0, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=-0.036 total time= 14.1s
[LibSVM][CV 2/5] END fit__C=1, fit__coef0=0, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=-0.034 total time= 14.0s
[LibSVM][CV 3/5] END fit__C=1, fit__coef0=0, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=-0.013 total time= 14.2s
[LibSVM][CV 4/5] END fit__C=1, fit__coef0=0, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=-14.939 total time= 13.7s
[LibSVM][CV 5/5] END fit__C=1, fit__coef0=0, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=-0.017 total time= 14.6s
[LibSVM][CV 1/5] END fit__C=1, fit__coef0=0, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=-0.044 total time= 13.3s
[LibSVM][CV 2/5] END fit__C=1, fit__coef0=0, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=-0.041 total time= 14.1s
[LibSVM][CV 3/5] END fit__C=1, fit__coef0=0, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=-0.022 total time= 13.5s
[LibSVM][CV 4/5] END fit__C=1, fit__coef0=0, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=-3.031 total time= 13.5s
[LibSVM][CV 5/5] END fit__C=1, fit__coef0=0, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=-0.025 total time= 13.6s
[LibSVM][CV 1/5] END fit__C=1, fit__coef0=1, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=-0.013 total time= 11.2s
[LibSVM][CV 2/5] END fit__C=1, fit__coef0=1, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=-0.010 total time= 13.2s
[LibSVM][CV 3/5] END fit__C=1, fit__coef0=1, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=0.009 total time= 13.1s
[LibSVM][CV 4/5] END fit__C=1, fit__coef0=1, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=-0.185 total time= 13.5s
[LibSVM][CV 5/5] END fit__C=1, fit__coef0=1, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=0.007 total time= 13.2s
[LibSVM][CV 1/5] END fit__C=1, fit__coef0=1, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=-0.020 total time= 13.2s
[LibSVM][CV 2/5] END fit__C=1, fit__coef0=1, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=-0.017 total time= 13.2s
[LibSVM][CV 3/5] END fit__C=1, fit__coef0=1, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=0.002 total time= 13.1s
[LibSVM][CV 4/5] END fit__C=1, fit__coef0=1, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=-0.193 total time= 13.1s
[LibSVM][CV 5/5] END fit__C=1, fit__coef0=1, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=0.000 total time= 13.2s
[LibSVM][CV 1/5] END fit__C=1, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=0.048 total time= 13.1s
[LibSVM][CV 2/5] END fit__C=1, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=0.050 total time= 13.0s
[LibSVM][CV 3/5] END fit__C=1, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=0.074 total time= 13.2s
[LibSVM][CV 4/5] END fit__C=1, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=-18.922 total time= 13.2s
[LibSVM][CV 5/5] END fit__C=1, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=0.068 total time= 13.0s
[LibSVM][CV 1/5] END fit__C=1, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=0.030 total time= 12.9s
[LibSVM][CV 2/5] END fit__C=1, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=0.032 total time= 13.0s
[LibSVM][CV 3/5] END fit__C=1, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=0.054 total time= 13.0s
[LibSVM][CV 4/5] END fit__C=1, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=-5.201 total time= 13.1s
[LibSVM][CV 5/5] END fit__C=1, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=0.049 total time= 12.9s
[LibSVM][CV 1/5] END fit__C=10, fit__coef0=0, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=0.021 total time= 13.0s
[LibSVM][CV 2/5] END fit__C=10, fit__coef0=0, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=0.023 total time= 13.1s
[LibSVM][CV 3/5] END fit__C=10, fit__coef0=0, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=0.044 total time= 13.1s
[LibSVM][CV 4/5] END fit__C=10, fit__coef0=0, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=-0.032 total time= 13.2s
[LibSVM][CV 5/5] END fit__C=10, fit__coef0=0, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=0.040 total time= 13.0s
[LibSVM][CV 1/5] END fit__C=10, fit__coef0=0, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=0.003 total time= 13.1s
[LibSVM][CV 2/5] END fit__C=10, fit__coef0=0, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=0.005 total time= 13.1s
[LibSVM][CV 3/5] END fit__C=10, fit__coef0=0, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=0.025 total time= 13.1s
[LibSVM][CV 4/5] END fit__C=10, fit__coef0=0, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=-0.085 total time= 13.0s
[LibSVM][CV 5/5] END fit__C=10, fit__coef0=0, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=0.022 total time= 13.0s
[LibSVM][CV 1/5] END fit__C=10, fit__coef0=0, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=0.097 total time= 13.1s
[LibSVM][CV 2/5] END fit__C=10, fit__coef0=0, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=0.092 total time= 13.2s
[LibSVM][CV 3/5] END fit__C=10, fit__coef0=0, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=0.128 total time= 13.2s
[LibSVM][CV 4/5] END fit__C=10, fit__coef0=0, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=-67.612 total time= 13.1s
[LibSVM][CV 5/5] END fit__C=10, fit__coef0=0, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=0.118 total time= 13.0s
[LibSVM][CV 1/5] END fit__C=10, fit__coef0=0, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=0.085 total time= 13.0s
[LibSVM][CV 2/5] END fit__C=10, fit__coef0=0, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=0.081 total time= 13.1s
[LibSVM][CV 3/5] END fit__C=10, fit__coef0=0, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=0.115 total time= 13.0s
[LibSVM][CV 4/5] END fit__C=10, fit__coef0=0, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=-27.546 total time= 13.0s
[LibSVM][CV 5/5] END fit__C=10, fit__coef0=0, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=0.104 total time= 13.0s
[LibSVM][CV 1/5] END fit__C=10, fit__coef0=1, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=0.290 total time= 13.1s
[LibSVM][CV 2/5] END fit__C=10, fit__coef0=1, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=0.291 total time= 13.1s
[LibSVM][CV 3/5] END fit__C=10, fit__coef0=1, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=0.315 total time= 13.1s
[LibSVM][CV 4/5] END fit__C=10, fit__coef0=1, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=-0.154 total time= 13.0s
[LibSVM][CV 5/5] END fit__C=10, fit__coef0=1, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=0.306 total time= 12.9s
[LibSVM][CV 1/5] END fit__C=10, fit__coef0=1, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=0.260 total time= 13.1s
[LibSVM][CV 2/5] END fit__C=10, fit__coef0=1, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=0.263 total time= 13.1s
[LibSVM][CV 3/5] END fit__C=10, fit__coef0=1, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=0.286 total time= 13.1s
[LibSVM][CV 4/5] END fit__C=10, fit__coef0=1, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=-0.179 total time= 13.0s
[LibSVM][CV 5/5] END fit__C=10, fit__coef0=1, fit__degree=2, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=0.278 total time= 13.0s
[LibSVM][CV 1/5] END fit__C=10, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=0.390 total time= 13.1s
[LibSVM][CV 2/5] END fit__C=10, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=0.389 total time= 13.3s
[LibSVM][CV 3/5] END fit__C=10, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=0.409 total time= 13.3s
[LibSVM][CV 4/5] END fit__C=10, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=0.268 total time= 14.1s
[LibSVM][CV 5/5] END fit__C=10, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=0.406 total time= 14.0s
[LibSVM][CV 1/5] END fit__C=10, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=0.375 total time= 15.2s
[LibSVM][CV 2/5] END fit__C=10, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=0.376 total time= 13.1s
[LibSVM][CV 3/5] END fit__C=10, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=0.399 total time= 13.0s
[LibSVM][CV 4/5] END fit__C=10, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=-1.689 total time= 13.1s
[LibSVM][CV 5/5] END fit__C=10, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=0.393 total time= 13.1s
[LibSVM][CV 1/5] END fit__C=0.1, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=True;, score=-0.064 total time= 16.1s
[LibSVM][CV 2/5] END fit__C=0.1, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=True;, score=-0.061 total time= 16.3s
[LibSVM][CV 3/5] END fit__C=0.1, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=True;, score=-0.044 total time= 16.2s
[LibSVM][CV 4/5] END fit__C=0.1, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=True;, score=-0.054 total time= 16.1s
[LibSVM][CV 5/5] END fit__C=0.1, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=True;, score=-0.044 total time= 15.9s
[LibSVM][CV 1/5] END fit__C=0.1, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=False;, score=-0.064 total time= 15.2s
[LibSVM][CV 2/5] END fit__C=0.1, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=False;, score=-0.061 total time= 15.2s
[LibSVM][CV 3/5] END fit__C=0.1, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=False;, score=-0.044 total time= 15.2s
[LibSVM][CV 4/5] END fit__C=0.1, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=False;, score=-0.054 total time= 15.1s
[LibSVM][CV 5/5] END fit__C=0.1, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=False;, score=-0.044 total time= 15.0s
[LibSVM][CV 1/5] END fit__C=1, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=True;, score=-0.056 total time= 16.0s
[LibSVM][CV 2/5] END fit__C=1, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=True;, score=-0.052 total time= 16.0s
[LibSVM][CV 3/5] END fit__C=1, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=True;, score=-0.036 total time= 15.9s
[LibSVM][CV 4/5] END fit__C=1, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=True;, score=-0.045 total time= 16.1s
[LibSVM][CV 5/5] END fit__C=1, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=True;, score=-0.036 total time= 16.0s
[LibSVM][CV 1/5] END fit__C=1, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=False;, score=-0.058 total time= 15.3s
[LibSVM][CV 2/5] END fit__C=1, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=False;, score=-0.054 total time= 15.1s
[LibSVM][CV 3/5] END fit__C=1, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=False;, score=-0.037 total time= 15.1s
[LibSVM][CV 4/5] END fit__C=1, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=False;, score=-0.047 total time= 15.2s
[LibSVM][CV 5/5] END fit__C=1, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=False;, score=-0.037 total time= 15.0s
[LibSVM][CV 1/5] END fit__C=10, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=True;, score=0.014 total time= 15.8s
[LibSVM][CV 2/5] END fit__C=10, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=True;, score=0.020 total time= 15.8s
[LibSVM][CV 3/5] END fit__C=10, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=True;, score=0.034 total time= 15.9s
[LibSVM][CV 4/5] END fit__C=10, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=True;, score=0.028 total time= 15.8s
[LibSVM][CV 5/5] END fit__C=10, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=True;, score=0.035 total time= 15.8s
[LibSVM][CV 1/5] END fit__C=10, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=False;, score=0.004 total time= 15.2s
[LibSVM][CV 2/5] END fit__C=10, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=False;, score=0.008 total time= 15.2s
[LibSVM][CV 3/5] END fit__C=10, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=False;, score=0.023 total time= 15.2s
[LibSVM][CV 4/5] END fit__C=10, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=False;, score=0.017 total time= 15.1s
[LibSVM][CV 5/5] END fit__C=10, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=False;, score=0.024 total time= 15.2s
[LibSVM][CV 1/5] END fit__C=0.5, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=-0.056 total time= 16.1s
[LibSVM][CV 2/5] END fit__C=0.5, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=-0.053 total time= 16.0s
[LibSVM][CV 3/5] END fit__C=0.5, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=-0.035 total time= 16.3s
[LibSVM][CV 4/5] END fit__C=0.5, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=-0.046 total time= 16.0s
[LibSVM][CV 5/5] END fit__C=0.5, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=-0.036 total time= 15.9s
[LibSVM][CV 1/5] END fit__C=0.5, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=-0.057 total time= 15.9s
[LibSVM][CV 2/5] END fit__C=0.5, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=-0.054 total time= 15.8s
[LibSVM][CV 3/5] END fit__C=0.5, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=-0.036 total time= 15.8s
[LibSVM][CV 4/5] END fit__C=0.5, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=-0.047 total time= 15.7s
[LibSVM][CV 5/5] END fit__C=0.5, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=-0.037 total time= 15.6s
[LibSVM][CV 1/5] END fit__C=0.5, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=-0.061 total time= 16.8s
[LibSVM][CV 2/5] END fit__C=0.5, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=-0.058 total time= 16.9s
[LibSVM][CV 3/5] END fit__C=0.5, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=-0.040 total time= 16.8s
[LibSVM][CV 4/5] END fit__C=0.5, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=-0.051 total time= 16.8s
[LibSVM][CV 5/5] END fit__C=0.5, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=-0.041 total time= 16.7s
[LibSVM][CV 1/5] END fit__C=0.5, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=-0.061 total time= 16.4s
[LibSVM][CV 2/5] END fit__C=0.5, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=-0.058 total time= 16.3s
[LibSVM][CV 3/5] END fit__C=0.5, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=-0.041 total time= 16.4s
[LibSVM][CV 4/5] END fit__C=0.5, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=-0.051 total time= 16.5s
[LibSVM][CV 5/5] END fit__C=0.5, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=-0.041 total time= 16.3s
[LibSVM][CV 1/5] END fit__C=1, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=-0.047 total time= 15.9s
[LibSVM][CV 2/5] END fit__C=1, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=-0.043 total time= 16.0s
[LibSVM][CV 3/5] END fit__C=1, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=-0.026 total time= 15.9s
[LibSVM][CV 4/5] END fit__C=1, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=-0.037 total time= 15.9s
[LibSVM][CV 5/5] END fit__C=1, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=-0.027 total time= 15.7s
[LibSVM][CV 1/5] END fit__C=1, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=-0.049 total time= 15.8s
[LibSVM][CV 2/5] END fit__C=1, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=-0.045 total time= 15.8s
[LibSVM][CV 3/5] END fit__C=1, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=-0.028 total time= 15.8s
[LibSVM][CV 4/5] END fit__C=1, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=-0.039 total time= 16.0s
[LibSVM][CV 5/5] END fit__C=1, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=-0.029 total time= 15.8s
[LibSVM][CV 1/5] END fit__C=1, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=-0.057 total time= 16.9s
[LibSVM][CV 2/5] END fit__C=1, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=-0.054 total time= 16.7s
[LibSVM][CV 3/5] END fit__C=1, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=-0.036 total time= 16.9s
[LibSVM][CV 4/5] END fit__C=1, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=-0.047 total time= 16.9s
[LibSVM][CV 5/5] END fit__C=1, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=-0.037 total time= 16.8s
[LibSVM][CV 1/5] END fit__C=1, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=-0.058 total time= 16.4s
[LibSVM][CV 2/5] END fit__C=1, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=-0.055 total time= 16.4s
[LibSVM][CV 3/5] END fit__C=1, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=-0.037 total time= 16.5s
[LibSVM][CV 4/5] END fit__C=1, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=-0.048 total time= 16.4s
[LibSVM][CV 5/5] END fit__C=1, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=-0.037 total time= 16.4s
[LibSVM][CV 1/5] END fit__C=10, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=0.089 total time= 15.9s
[LibSVM][CV 2/5] END fit__C=10, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=0.092 total time= 15.9s
[LibSVM][CV 3/5] END fit__C=10, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=0.112 total time= 16.0s
[LibSVM][CV 4/5] END fit__C=10, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=0.097 total time= 16.2s
[LibSVM][CV 5/5] END fit__C=10, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=0.108 total time= 15.8s
[LibSVM][CV 1/5] END fit__C=10, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=0.076 total time= 15.7s
[LibSVM][CV 2/5] END fit__C=10, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=0.080 total time= 15.8s
[LibSVM][CV 3/5] END fit__C=10, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=0.099 total time= 15.8s
[LibSVM][CV 4/5] END fit__C=10, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=0.085 total time= 15.8s
[LibSVM][CV 5/5] END fit__C=10, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=0.096 total time= 15.8s
[LibSVM][CV 1/5] END fit__C=10, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=0.012 total time= 17.0s
[LibSVM][CV 2/5] END fit__C=10, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=0.014 total time= 16.9s
[LibSVM][CV 3/5] END fit__C=10, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=0.034 total time= 16.9s
[LibSVM][CV 4/5] END fit__C=10, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=0.020 total time= 16.7s
[LibSVM][CV 5/5] END fit__C=10, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=0.031 total time= 16.8s
[LibSVM][CV 1/5] END fit__C=10, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=0.004 total time= 16.5s
[LibSVM][CV 2/5] END fit__C=10, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=0.007 total time= 16.5s
[LibSVM][CV 3/5] END fit__C=10, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=0.027 total time= 16.6s
[LibSVM][CV 4/5] END fit__C=10, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=0.013 total time= 16.5s
[LibSVM][CV 5/5] END fit__C=10, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=0.023 total time= 16.5s
[LibSVM][CV 1/5] END fit__C=100, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=0.444 total time= 15.5s
[LibSVM][CV 2/5] END fit__C=100, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=0.452 total time= 16.0s
[LibSVM][CV 3/5] END fit__C=100, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=0.468 total time= 15.6s
[LibSVM][CV 4/5] END fit__C=100, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=0.455 total time= 15.5s
[LibSVM][CV 5/5] END fit__C=100, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=0.461 total time= 15.5s
[LibSVM][CV 1/5] END fit__C=100, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=0.445 total time= 15.5s
[LibSVM][CV 2/5] END fit__C=100, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=0.452 total time= 15.3s
[LibSVM][CV 3/5] END fit__C=100, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=0.471 total time= 15.4s
[LibSVM][CV 4/5] END fit__C=100, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=0.453 total time= 16.8s
[LibSVM][CV 5/5] END fit__C=100, fit__coef0=0, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=0.464 total time= 16.2s
[LibSVM][CV 1/5] END fit__C=100, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=0.275 total time= 16.7s
[LibSVM][CV 2/5] END fit__C=100, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=0.278 total time= 16.7s
[LibSVM][CV 3/5] END fit__C=100, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=0.315 total time= 17.1s
[LibSVM][CV 4/5] END fit__C=100, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=0.286 total time= 16.9s
[LibSVM][CV 5/5] END fit__C=100, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=0.297 total time= 16.6s
[LibSVM][CV 1/5] END fit__C=100, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=0.279 total time= 16.1s
[LibSVM][CV 2/5] END fit__C=100, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=0.284 total time= 16.2s
[LibSVM][CV 3/5] END fit__C=100, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=0.317 total time= 16.4s
[LibSVM][CV 4/5] END fit__C=100, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=0.288 total time= 16.3s
[LibSVM][CV 5/5] END fit__C=100, fit__coef0=1, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=0.301 total time= 16.2s
[LibSVM]Mean Squared Error Score: 7056421426.984778
Mean Absolute Error Score: 57524.146114627765
R2 Score Score: 0.4785229470926716
Explained Variance Score: 0.522262934062818
Mean Pinball Loss Score: 28762.073057313883
D2 Pinball Score: 0.3536472157658833
D2 Absolute Error Score: 0.3536472157658833

<Figure size 640x480 with 0 Axes>

# explicitly require this experimental feature
from sklearn.experimental import enable_halving_search_cv # noqa
# now you can import normally from model_selection
from sklearn.model_selection import HalvingGridSearchCV

param_grid = [
    {"fit__kernel": ["linear"], "fit__C": [100,1000], "transform__hma__bohe_or_std__bin_it": [True, False]},
    {"fit__kernel": ["poly"], "fit__degree": [3,4], "fit__coef0": [1], "fit__C": [10,100,1000],  "transform__hma__bohe_or_std__bin_it": [True, False] },
    {"fit__kernel": ["rbf"], "fit__C": [100,1000], "transform__hma__bohe_or_std__bin_it": [True, False] },
    {"fit__kernel": ["sigmoid"], "fit__C": [100,1000], "transform__hma__bohe_or_std__bin_it": [True, False] }
]
svr_pipe = Pipeline(
    steps=[
        ('transform',col_transformer),
        ('fit',SVR(verbose=True))
    ]
)
svr = HalvingGridSearchCV(svr_pipe,param_grid=param_grid,cv=5,verbose=3,refit=True)
svr.fit(X_train,y_train)
from sklearn.metrics import mean_squared_error, mean_absolute_error, r2_score, explained_variance_score, mean_pinball_loss, d2_pinball_score, d2_absolute_error_score
pred = svr.predict(X_test)
print("Mean Squared Error Score:",mean_squared_error(y_test,pred))
print("Mean Absolute Error Score:",mean_absolute_error(y_test,pred))
print("R2 Score Score:",r2_score(y_test,pred))
print("Explained Variance Score:",explained_variance_score(y_test,pred))
print("Mean Pinball Loss Score:",mean_pinball_loss(y_test,pred))
print("D2 Pinball Score:",d2_pinball_score(y_test,pred))
print("D2 Absolute Error Score:",d2_absolute_error_score(y_test,pred))
out[27]

n_iterations: 3
n_required_iterations: 3
n_possible_iterations: 3
min_resources_: 1834
max_resources_: 16512
aggressive_elimination: False
factor: 3
----------
iter: 0
n_candidates: 24
n_resources: 1834
Fitting 5 folds for each of 24 candidates, totalling 120 fits
[LibSVM][CV 1/5] END fit__C=100, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.502, test=0.481) total time= 0.1s
[LibSVM][CV 2/5] END fit__C=100, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.533, test=0.519) total time= 0.1s
[LibSVM][CV 3/5] END fit__C=100, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.448, test=0.424) total time= 0.1s
[LibSVM][CV 4/5] END fit__C=100, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.483, test=0.390) total time= 0.1s
[LibSVM][CV 5/5] END fit__C=100, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.495, test=0.523) total time= 0.1s
[LibSVM][CV 1/5] END fit__C=100, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.514, test=0.488) total time= 0.1s
[LibSVM][CV 2/5] END fit__C=100, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.546, test=0.540) total time= 0.1s
[LibSVM][CV 3/5] END fit__C=100, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.468, test=0.438) total time= 0.1s
[LibSVM][CV 4/5] END fit__C=100, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.492, test=0.402) total time= 0.1s
[LibSVM][CV 5/5] END fit__C=100, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.500, test=0.532) total time= 0.1s
[LibSVM][CV 1/5] END fit__C=1000, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.624, test=0.603) total time= 0.1s
[LibSVM][CV 2/5] END fit__C=1000, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.658, test=0.641) total time= 0.1s
[LibSVM][CV 3/5] END fit__C=1000, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.548, test=0.551) total time= 0.1s
[LibSVM][CV 4/5] END fit__C=1000, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.591, test=0.549) total time= 0.1s
[LibSVM][CV 5/5] END fit__C=1000, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.612, test=0.666) total time= 0.1s
[LibSVM][CV 1/5] END fit__C=1000, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.636, test=0.608) total time= 0.1s
[LibSVM][CV 2/5] END fit__C=1000, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.667, test=0.660) total time= 0.1s
[LibSVM][CV 3/5] END fit__C=1000, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.569, test=0.568) total time= 0.1s
[LibSVM][CV 4/5] END fit__C=1000, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.605, test=0.563) total time= 0.1s
[LibSVM][CV 5/5] END fit__C=1000, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.614, test=0.676) total time= 0.1s
[LibSVM][CV 1/5] END fit__C=10, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.089, test=0.071) total time= 0.1s
[LibSVM][CV 2/5] END fit__C=10, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.089, test=0.090) total time= 0.1s
[LibSVM][CV 3/5] END fit__C=10, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.056, test=0.082) total time= 0.1s
[LibSVM][CV 4/5] END fit__C=10, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.073, test=0.028) total time= 0.1s
[LibSVM][CV 5/5] END fit__C=10, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.081, test=0.057) total time= 0.1s
[LibSVM][CV 1/5] END fit__C=10, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.069, test=0.054) total time= 0.1s
[LibSVM][CV 2/5] END fit__C=10, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.067, test=0.072) total time= 0.1s
[LibSVM][CV 3/5] END fit__C=10, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.038, test=0.067) total time= 0.1s
[LibSVM][CV 4/5] END fit__C=10, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.050, test=0.014) total time= 0.1s
[LibSVM][CV 5/5] END fit__C=10, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.060, test=0.039) total time= 0.1s
[LibSVM][CV 1/5] END fit__C=10, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.186, test=0.152) total time= 0.1s
[LibSVM][CV 2/5] END fit__C=10, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.200, test=0.190) total time= 0.1s
[LibSVM][CV 3/5] END fit__C=10, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.139, test=0.151) total time= 0.1s
[LibSVM][CV 4/5] END fit__C=10, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.182, test=0.092) total time= 0.1s
[LibSVM][CV 5/5] END fit__C=10, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.191, test=0.163) total time= 0.1s
[LibSVM][CV 1/5] END fit__C=10, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.177, test=0.145) total time= 0.1s
[LibSVM][CV 2/5] END fit__C=10, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.166, test=0.160) total time= 0.1s
[LibSVM][CV 3/5] END fit__C=10, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.128, test=0.137) total time= 0.1s
[LibSVM][CV 4/5] END fit__C=10, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.163, test=0.081) total time= 0.1s
[LibSVM][CV 5/5] END fit__C=10, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.166, test=0.139) total time= 0.1s
[LibSVM][CV 1/5] END fit__C=100, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.448, test=0.414) total time= 0.1s
[LibSVM][CV 2/5] END fit__C=100, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.497, test=0.470) total time= 0.1s
[LibSVM][CV 3/5] END fit__C=100, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.399, test=0.393) total time= 0.1s
[LibSVM][CV 4/5] END fit__C=100, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.425, test=0.302) total time= 0.1s
[LibSVM][CV 5/5] END fit__C=100, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.469, test=0.475) total time= 0.1s
[LibSVM][CV 1/5] END fit__C=100, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.438, test=0.399) total time= 0.1s
[LibSVM][CV 2/5] END fit__C=100, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.478, test=0.461) total time= 0.1s
[LibSVM][CV 3/5] END fit__C=100, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.386, test=0.376) total time= 0.1s
[LibSVM][CV 4/5] END fit__C=100, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.412, test=0.295) total time= 0.1s
[LibSVM][CV 5/5] END fit__C=100, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.451, test=0.457) total time= 0.1s
[LibSVM][CV 1/5] END fit__C=100, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.519, test=0.472) total time= 0.1s
[LibSVM][CV 2/5] END fit__C=100, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.563, test=0.517) total time= 0.1s
[LibSVM][CV 3/5] END fit__C=100, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.464, test=0.448) total time= 0.1s
[LibSVM][CV 4/5] END fit__C=100, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.488, test=0.358) total time= 0.1s
[LibSVM][CV 5/5] END fit__C=100, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.534, test=0.541) total time= 0.1s
[LibSVM][CV 1/5] END fit__C=100, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.530, test=0.477) total time= 0.1s
[LibSVM][CV 2/5] END fit__C=100, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.556, test=0.526) total time= 0.1s
[LibSVM][CV 3/5] END fit__C=100, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.462, test=0.443) total time= 0.1s
[LibSVM][CV 4/5] END fit__C=100, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.487, test=0.364) total time= 0.1s
[LibSVM][CV 5/5] END fit__C=100, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.522, test=0.535) total time= 0.1s
[LibSVM][CV 1/5] END fit__C=1000, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.668, test=0.637) total time= 0.1s
[LibSVM][CV 2/5] END fit__C=1000, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.702, test=0.657) total time= 0.1s
[LibSVM][CV 3/5] END fit__C=1000, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.603, test=0.574) total time= 0.1s
[LibSVM][CV 4/5] END fit__C=1000, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.644, test=0.534) total time= 0.1s
[LibSVM][CV 5/5] END fit__C=1000, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.671, test=0.678) total time= 0.1s
[LibSVM][CV 1/5] END fit__C=1000, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.700, test=0.649) total time= 0.1s
[LibSVM][CV 2/5] END fit__C=1000, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.717, test=0.689) total time= 0.1s
[LibSVM][CV 3/5] END fit__C=1000, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.636, test=0.608) total time= 0.1s
[LibSVM][CV 4/5] END fit__C=1000, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.665, test=0.557) total time= 0.1s
[LibSVM][CV 5/5] END fit__C=1000, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.672, test=0.697) total time= 0.1s
[LibSVM][CV 1/5] END fit__C=1000, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.695, test=0.656) total time= 0.1s
[LibSVM][CV 2/5] END fit__C=1000, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.727, test=0.671) total time= 0.1s
[LibSVM][CV 3/5] END fit__C=1000, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.631, test=0.592) total time= 0.1s
[LibSVM][CV 4/5] END fit__C=1000, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.668, test=0.550) total time= 0.4s
[LibSVM][CV 5/5] END fit__C=1000, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.693, test=0.687) total time= 0.1s
[LibSVM][CV 1/5] END fit__C=1000, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.730, test=0.661) total time= 0.1s
[LibSVM][CV 2/5] END fit__C=1000, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.750, test=0.709) total time= 0.1s
[LibSVM][CV 3/5] END fit__C=1000, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.674, test=0.634) total time= 0.1s
[LibSVM][CV 4/5] END fit__C=1000, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.702, test=0.581) total time= 0.1s
[LibSVM][CV 5/5] END fit__C=1000, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.709, test=0.725) total time= 0.1s
[LibSVM][CV 1/5] END fit__C=100, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.031, test=0.031) total time= 0.1s
[LibSVM][CV 2/5] END fit__C=100, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.045, test=0.063) total time= 0.1s
[LibSVM][CV 3/5] END fit__C=100, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.026, test=0.066) total time= 0.1s
[LibSVM][CV 4/5] END fit__C=100, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.032, test=0.019) total time= 0.1s
[LibSVM][CV 5/5] END fit__C=100, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.031, test=0.020) total time= 0.1s
[LibSVM][CV 1/5] END fit__C=100, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.023, test=0.021) total time= 0.1s
[LibSVM][CV 2/5] END fit__C=100, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.035, test=0.054) total time= 0.1s
[LibSVM][CV 3/5] END fit__C=100, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.015, test=0.055) total time= 0.1s
[LibSVM][CV 4/5] END fit__C=100, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.020, test=0.008) total time= 0.1s
[LibSVM][CV 5/5] END fit__C=100, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.020, test=0.007) total time= 0.1s
[LibSVM][CV 1/5] END fit__C=1000, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.376, test=0.386) total time= 0.1s
[LibSVM][CV 2/5] END fit__C=1000, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.439, test=0.436) total time= 0.1s
[LibSVM][CV 3/5] END fit__C=1000, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.377, test=0.398) total time= 0.1s
[LibSVM][CV 4/5] END fit__C=1000, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.391, test=0.330) total time= 0.1s
[LibSVM][CV 5/5] END fit__C=1000, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.397, test=0.416) total time= 0.1s
[LibSVM][CV 1/5] END fit__C=1000, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.357, test=0.357) total time= 0.1s
[LibSVM][CV 2/5] END fit__C=1000, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.418, test=0.422) total time= 0.1s
[LibSVM][CV 3/5] END fit__C=1000, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.365, test=0.388) total time= 0.1s
[LibSVM][CV 4/5] END fit__C=1000, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.361, test=0.301) total time= 0.1s
[LibSVM][CV 5/5] END fit__C=1000, fit__kernel=rbf, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.370, test=0.378) total time= 0.1s
[LibSVM][CV 1/5] END fit__C=100, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.117, test=0.110) total time= 0.1s
[LibSVM][CV 2/5] END fit__C=100, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.140, test=0.151) total time= 0.1s
[LibSVM][CV 3/5] END fit__C=100, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.100, test=0.128) total time= 0.1s
[LibSVM][CV 4/5] END fit__C=100, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.107, test=0.077) total time= 0.1s
[LibSVM][CV 5/5] END fit__C=100, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.118, test=0.108) total time= 0.1s
[LibSVM][CV 1/5] END fit__C=100, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.108, test=0.101) total time= 0.1s
[LibSVM][CV 2/5] END fit__C=100, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.123, test=0.139) total time= 0.1s
[LibSVM][CV 3/5] END fit__C=100, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.088, test=0.116) total time= 0.1s
[LibSVM][CV 4/5] END fit__C=100, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.096, test=0.068) total time= 0.1s
[LibSVM][CV 5/5] END fit__C=100, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.105, test=0.096) total time= 0.1s
[LibSVM][CV 1/5] END fit__C=1000, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.511, test=0.495) total time= 0.1s
[LibSVM][CV 2/5] END fit__C=1000, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.555, test=0.551) total time= 0.1s
[LibSVM][CV 3/5] END fit__C=1000, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.474, test=0.448) total time= 0.1s
[LibSVM][CV 4/5] END fit__C=1000, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.493, test=0.428) total time= 0.1s
[LibSVM][CV 5/5] END fit__C=1000, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.512, test=0.539) total time= 0.1s
[LibSVM][CV 1/5] END fit__C=1000, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.515, test=0.497) total time= 0.1s
[LibSVM][CV 2/5] END fit__C=1000, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.552, test=0.554) total time= 0.1s
[LibSVM][CV 3/5] END fit__C=1000, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.485, test=0.454) total time= 0.1s
[LibSVM][CV 4/5] END fit__C=1000, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.498, test=0.429) total time= 0.1s
[LibSVM][CV 5/5] END fit__C=1000, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.508, test=0.537) total time= 0.1s
----------
iter: 1
n_candidates: 8
n_resources: 5502
Fitting 5 folds for each of 8 candidates, totalling 40 fits
[LibSVM][CV 1/5] END fit__C=1000, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.462, test=0.459) total time= 1.6s
[LibSVM][CV 2/5] END fit__C=1000, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.471, test=0.526) total time= 1.6s
[LibSVM][CV 3/5] END fit__C=1000, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.471, test=0.475) total time= 1.6s
[LibSVM][CV 4/5] END fit__C=1000, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.449, test=0.487) total time= 1.5s
[LibSVM][CV 5/5] END fit__C=1000, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.471, test=0.453) total time= 1.6s
[LibSVM][CV 1/5] END fit__C=1000, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.503, test=0.510) total time= 1.6s
[LibSVM][CV 2/5] END fit__C=1000, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.520, test=0.561) total time= 1.7s
[LibSVM][CV 3/5] END fit__C=1000, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.527, test=0.538) total time= 1.7s
[LibSVM][CV 4/5] END fit__C=1000, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.499, test=0.529) total time= 1.6s
[LibSVM][CV 5/5] END fit__C=1000, fit__kernel=sigmoid, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.508, test=0.493) total time= 2.0s
[LibSVM][CV 1/5] END fit__C=1000, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.462, test=0.614) total time= 1.5s
[LibSVM][CV 2/5] END fit__C=1000, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.610, test=0.621) total time= 1.9s
[LibSVM][CV 3/5] END fit__C=1000, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.631, test=0.651) total time= 1.9s
[LibSVM][CV 4/5] END fit__C=1000, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.466, test=0.623) total time= 1.3s
[LibSVM][CV 5/5] END fit__C=1000, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.588, test=0.579) total time= 1.3s
[LibSVM][CV 1/5] END fit__C=1000, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.472, test=0.626) total time= 1.3s
[LibSVM][CV 2/5] END fit__C=1000, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.620, test=0.633) total time= 1.6s
[LibSVM][CV 3/5] END fit__C=1000, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.647, test=0.659) total time= 1.5s
[LibSVM][CV 4/5] END fit__C=1000, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.454, test=0.631) total time= 1.3s
[LibSVM][CV 5/5] END fit__C=1000, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.600, test=0.589) total time= 1.3s
[LibSVM][CV 1/5] END fit__C=1000, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.653, test=0.641) total time= 1.3s
[LibSVM][CV 2/5] END fit__C=1000, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.681, test=0.651) total time= 1.3s
[LibSVM][CV 3/5] END fit__C=1000, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.686, test=0.544) total time= 1.3s
[LibSVM][CV 4/5] END fit__C=1000, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.656, test=0.639) total time= 1.4s
[LibSVM][CV 5/5] END fit__C=1000, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.614, test=0.604) total time= 1.3s
[LibSVM][CV 1/5] END fit__C=1000, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.668, test=0.630) total time= 1.4s
[LibSVM][CV 2/5] END fit__C=1000, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.702, test=-2.949) total time= 1.9s
[LibSVM][CV 3/5] END fit__C=1000, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.705, test=0.667) total time= 1.8s
[LibSVM][CV 4/5] END fit__C=1000, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.675, test=0.652) total time= 1.6s
[LibSVM][CV 5/5] END fit__C=1000, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.625, test=0.421) total time= 1.6s
[LibSVM][CV 1/5] END fit__C=1000, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.679, test=0.659) total time= 1.3s
[LibSVM][CV 2/5] END fit__C=1000, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.711, test=0.599) total time= 1.3s
[LibSVM][CV 3/5] END fit__C=1000, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.718, test=0.641) total time= 1.3s
[LibSVM][CV 4/5] END fit__C=1000, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.677, test=0.666) total time= 1.3s
[LibSVM][CV 5/5] END fit__C=1000, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.640, test=0.624) total time= 1.4s
[LibSVM][CV 1/5] END fit__C=1000, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.702, test=0.379) total time= 1.5s
[LibSVM][CV 2/5] END fit__C=1000, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.735, test=-21.032) total time= 1.7s
[LibSVM][CV 3/5] END fit__C=1000, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.740, test=0.703) total time= 1.6s
[LibSVM][CV 4/5] END fit__C=1000, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.695, test=0.679) total time= 1.6s
[LibSVM][CV 5/5] END fit__C=1000, fit__coef0=1, fit__degree=4, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.652, test=0.633) total time= 1.5s
----------
iter: 2
n_candidates: 3
n_resources: 16506
Fitting 5 folds for each of 3 candidates, totalling 15 fits
[LibSVM][CV 1/5] END fit__C=1000, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.448, test=0.590) total time= 12.7s
[LibSVM][CV 2/5] END fit__C=1000, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.486, test=0.598) total time= 13.3s
[LibSVM][CV 3/5] END fit__C=1000, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.521, test=0.601) total time= 13.1s
[LibSVM][CV 4/5] END fit__C=1000, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.383, test=-11.461) total time= 13.1s
[LibSVM][CV 5/5] END fit__C=1000, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=True;, score=(train=0.410, test=0.542) total time= 12.6s
[LibSVM][CV 1/5] END fit__C=1000, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.469, test=0.600) total time= 13.1s
[LibSVM][CV 2/5] END fit__C=1000, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.501, test=0.609) total time= 13.0s
[LibSVM][CV 3/5] END fit__C=1000, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.527, test=0.607) total time= 12.7s
[LibSVM][CV 4/5] END fit__C=1000, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.370, test=-12.619) total time= 12.8s
[LibSVM][CV 5/5] END fit__C=1000, fit__kernel=linear, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.402, test=0.547) total time= 12.7s
[LibSVM][CV 1/5] END fit__C=1000, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.672, test=0.651) total time= 13.7s
[LibSVM][CV 2/5] END fit__C=1000, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.669, test=0.667) total time= 13.2s
[LibSVM][CV 3/5] END fit__C=1000, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.669, test=0.672) total time= 13.6s
[LibSVM][CV 4/5] END fit__C=1000, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.699, test=-180264.933) total time= 15.7s
[LibSVM][CV 5/5] END fit__C=1000, fit__coef0=1, fit__degree=3, fit__kernel=poly, transform__hma__bohe_or_std__bin_it=False;, score=(train=0.668, test=0.596) total time= 14.0s
[LibSVM]Mean Squared Error Score: 6823074121.209386
Mean Absolute Error Score: 50832.242638637625
R2 Score Score: 0.49576756131798916
Explained Variance Score: 0.5111093523715503
Mean Pinball Loss Score: 25416.121319318812
D2 Pinball Score: 0.42883877853872576
D2 Absolute Error Score: 0.42883877853872576

<Figure size 640x480 with 0 Axes>

fig, ax = plt.subplots(1,1,layout="constrained")
ax.plot(y_test,y_test,c='k')
ax.scatter(y_test,pred,c='r',marker="+")
plt.show()
out[28]
Jupyter Notebook Image

<Figure size 640x480 with 1 Axes>

from sklearn.ensemble import IsolationForest

out = col_transformer.fit_transform(X_train)
clf = IsolationForest(random_state=random_state).fit(out)
predictions = clf.predict(out)
out[29]

<Figure size 640x480 with 0 Axes>

print("I still am not really sure where I am going wrong here")
out[30]

I still am not really sure where I am going wrong here