BSA08_SVM-Classification.ipynb 패키지 호출 import pandas as pd import numpy as np import matplotlib.pyplot as plt from IPython.display import Image %matplotlib inline import sklearn from sklearn import datasets from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler from sklearn.svm import SVC from sklearn.metrics import accuracy_score # !pip install mlxt..
BSA08_Kmean-Cluster.ipynb 패키지 호출 import numpy as np import pandas as pd from sklearn.preprocessing import scale from sklearn.datasets import load_iris from sklearn.cluster import KMeans from sklearn.metrics import silhouette_samples, silhouette_score from sklearn.mixture import GaussianMixture 데이터 불러오기 iris = load_iris() iris_df = pd.DataFrame(data=iris.data, columns=["sepal_length","sepal_width..
BSA08_Tree_Ensemble.ipynb 패키지 호출 import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import statsmodels.formula.api as smf from statsmodels.graphics.mosaicplot import mosaic from sklearn.model_selection import train_test_split from sklearn import tree from sklearn.tree import export_graphviz from sklearn.metrics import roc_auc_score from sklearn.metrics i..
BSA08_Sklearn-ClassificationTree.ipynb 패키지 호출 from sklearn.datasets import load_iris from sklearn import tree # !pip install pydotplus import pydotplus from IPython.display import Image ## !pip install graphviz import pandas as pd import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import graphviz #from sklearn.tree import DecisionTreeRegressor, DecisionTreeClassifier, ex..
BSA08_Pyspark-Logistic.ipynb 패키지 호출 및 스파크 세션 시작 from pyspark.sql import SparkSession from pyspark.sql.types import StringType from pyspark.ml.feature import StringIndexer, OneHotEncoder from pyspark.ml.feature import VectorAssembler from pyspark.ml.classification import LogisticRegression from pyspark.ml.evaluation import BinaryClassificationEvaluator spark = SparkSession.builder.appName("churn"..
BSA08_Pyspark-Regress-Whitewine.ipynb 패키지 호출 및 스파크 세션 시작 from pyspark.sql import SparkSession from pyspark.ml.feature import VectorAssembler from pyspark.ml.regression import LinearRegression spark = SparkSession.builder.appName("wine").getOrCreate() 데이터 불러오기 white = spark.read.csv("white.csv",inferSchema=True,header=True) white.show() 설명변수, 반응변수 분리 설명변수 = list(white.columns) 설명변수 = 설명변수[0:-1] 변..