<jupyter_start><jupyter_text>**shear_range: Float. Shear Intensity (Shear angle in counter-clockwise direction in degrees) | Sair diyor ki; float deger alir. kesme yogunlugu yani oransal girili ve saat yonunun tersine shear acisi alir****zoom_range: Float or [lower, upper]. Range for random zoom. If a float, [lower, upper] = [1-zoom_range, 1+zoom_range].** -> **object** : the Keras Object model.-> **generator** : a generator whose output must be a list of the form:                      - (inputs, targets)                          - (input, targets, sample_weights)a single output of the generator makes a single batch and hence all arrays in the list must be having the length equal to the size of the batch. The generator is expected to loop over its data infinite no. of times, it should never return or exit.-> **steps_per_epoch** : it specifies the total number of steps taken from the generator   as soon as one epoch is finished and next epoch has started. We can calculate the valueof steps_per_epoch as the total number of samples in your dataset divided by the batch size.-> **Epochs** : an integer and number of epochs we want to train our model for.-> **Verbose** : specifies verbosity mode(0 = silent, 1= progress bar, 2 = one line per epoch).-> **callbacks** : a list of callback functions applied during the training of our model.-> **validation_data** can be either:                      - an inputs and targets list                      - a generator                      - an inputs, targets, and sample_weights list which can be used to evaluate                        the loss and metrics for any model after any epoch has ended.-> **validation_steps** :only if the validation_data is a generator then only this argumentcan be used. It specifies the total number of steps taken from the generator before it is stopped at every epoch and its value is calculated as the total number of validation data pointsin your dataset divided by the validation batch size.<jupyter_code>from keras.preprocessing.image import ImageDataGenerator
trainDatagen = ImageDataGenerator(rescale = 1./255,
                                  shear_range = 0.2, # yana bukme     
                                  zoom_range = 0.2,       
                                  horizontal_flip = True)

testDatagen = ImageDataGenerator(rescale = 1./255,
                                  shear_range = 0.2,      
                                  zoom_range = 0.2,       
                                  horizontal_flip = True) 

trainingSet = trainDatagen.flow_from_directory(
    'veriler/training_set',
    target_size = (64, 64),
    batch_size = 2,
    class_mode = 'binary'
)

testSet = trainDatagen.flow_from_directory(  # bu bize (x, y) don durur bu da -> (batch_size, **target_size, channels) ve y
    'veriler/test_set',
    target_size = (64, 64),
    batch_size = 2,
    class_mode = 'binary'
)

model.fit_generator(
    generator = trainingSet,                          # okudugumuz degeri   
    steps_per_epoch = len(trainingSet),               # her epoch da okunacak ornek
    epochs = 1,                                      # kac epoch istedigimiz
    validation_data = testSet,                        # dogrulama  verileri
    validation_steps = len(testSet)/2                 #  
)
import pandas as pd 
import numpy as np

testSet.reset()
pred = model.predict_generator(testSet, verbose = 1)

pred[pred > 0.5] = 1
pred[pred <= 0.5] = 0

testLabel = []
for i in range(len(testSet)):
    testLabel.extend(np.array(testSet[i][1])) # yukarida anlattim y kismi burada doner. (In the section directoryiterator)

#print(testSet.filenames)
d = {'dosyaIsimleri' : testSet.filenames, 'tahminler' : pred.tolist() , 'test' : testLabel}
cikti = pd.DataFrame(d)
cikti
"""**Confision Matrix**"""
from sklearn.metrics import confusion_matrix

cm = confusion_matrix(testLabel, pred)
cm
(cm[0, 0] + cm[1, 1])/sum(cm.reshape(-1, 1))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08461732760798181, 'fraction_numerical': 0.01187168476888103, 'mean_word_length': 2.5740072202166067, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '63286', 'license': 'MIT', 'n_tokens_mistral': 1152, 'n_tokens_neox': 1098, 'n_words': 425, 'path': 'CNN.ipynb', 'repo_name': 'grkmkctrk/btkMLCNN', 'size': '3959'}