```from sklearn.datasets import load_boston
df = pd.DataFrame(boston_data.data , columns = boston_data.feature_names)
df
x = df
y = boston_data.target
x.columns
reg.fit(x,y)
from sklearn.model_selection import train_test_split
x_train, x_test, y_train, y_test = train_test_split(x, y)
reg.fit(x_train, y_train)
predicted = reg.predict(x_test)
expected = y_test```

How to I compare the predicted and expected values to understand the model?

Jul 14, 2019
recategorized Sep 7, 2020 12,644 views
on basis of RMS value how would i know the accuracy of my model

In RMSE, the errors are squared before they are averaged. This basically implies that RMSE assigns a higher weight to larger errors. This indicates that RMSE is much more useful when large errors are present and they drastically affect the model's performance. It avoids taking the absolute value of the error and this trait is useful in many mathematical calculations. In this metric also, the lower the value, the better is the performance of the model.

## 1 answer to this question.

The predict() function returns a plain numpy array you can just represent it in a tabular format with original value to see the difference.

To check the accuracy of your model you can check out the RMS value. You can calculate RMS using the below code.

```import numpy as np
print("RMS: %r " % np.sqrt(np.mean((predicted - expected) ** 2)))```
answered Jul 14, 2019 by Tina

## How to calculate ctc probability for given input and expected output?

The loss for a batch is defined ...READ MORE

## Alternatives to linear regression for dataset with many points with small value and some extreme values

The above situation is the case where ...READ MORE

## How to add random and/or fixed effects into cloglog regression in R

The standard glm function can be used ...READ MORE

## Ignore the NaN and do the linear regression on remaining values

Yes, you can do this using statsmodels: import ...READ MORE

## How do I convert a pandas dataframe to a numpy array using python?

Try something like this: df.values array([[nan, 0.2, nan], ...READ MORE

+1 vote

## how can i randomly select items from a list?

You can also use the random library's ...READ MORE

+1 vote

## how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE