**Getting Started with Auto ML from Flammable**
In this tutorial, we will explore how to quickly implement a regression or classification model using the Auto ML library from Flammable on Google Colab. With just three lines of code, you can switch between regression and classification models and leverage standard functions from scikit-learn to perform data split and calculate performance metrics.
**Loading the Iris Data Set**
To begin, we load the Iris data set from the Flammable library. We use `load_iris()` function to load the dataset. This data set is a classic multi-class classification problem, where we need to predict one of three species: setosa, versicolor, or virginica.
```python
import flambal as fl
from sklearn.model_selection import train_test_split
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_style("whitegrid")
```
**Making Prediction**
Next, we make a prediction using the Auto ML library from Flammable. We use `make_prediction()` function to make predictions on our dataset.
```python
# Make prediction
y_train_pred = fl.make_prediction(X_train, y_train)
```
**Calculating Model Performance Metrics**
We calculate the model performance metrics using standard functions from scikit-learn. In this case, we calculate the Matthews correlation coefficient (MCC) which is a measure of the accuracy of our classification model.
```python
# Calculate MCC
from sklearn.metrics import matthews_corrcoef
mcc = matthews_corrcoef(y_train, y_train_pred)
print("MCC: ", mcc)
```
**Creating a Scatter Plot**
We create a scatter plot to visualize our predictions. We use `sns.scatterplot()` function to create the scatter plot.
```python
# Create scatter plot
plt.figure(figsize=(10, 6))
sns.scatterplot(x=y_train[:, 0], y=y_train_pred, hue=y_train)
plt.title("Iris Data Set Scatter Plot")
plt.xlabel("Feature 1")
plt.ylabel("Predicted Value")
plt.show()
```
**Boston Housing Data Set**
Next, we load the Boston housing data set from Flammable. We use `load_boston_housing()` function to load the dataset.
```python
# Load Boston Housing Data Set
X_train, y_train = fl.load_boston_housing()
```
**Making Prediction on Boston Housing Data Set**
We make a prediction using the Auto ML library from Flammable. We use `make_prediction()` function to make predictions on our dataset.
```python
# Make prediction
y_train_pred = fl.make_prediction(X_train, y_train)
```
**Calculating Model Performance Metrics on Boston Housing Data Set**
We calculate the model performance metrics using standard functions from scikit-learn. In this case, we calculate the R-squared value which is a measure of how well our regression model fits the data.
```python
# Calculate R-squared value
from sklearn.metrics import r2_score
r2 = r2_score(y_train, y_train_pred)
print("R-squared Value: ", r2)
```
**Creating a Scatter Plot on Boston Housing Data Set**
We create a scatter plot to visualize our predictions. We use `sns.scatterplot()` function to create the scatter plot.
```python
# Create scatter plot
plt.figure(figsize=(10, 6))
sns.scatterplot(x=y_train[:, 0], y=y_train_pred, hue=y_train)
plt.title("Boston Housing Data Set Scatter Plot")
plt.xlabel("Feature 1")
plt.ylabel("Predicted Value")
plt.show()
```
**Conclusion**
In this tutorial, we demonstrated how to quickly implement a regression or classification model using the Auto ML library from Flammable on Google Colab. We loaded the Iris data set and made predictions using the `make_prediction()` function. We calculated the Matthews correlation coefficient (MCC) which is a measure of the accuracy of our classification model. We also created a scatter plot to visualize our predictions. Similarly, we loaded the Boston housing data set and made predictions using the `make_prediction()` function. We calculated the R-squared value which is a measure of how well our regression model fits the data. We also created a scatter plot to visualize our predictions.