Kayıtlar

Ekim, 2023 tarihine ait yayınlar gösteriliyor

Decision Trees

 import numpy as np import matplotlib.pyplot as plt from public_tests import * from utils import * %matplotlib inline X_train = np.array([[1,1,1],[1,0,1],[1,0,0],[1,0,0],[1,1,1],[0,1,1],[0,0,0],[1,0,1],[0,1,0],[1,0,0]]) y_train = np.array([1,1,0,0,1,0,0,1,1,0]) print("First few elements of X_train:\n", X_train[:5]) print("Type of X_train:",type(X_train)) print("First few elements of y_train:", y_train[:5]) print("Type of y_train:",type(y_train)) print ('The shape of X_train is:', X_train.shape) print ('The shape of y_train is: ', y_train.shape) print ('Number of training examples (m):', len(X_train)) def compute_entropy(y):     """     Computes the entropy for           Args:        y (ndarray): Numpy array indicating whether each example at a node is            edible (`1`) or poisonous (`0`)             Returns:         entropy (flo...

Tree ensembles

Resim
  import numpy as np import pandas as pd from sklearn.tree import DecisionTreeClassifier from sklearn.ensemble import RandomForestClassifier from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score from xgboost import XGBClassifier import matplotlib.pyplot as plt plt.style.use('./deeplearning.mplstyle') RANDOM_STATE = 55 ## We will pass it to every sklearn call so we ensure reproducibility # Load the dataset using pandas df = pd.read_csv("heart.csv") df.head() cat_variables = ['Sex', 'ChestPainType', 'RestingECG', 'ExerciseAngina', 'ST_Slope' ] # This will replace the columns with the one-hot encoded ones and keep the columns outside 'columns' argument as it is. df = pd.get_dummies(data = df,                          prefix = cat_variables,                          columns = cat_variables) df.head() features = [x fo...

Mechanical Intern at ASELSAN

Resim
      METU Department of Mechanical Engineering ME 400 Summer Practice Report                                                     August 11, 20 I hereby declare that all information in this document has been obtained and presented in accordance with academic rules and ethical conduct. I also declare that, as require by these rules and conduct, I have fully cited and referenced all material and results that are not original to this work.         Name, Last Name          : Emir Fatih Demir   Signature             :    TABLE OF CONTENTS Contents 1.      Introduction . 4 2.      Description of the company . 6 1.   ...