-
Notifications
You must be signed in to change notification settings - Fork 0
/
model_packages.py
149 lines (106 loc) · 3.62 KB
/
model_packages.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
import warnings
warnings.filterwarnings("ignore")
import os
import glob
import random
import pandas as pd
import numpy as np
from numpy.random import seed
from numpy.random import randn
from numpy import percentile
import sys
print(sys.executable)
import pickle
from pickle import dump
from functools import reduce
import warnings
warnings.filterwarnings('ignore')
from matplotlib import cm
from matplotlib import lines as lines
import matplotlib.colors as colors
from matplotlib import style
from matplotlib import pyplot as plt
import folium
from folium.plugins import HeatMap
from folium import plugins
import scipy as sp
from scipy import spatial
from scipy.stats import linregress
from scipy.interpolate import interp1d
from scipy import stats
import plotly.graph_objects as go
from plotly.subplots import make_subplots
import plotly.figure_factory as ff
import plotly.express as px
import plotly.graph_objects as go
from statsmodels.tsa.seasonal import seasonal_decompose
import statsmodels.formula.api as smf
import statsmodels.api as sm
from statsmodels.stats.outliers_influence import variance_inflation_factor
import graphviz as gr
from linearmodels.datasets import wage_panel
from linearmodels.panel import PanelOLS
from sklearn.cluster import KMeans
from sklearn.metrics import mean_squared_error
from sklearn.model_selection import train_test_split, ShuffleSplit
from sklearn.preprocessing import MinMaxScaler, StandardScaler, RobustScaler
from sklearn.metrics import mean_squared_error,median_absolute_error, r2_score
from sklearn.pipeline import make_pipeline, Pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.base import TransformerMixin, BaseEstimator
from sklearn.ensemble import RandomForestRegressor
from sklearn.compose import make_column_transformer,TransformedTargetRegressor
from sklearn.preprocessing import OneHotEncoder
from sklearn.model_selection import GridSearchCV, RandomizedSearchCV, cross_validate, RepeatedKFold, cross_val_score
from sklearn import metrics
from sklearn.linear_model import Ridge, Lasso, LinearRegression, ElasticNet
from sklearn.compose import TransformedTargetRegressor
from sklearn import datasets, linear_model
from sklearn.linear_model import LinearRegression
from sklearn.neighbors import NearestNeighbors
from matplotlib import pyplot as plt
from sklearn import cluster
from sklearn.decomposition import PCA
from sklearn.manifold import TSNE
from hdbscan import HDBSCAN
from sklearn.cluster import DBSCAN
from sklearn.cluster import AgglomerativeClustering
import lxml
import calendar
import collections
# Graphics
import seaborn as sns
from pysal.viz import splot
from splot.esda import plot_moran
from pysal.explore import esda
from pysal.lib import weights
import contextily
import shapely
from shapely.geometry import Polygon
# Analysis and ML model building
import geopandas as gpd
import fiona
from tsmoothie.smoother import *
from tsmoothie.utils_func import create_windows
from tsmoothie.utils_func import sim_randomwalk, sim_seasonal_data
from tqdm import tqdm
import shap
import pingouin as pg
import osmnx as ox
from factor_analyzer import FactorAnalyzer
from datetime import datetime
from meteostat import Point, Daily, Monthly, Stations
from geographiclib.geodesic import Geodesic
import time
import branca
import branca.colormap as cm
from pycaret.regression import *
#from pycaret.classification import *
from pycaret.regression import load_model
# Confirm Pycaret version is 2.1
from pycaret.utils import version
print('Confirm Pycaret version is ?')
print('Pycaret Version: ', version())
import pathlib
from itertools import cycle
import dataframe_image as dfi