Professional Documents
Culture Documents
Experiment: 2.1
version()
#titanicDataSet = pd.read_csv("myFile.csv")
3.10 Three lines of code for model comparison for “Insurance” dataset
from pycaret.datasets import get_data
insuranceDataSet = get_data("insurance")
cm = compare_models()
University Institute of Engineering
Department of Computer Science & Engineering
3.11 Three lines of code for model comparison for “House” dataset
from pycaret.datasets import get_data
houseDataSet = get_data("house")
cm = compare_models()
University Institute of Engineering
Department of Computer Science & Engineering
Regression: Advance-1
3.12 model performance using data Normalisatiom
s = setup(data = titanicDataSet, target = 'Survived', normalize = True, normalize_method ='zscore', silent
= True)
University Institute of Engineering
Department of Computer Science & Engineering
cm = compare_models()
University Institute of Engineering
Department of Computer Science & Engineering
cm = compare_models()
University Institute of Engineering
Department of Computer Science & Engineering
cm = compare_models()
University Institute of Engineering
Department of Computer Science & Engineering
cm = compare_models()
University Institute of Engineering
Department of Computer Science & Engineering
cm = compare_models()
University Institute of Engineering
Department of Computer Science & Engineering
cm = compare_models()
University Institute of Engineering
Department of Computer Science & Engineering
Regression: Advance-2
3.19 building a single model Random Forest
from pycaret.datasets import get_data
titanicDataSet = get_data("titanic")
rfModel = create_model('rf')
newPredictions
University Institute of Engineering
Department of Computer Science & Engineering
predicted = newPredictions.iloc[:,-1]
plt.scatter(actual, predicted)
plt.xlabel('Predicted')
plt.ylabel('Actual')
plt.title('Actual vs Predicted')
plt.show()
University Institute of Engineering
Department of Computer Science & Engineering
rf = create_model('rf')
plot_model(rf, plot='learning')
Feature Importance
University Institute of Engineering
Department of Computer Science & Engineering
plot_model(rfModel, plot='feature')
plot_model(etModel, plot='feature')
University Institute of Engineering
Department of Computer Science & Engineering
plot_model(dtModel, plot='feature')
University Institute of Engineering
Department of Computer Science & Engineering