Repository: evidentlyai/evidently
Issue: AttributeError using Column_mapping
Root cause: Documentation Deficiency

Hi Emily,
The code below generates an attribute error. I can't see any errors in my code as I was following the examples.
If I've made a simple mistake somewhere my apologies in advance.

Elvy

import pandas as pd
from sklearn import datasets

from evidently.dashboard import Dashboard

from evidently.dashboard.tabs import DataDriftTab, CatTargetDriftTab


from evidently.model_profile import Profile
from evidently.model_profile.sections import DataDriftProfileSection, \
CatTargetDriftProfileSection, NumTargetDriftProfileSection

#***********************************************************************

import warnings
warnings.filterwarnings('ignore')
warnings.simplefilter('ignore')

#***********************************************************************
boston =  datasets.load_boston()
boston_frame = pd.DataFrame(boston.data, columns = boston.feature_names)
boston_frame['target'] = boston.target
boston_frame.head()

#***********************************************************************

# Using column mapping in evidently report with Boston dataset

# column mapping
column_mapping = {}

column_mapping['target'] = 'target'
column_mapping['prediction'] = None
column_mapping['datetime'] = None

column_mapping['numerical_features'] = ['CRIM','ZN','INDUS','NOX',
                                        'RM','AGE','PTRATIO','B','LSTAT']
column_mapping['categorical_features'] = ['CHAS','RAD']

#***********************************************************************
# Data and target drift dashboard

boston_data_and_target_drift_dashboard = Dashboard(tabs=[DataDriftTab(),
                                                         NumTargetDriftProfileSection()])
boston_data_and_target_drift_dashboard.calculate(boston_frame[:200],boston_frame[200:],
                                                 column_mapping = column_mapping
                                                )

boston_data_and_target_drift_dashboard.save("./Reports/boston_report.html")

#***********************************************************************

The above code generates an error
AttributeError: 'dict' object has no attribute 'datetime'

Have I missed something?

Hi @ManunEbo, apologies for taking the time to respond here. 

We have recently updated the API, an replaced the `Dashboard` object with `Report`.  There is also a single `TargetDriftPreset` instead of two different reports for Categorical and Numerical target drift.   

You will need to change your code slightly.

Here you can see the example:  
https://github.com/evidentlyai/evidently/blob/main/examples/sample_notebooks/evidently_metric_presets.ipynb

Please let us know if you continue having issues when following this example.

Hi Elena,
I'll have a look into this soon and get back to you on it.
When I was working on regression model performance reporting side of things, I also noticed that you don't report RMSE or MSE but instead you report ME, MAE, MAPE.

Personally, I prefer MSE and RMSE even if there is inherent bias, penalization or lack there of.
Simply because it is a metric that most people are familiar with. And whether you use one metric 
or another, the intrinsic meaning is very much the same: the lower the value the better.

I hope this is helpful

Regards

Elvy

Hi @ManunEbo, if you want to get RMSE, it is also available in the library. Right now, it only appears in the JSON or Python dictionary output. Here is how you can call the set of available regression quality metrics that are calculated together:

```
regression_report = Report(metrics=[
    RegressionQualityMetric() 
])

regression_report.run(reference_data=housing_ref, current_data=housing_cur)
regression_report.as_dict()
```

If you want to visualize them in the Evidently interface right now, it requires changing the render of the metric in the code. But we'll soon add a more simple parameter on how to choose which exact metrics to display. 

Indeed there are many metrics and reasons to prefer one over another, so we want to enable full flexibility here in addition to reasonable defaults. 
 

Hello @elenasamuylova,
My apology for the late reply. 
I'll take a look at this soon :)

I completely understand: full flexibility on the metrics would be great but Rome wasn't built in a day.
It's a brilliant product and I'm looking forwards to exploring the many ways I can make use of it
:)

Warm regards

Elvy

Thanks @ManunEbo, let us know if there are any more bugs you face or feature requests. Work in progress indeed 👩‍🔧 

@elenasamuylova will do!
:)