اذهب إلى المحتوى

Ali Ahmed55

الأعضاء
  • المساهمات

    1641
  • تاريخ الانضمام

  • تاريخ آخر زيارة

  • عدد الأيام التي تصدر بها

    11

كل منشورات العضو Ali Ahmed55

  1. تمام جدا بس حتي لو المطلوب هو التنبوء بقيمه الefs ؟
  2. السلام عليكم هو اي الفرق مابين GPU T4 * 2 - GPU P100 - TPU vm v3-8 ؟
  3. يعني الكود ده مبتدي تمام # Construct # Separate features (X) and target variables (y) x = data_train.drop(['efs', 'efs_time'], axis=1, inplace=False) # Features (all columns except 'efs' and 'efs_time') y_event = data_train['efs'] # First target variable (event outcome) y_time = data_train['efs_time'] # Second target variable (event time) # Step 1: Split data into 70% training and 30% temporary set (which will be further split) x_train, x_temp, y_event_train, y_event_temp, y_time_train, y_time_temp = train_test_split(x, y_event, y_time, test_size=0.3, random_state=42) # Step 2: Split the temporary set into 15% validation (dev) and 15% test x_dev, x_test, y_event_dev, y_event_test, y_time_dev, y_time_test = train_test_split(x_temp, y_event_temp, y_time_temp, test_size=0.5, random_state=42) # Print dataset sizes for verification #print(f"X_train: {x_train.shape}, x_dev: {x_dev.shape}, X_test: {x_test.shape}") #print(f"y_event_train: {y_event_train.shape}, y_event_dev: {y_event_dev.shape}, y_event_test: {y_event_test.shape}") #print(f"y_time_train: {y_time_train.shape}, y_time_dev: {y_time_dev.shape}, y_time_test: {y_time_test.shape}") NUM_DURATIONS = 10 # Step 3: Apply standard scaling to the features to standardize the data scaler = StandardScaler() # Initialize the scaler x_train_scaled = scaler.fit_transform(x_train) # Fit the scaler on the training data and transform it x_test_scaled = scaler.transform(x_test) # Transform the test data based on the scaler fit on the training data # Define the input dimension based on the number of features in the training data input_dim = x_train_scaled.shape[1] # Define the input layer with the shape matching the feature dimension inputs = keras.layers.Input(shape=(input_dim,)) # Add the first dense layer with 128 neurons and ReLU activation # This layer processes the input data to extract complex features x = keras.layers.Dense(128, activation='relu')(inputs) x = keras.layers.BatchNormalization()(x) # Add the second dense layer with 64 neurons and ReLU activation # This further processes the output from the previous layer to capture more intricate patterns x = keras.layers.Dense(64, activation='relu')(x) x = keras.layers.BatchNormalization()(x) # Add the third dense layer with 32 neurons and ReLU activation # This layer continues refining the learned features from the previous layers x = keras.layers.Dense(32, activation='relu')(x) # The output layer for predicting the time-to-event intervals, using the 'softmax' activation function. # This allows the model to predict the probability distribution over multiple time bins (e.g., different durations). output_time = keras.layers.Dense(1, activation='relu', name='time-output')(x) # The output layer for predicting the event outcome (e.g., whether the event occurred or was censored), # using the 'sigmoid' activation function. This gives a probability value between 0 and 1. output_event = keras.layers.Dense(1, activation='sigmoid', name='event-output')(x) # Constructing the final model, which takes the 'inputs' and outputs both the time-to-event predictions # and the event predictions. This is a multi-output model designed for survival analysis tasks. deep_hit_model = keras.models.Model(inputs=inputs, outputs=[output_time, output_event]) # Compiling the Keras model with the specified optimizer, loss function, and metrics deep_hit_model.compile( optimizer = tf.keras.optimizers.AdamW( learning_rate=0.001, weight_decay=0.004, beta_1=0.9, beta_2=0.999, epsilon=1e-07, amsgrad=False, clipnorm=None, clipvalue=None, global_clipnorm=None, use_ema=False, ema_momentum=0.99, ema_overwrite_frequency=None, loss_scale_factor=None, gradient_accumulation_steps=None, name='adamw',), loss = {"time-output": "mean_squared_error", "event-output": "mean_squared_error"}, metrics = {"time-output": "mean_absolute_error", "event-output": "mean_absolute_error"} ) # Training the Keras model with the specified data, epochs, batch size, and callbacks deep_hit_model.fit( x_train_scaled, {"time-output": y_time_train, "event-output": y_event_train}, validation_data=(x_test_scaled, {"time-output": y_time_test, "event-output": y_event_test}), epochs=50, batch_size=128, callbacks=[keras.callbacks.EarlyStopping(monitor="val_loss", patience=10, restore_best_weights=True)] )
  4. تمام الحمد الله الان انا اصلان مطلوب مني تنبوء مش تصتيف جزاالله كل خير
  5. السلام عليكم هو عشان استخدم نموذج الDeepHit الازم احول عمود الefs_time الي فئات ؟ او الازم ان تكون المكشله مشكله تصنيف مش هينفع يكون تنبوء ؟
  6. اه يعني انا كده تمام علي المتغيرات دي x_train, x_temp, y_event_train, y_event_temp, y_time_train, y_time_temp = train_test_split(x, y_event, y_time, test_size=0.3, random_state=42)
  7. ايوه انا عارف المكتبه دي وستخدمتها في التحليل البيانات الف شكراا جدا لحضرتك جزاك الله كل خير
  8. السلام عليكم هي وظيفة train_test_split تأخذ فقط أربعة متغيرات (المميزات والهدف) ؟
  9. السلام عليكم هو اي الفرق مابين التنبوء والتصنيف والاحتمالات عند بناء نموذج ذكاء اصطناعي ؟
  10. طيب الحمدالله ده الفضل يرجع الربنا سبحان وتعالي وي من بعدو انتو والله كل فريق اكادميه حسوب يعني ديمين وفقين معي فا الف شكرااا جدا لحضرتكم
  11. الف شكراا جدا لحضرتك جزاك الله كل خير
  12. السلام عليكم انا ابعتلي الرساله دي Congratulations, you're now a Kaggle Contributor!
  13. السلام عليكم هو اسهل طريقه الاستخدم نموذج DeepHit يعني هل يوجد اطار عمل او مكتبه متخصص لنموذج ده؟
  14. تمام جدا الف شكرااا جدا لحضرتكم جزاكم الله كل خير
  15. السلام عليكم هو عشان اثبيت مكتبه في Kaggle Notebook Editor بستخدم اي امر من دول ؟ ده pip install numpy والا ده !pip install numpy
  16. تمام جدا الف شكراا جدا لحضرتك جزاك الله كل خير
  17. اي ده يعني اي يعني مش اعراف استخدم مكتبه زي lifelines عشان كده لم استخدم الsave version مش بيحفظ حاجه ؟
  18. ايوه بس مش كده مش هشتيغل ازي هيتشغل من عير نيت ؟
  19. السلام عليكم هو لو عندي قيمه من 0.0 الي 2.0 واستخدم الIterativeImputer طلع غير القيمه دي ولكن في نفس الفتره يعني مثل 0.1و 1.8 هل ده يكون طبيعه والا دي بيانات مش دقيق ؟ ودي البيانات قبل iterativelmputer hla_match_c_high 2.0 18565 1.0 5536 0.0 79 Name: count, dtype: int64 ودي بعد استخدم الIterativelmputer hla_match_c_high 2.0 18973 1.0 5566 1.6 1334 1.5 1042 1.7 547 1.8 418 1.4 239 1.3 206 1.2 149 0.0 86 1.9 75 1.1 68 0.9 28 0.8 20 0.7 16 0.4 8 0.1 7 0.5 6 0.2 5 0.3 4 0.6 3 Name: count, dtype: int64
  20. تمام بس انا عملت الكود ده بس رجع القيم كلها كا float مش عارف ليه ؟ min_values = data.min().values max_values = data.max().values ايوه بس بردو القيمه كلها عبار عن float بس في اعمده من نوع int ازي اخلي الint يكون زي ماهو والfloat يكون زي ما هو
  21. السلام عليكم هو انا ازي اقدر اتعلمل مع خاصيه الmin_value و الmax_value في الIterativeImputer ؟ مع العلم ان فيه اعميد كثير جدا 60عمود مختلف جدا
×
×
  • أضف...