This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import dataset from pycaret repository | |
from pycaret.datasets import get_data | |
insurance = get_data('insurance') | |
# Initialize environment | |
from pycaret.regression import * | |
r1 = setup(insurance, target = 'charges', session_id = 123, | |
normalize = True, | |
polynomial_features = True, trigonometry_features = True, | |
feature_interaction=True, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.7 | |
RUN pip install virtualenv | |
ENV VIRTUAL_ENV=/venv | |
RUN virtualenv venv -p python3 | |
ENV PATH="VIRTUAL_ENV/bin:$PATH" | |
WORKDIR /app | |
ADD . /app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.7 | |
RUN pip install virtualenv | |
ENV VIRTUAL_ENV=/venv | |
RUN virtualenv venv -p python3 | |
ENV PATH="VIRTUAL_ENV/bin:$PATH" | |
WORKDIR /app | |
ADD . /app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pycaret.clustering import * | |
clu1 = setup(data, ignore_features = ['Country Name', 'Indicator Name']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import regression module | |
from pycaret.regression import * | |
# init setup | |
reg1 = setup(data, target = 'charges', silent=True, | |
categorical_features=['sex', 'smoker', 'region', 'children'], | |
numeric_features=['age', 'bmi']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#tune with default n_iter i.e. 10 | |
tuned_dt1 = tune_model('dt') | |
#tune with n_iter = 50 | |
tuned_dt2 = tune_model('dt', n_iter = 50) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tuned_lda = tune_model(model='lda', supervised_target='status', estimator='xgboost') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Importing dataset | |
from pycaret.datasets import get_data | |
credit = get_data('credit') | |
# Importing module and initializing setup | |
from pycaret.classification import * | |
clf1 = setup(data = credit, target = 'default') | |
# create a model | |
xgboost = create_model('xgboost') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
predict_model(xgboost, probability_threshold=0.2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import classification module | |
from pycaret.classification import * | |
# init setup | |
clf1 = setup(data, target = 'name-of-target') | |
# return best model | |
best = compare_models() | |
# return best model based on Recall |
OlderNewer