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 numpy as np | |
import open3d as o3d | |
import open3d_tutorial as o3dtut | |
#get mesh data | |
bunny = o3d.data.BunnyMesh() | |
mesh = o3d.io.read_triangle_mesh(bunny.path) | |
#visualize mesh | |
mesh.scale(1 / np.max(mesh.get_max_bound() - mesh.get_min_bound()), |
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 lightgbm as lgb | |
from sklearn.model_selection import GridSearchCV | |
param_grid = { | |
'objective': ["binary"], | |
'metric': ['binary_logloss'], | |
'boosting': ['gbdt','dart'], | |
'lambda_l1': [0, 0.1, 0.01], | |
'bagging_fraction': [0.7, 0.9], | |
'bagging_freq': [0,1], |
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 abc import ABC, abstractmethod | |
class IObservable(ABC): | |
@abstractmethod | |
def subscribe(self, observer): | |
"""subscription""" | |
@abstractmethod | |
def unsubscribe(self, observer): |
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 os | |
import pandas as pd | |
import numpy as np | |
np.set_printoptions(precision=4) | |
import catboost | |
print(catboost.__version__) | |
#dataset | |
from catboost.datasets import amazon |
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 numpy as np | |
from collections import Counter | |
class Knn: | |
def __init__(self, k=5): | |
self.k = k | |
def fit(self,X,y): | |
self.X_train = X |
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
// to start a spark session | |
import org.apache.spark.sql.SparkSession | |
// to use lineer regression model | |
import org.apache.spark.ml.regression.LinearRegression | |
//set logging to level of ERROR | |
import org.apache.log4j._ | |
Logger.getLogger("org").setLevel(Level.ERROR) | |
//start a spark Session |
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 pandas as pd | |
import matplotlib.pyplot as plt | |
from sklearn.pipeline import make_pipeline | |
from sklearn.naive_bayes import GaussianNB | |
from sklearn.preprocessing import QuantileTransformer | |
from sklearn.metrics import roc_curve, auc | |
plt.style.use('bmh') | |
plt.rcParams['figure.figsize'] = (10, 10) | |
title_config = {'fontsize': 20, 'y': 1.05} |
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 nltk | |
nltk.download('stopwords') | |
import pandas as pd | |
import numpy as np | |
from nltk.corpus import stopwords | |
import string | |
from sklearn.feature_extraction.text import CountVectorizer | |
from sklearn.preprocessing import LabelBinarizer | |
from sklearn.model_selection import train_test_split | |
from sklearn.naive_bayes import MultinomialNB |
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 abc import ABC, abstractmethod | |
class Ticket(ABC): | |
def method(self): | |
#read plate | |
plate = self.read_plate() | |
#check record | |
record = self.check_record(plate) | |
#decide price |
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 xgboost as xgb | |
import numpy as np | |
from sklearn.datasets import make_regression, make_gaussian_quantiles | |
from sklearn.metrics import mean_squared_error, confusion_matrix | |
from sklearn.model_selection import train_test_split | |
#REGRESSION | |
#generate regression data | |
X, y, _ = make_regression(n_samples=10000,#number of samples | |
n_features=10,#number of features |