1.תרגיל כיתה ניתוח וניבוי קובצי אקסל על ידי בינה מלאכותית CHATGPT וקוד פייטון נשווה מה יותר טוב וקל
1.1 טען את קובץ הקסל ונתח את שמות העמודות
1.2 הסבר מה תפקיד של כל עמודה
1.3 מתצא על יד טבלת חום את הקורלציות בין העמודות
1.4 מהם 4 הקורלציות החזקות ביותר ומה החלשות ביותר שמשפיעות על המחיר
ניבוי
1.5 נבא בעזרת בינה מלאכותית מה יהיה המחיר של בית של 4000 מרובע , 5 חדרים
1.6 מה הממצוע של מחיר של בתים באותה קטגוריה של 5 חדרים
שיפור וניבוי
1.7 אם הבית יעבור שיפוץ קל והגול ישנתה מ 4000 ל 4400 ו יהיה לו עוד חדר כמה יעלה השיווי החדש לש הנכס ?
1.8 נתח בצורה דומה את הנתונים של של מלאי – הורד את הקובץ
2. ניתוח קובץ PDF והשוואה בין מחקרים שונם – נחקור את החילבה
- הורד את המאמרים הבאים ל PDF
https://www.mdpi.com/1422-0067/24/18/13999
https://www.mdpi.com/1648-9144/59/2/248
2. נתח את המאמרים יחד
2.1 מה עוסקים המאמרים מה מסקנות המאמר
2.2 כמה זמן לקחו הניסויים
2.3 הצג בטבלה בקצרה את קבוצות המדגם בכל נסוי
2.5 סכם עד 30 מילים מסקנות המאמר , במה יש קשר חזק או חלש לצרכיבת חילבה ובמה מועיל
מאיפה אפשר להוריד נתונים :
- Kaggle – אתר זה מציע מגוון רחב של מערכי נתונים בתחומים רבים. האתר משמש לתחרויות בתחום מדעי הנתונים ולמידת מכונה, והוא מקור מצוין למציאת נתונים לפרויקטים אישיים ומחקריים.
- UCI Machine Learning Repository – אוסף של מסדי נתונים, תיאוריות בתחומים ומחוללי נתונים הנמצאים בשימוש נרחב בקהילת למידת המכונה לניתוח ניסיוני של אלגוריתמים.
- Google Dataset Search – כלי חיפוש של גוגל שמאפשר למצוא מערכי נתונים המאוחסנים ברחבי האינטרנט. הוא מאפשר למצוא נתונים במגוון תחומים ולגשת אליהם בקלות.
- GitHub – בפלטפורמה זו תוכל למצוא מאגרים של קוד שלעיתים כוללים גם מערכי נתונים שמשמשים לפרויקטים בתחום למידת מכונה ומדעי הנתונים.
3. ניתוח על ידי קוד Python and a.i
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# Import necessary libraries import pandas as pd import seaborn as sns import matplotlib.pyplot as plt # File name (ensure the file is in the current directory) file_name = 'USA-Housing-Dataset1.csv' # Check if the file exists in the current directory import os if os.path.exists(file_name): print("File found. Loading dataset...") data = pd.read_csv(file_name) else: raise FileNotFoundError(f"File '{file_name}' not found in the current directory.") # Display the first few rows to understand the structure print("\nDataset Preview:") print(data.head()) # Remove rows where 'price-usd' is zero or negative if 'price-usd' in data.columns: data = data[data['price-usd'] > 0] else: raise ValueError("'price-usd' column not found in the dataset.") # Display basic statistics print("\nDataset Statistics:") print(data.describe()) # Select numeric columns for correlation analysis numeric_features = data.select_dtypes(include=['float64', 'int64']).columns # Correlation matrix correlation_matrix = data[numeric_features].corr() # Plot heatmap of correlation matrix plt.figure(figsize=(10, 8)) sns.heatmap(correlation_matrix, annot=True, fmt='.2f', cmap='coolwarm', cbar=True) plt.title('Correlation Heatmap') plt.show() # Analyze correlation with house price if 'price-usd' in correlation_matrix.columns: price_correlation = correlation_matrix['price-usd'].sort_values(ascending=False) print("\nCorrelation with 'price-usd':") print(price_correlation) # Scatter plots for top correlated features top_features = price_correlation.index[1:4] # Select top 3 features excluding 'price-usd' for feature in top_features: plt.figure(figsize=(6, 4)) sns.scatterplot(data=data, x=feature, y='price-usd') plt.title(f"Price vs {feature}") plt.xlabel(feature) plt.ylabel('Price (USD)') plt.show() else: raise ValueError("'price-usd' not found in correlation matrix.") # Save the correlation matrix to a CSV file correlation_output_path = 'correlation_matrix.csv' correlation_matrix.to_csv(correlation_output_path) print(f"Correlation matrix saved to: {correlation_output_path}") # Provide download link for the saved correlation matrix from google.colab import files files.download(correlation_output_path) |
USA Housing Dataset1
אימון בינה מלאכותית רשתות ניירונים
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# Install TensorFlow if not already installed import tensorflow as tf from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler import pandas as pd import matplotlib.pyplot as plt import numpy as np # File name (ensure it's uploaded in Colab or in the current working directory) file_name = 'USA-Housing-Dataset1.csv' # Load the dataset data = pd.read_csv(file_name) # Preview the dataset print("\nDataset Preview:") print(data.head()) # Remove rows where 'price-usd' is zero or negative data = data[data['price-usd'] > 0] # Drop irrelevant or unnamed columns data = data.loc[:, ~data.columns.str.contains('^Unnamed')] # Feature selection and target variable X = data.drop(columns=['price-usd']) # Independent variables y = data['price-usd'] # Target variable # Check column names print("\nFeature columns used for training:") print(list(X.columns)) # Train-test split X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42) # Feature scaling for X (input features) scaler_X = StandardScaler() X_train = scaler_X.fit_transform(X_train) X_test = scaler_X.transform(X_test) # Normalize the target variable (y) scaler_y = StandardScaler() y_train = scaler_y.fit_transform(y_train.values.reshape(-1, 1)) y_test = scaler_y.transform(y_test.values.reshape(-1, 1)) # Define the ANN model with an additional layer model = Sequential([ Dense(128, activation='relu', input_dim=X_train.shape[1]), # First hidden layer with 128 neurons Dense(64, activation='relu'), # Second hidden layer with 64 neurons Dense(32, activation='relu'), # Third hidden layer with 32 neurons Dense(1) # Single output for normalized price prediction ]) # Compile the model model.compile(optimizer='adam', loss='mean_squared_error', metrics=['mean_absolute_error']) # Train the model with 400 epochs history = model.fit( X_train, y_train, validation_split=0.2, epochs=400, batch_size=32, verbose=1 ) # Plot training and validation loss if 'loss' in history.history and 'val_loss' in history.history: plt.figure(figsize=(10, 6)) plt.plot(history.history['loss'], label='Training Loss', marker='o') plt.plot(history.history['val_loss'], label='Validation Loss', marker='o') plt.title('Loss During Training') plt.xlabel('Epoch') plt.ylabel('Loss') plt.legend() plt.grid() plt.show() else: print("Loss or validation loss data not found in history.history.") # Predict house price with specified features sample_data = pd.DataFrame({ 'bedrooms': [5], # Number of bedrooms 'bathrooms': [3], # Number of bathrooms 'sqft_living': [4000], # Living area in square feet }) # Fill missing columns with median values missing_columns = set(X.columns) - set(sample_data.columns) for col in missing_columns: sample_data[col] = data[col].median() # Replace with median or other default value # Reorder columns to match training data sample_data = sample_data[X.columns] # Scale the sample data sample_data_scaled = scaler_X.transform(sample_data) # Predict the normalized price normalized_prediction = model.predict(sample_data_scaled) # Convert the normalized prediction back to the original scale predicted_price = scaler_y.inverse_transform(normalized_prediction) print(f"Predicted price for a house with 5 bedrooms, 3 bathrooms, and 4000 sqft living area: ${predicted_price[0][0]:,.2f}") # Debugging outputs print("\nSample Data After Processing:") print(sample_data) print("\nSample Data After Scaling:") print(sample_data_scaled) print("\nNormalized Prediction:") print(normalized_prediction) print("\nDenormalized Prediction (Original Scale):") print(predicted_price) |
4. עריכת תמונה ושימוש בתתוכנת לעריכת וידאו
4.1 נלמד בכיתה יחד על תוכנה שמקבילה ל פוטושופ
5.יצירת סיפור ב CANVA או אנימציה
5.1 צור סיפור ב CHATGPT ב 6 שקפים או נושא וידאו
5.1.1 מה כותרת הנושא של הסיפור
5.2 צור תמונות בהתאם מאתר – היכנס או צור שם משתמש
https://create.microsoft.com/en-us/features/ai-image-generator
https://www.clipfly.ai/video-ai/ai-video-generator/create-v1/
5. תרגיל כיתה משותף יצירת שירים ללימוד לוח הכפל
עליך לכתוב שיר בבינה מלאכותית ,
5.1 צור שיר שעוזר לילדים לללמוד את הכפולולת של לוח הכפל.
5.2 כל קבוצה עושה כפל סל סיפרה אחרת למשל קובצה 1 שיר ללימוד לוח הכפל של הסיפרה 8 שיהיה בו גם חרוזים הלחן אותו בעזרת SUNO
5.2 העלות את כל השירים לאתר תחת הכותרת לדוגמא : לימוד לוח הכפל בשיר סיפרה 8
למשל :
כתוב באנגלית ובעברית והשווה
שיר חרוזי הכפל של שמונה
שמונה כפול 1 זה שמונה,
לזכור זה קל, כמו דג שוחה.
שמונה כפול 2 זה שש-עשרה,
המספר זורח, כמו שמש בקסם.
שמונה כפול 3 זה עשרים וארבע,
תשנן את החרוז, כי הוא לא נעלם.
שמונה כפול 4 זה שלושים ושתיים,
חרוז נחמד, עוזר בשניים.
שמונה כפול 5 זה ארבעים,
הכפל הולך, כמו שיר נעים.
שמונה כפול 6 זה ארבעים ושמונה,
מספר מושלם, זורם כמו מים.
שמונה כפול 7 זה חמישים ושש,
החרוז יזכיר, אל תתייאש.
שמונה כפול 8 זה שישים וארבע,
המנגינה קלה, כמו חליל שנשמע.
שמונה כפול 9 זה שבעים ושתיים,
לומדים ברצף, עם המון שמיים.
שמונה כפול 10 זה שמונים,
עכשיו נשיר, ונהיה מבסוטים!
לוח הכפל של שמונה חרוז ומנגינה,
כיף ללמוד – זה עושה הרגשה נהדרת בלב ובנשמה!
6. תרגול רשתות ניירונים colab – זיהו כתב יד
סרטון שלבים :
סוג רשת:
רשת נוירונים קונבולוציונלית (CNN) – מתאימה במיוחד לעיבוד תמונות.
סוג בסיס הנתונים:
MNIST – מאגר נתונים של ספרות בכתב יד (0–9), בגודל 28×28 פיקסלים בגווני אפור.
מה הקוד עושה:
- טוען ומעבד את הנתונים.
- בונה, מאמן ובודק רשת CNN לזיהוי ספרות.
- מציג גרפים של ביצועי המודל (דיוק ואובדן).
- בוחר ספרות רנדומליות ומציג את התוצאה האמיתית והתחזית של המודל.
6.1 המרצה יעבור בכיתה על הקוד בקצרה .
6.2 מתקדם צור תמונה 28 על 28 פיקסלים כתוב את הסיפרה 3 שמור בשים 3a.jpg
6.2.1 העלה את התמונה ל קולאב
6.2.2 הוסף לקוד הנוכחי בעזרת שבודק מבצע PREDICTION לקוד הקיים עבור הסיפרה בתמונה
3a.jpg
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# Install TensorFlow if not already installed !pip install tensorflow import tensorflow as tf from tensorflow.keras import layers, models import matplotlib.pyplot as plt import numpy as np # Load the MNIST dataset mnist = tf.keras.datasets.mnist (x_train, y_train), (x_test, y_test) = mnist.load_data() # Normalize the data x_train, x_test = x_train / 255.0, x_test / 255.0 # Expand dimensions for channel x_train = x_train[..., tf.newaxis] x_test = x_test[..., tf.newaxis] # Build the CNN model model = models.Sequential([ layers.Conv2D(32, kernel_size=(3, 3), activation='relu', input_shape=(28, 28, 1)), layers.MaxPooling2D(pool_size=(2, 2)), layers.Conv2D(64, kernel_size=(3, 3), activation='relu'), layers.MaxPooling2D(pool_size=(2, 2)), layers.Flatten(), layers.Dense(128, activation='relu'), layers.Dense(10, activation='softmax') ]) # Compile the model model.compile(optimizer='adam', loss='sparse_categorical_crossentropy', metrics=['accuracy']) # Train the model history = model.fit(x_train, y_train, epochs=10, validation_data=(x_test, y_test)) # Evaluate the model test_loss, test_accuracy = model.evaluate(x_test, y_test) print(f"Test accuracy: {test_accuracy}") # Plot training and validation accuracy plt.plot(history.history['accuracy'], label='Training Accuracy') plt.plot(history.history['val_accuracy'], label='Validation Accuracy') plt.xlabel('Epoch') plt.ylabel('Accuracy') plt.legend() plt.show() # Plot training and validation loss plt.plot(history.history['loss'], label='Training Loss') plt.plot(history.history['val_loss'], label='Validation Loss') plt.xlabel('Epoch') plt.ylabel('Loss') plt.legend() plt.show() # Display 4 random images from the training set with labels and pixel size print("\n4 Random Training Images and Labels:") for _ in range(4): idx = np.random.randint(0, len(x_train)) image, label = x_train[idx].squeeze(), y_train[idx] print(f"Label: {label}, Pixel size: {image.shape}") plt.imshow(image, cmap='gray') plt.title(f"Label: {label}") plt.axis('off') plt.show() # Predict 4 random test images and display predictions print("\nPredictions for 4 Random Test Images:") for _ in range(4): idx = np.random.randint(0, len(x_test)) image, label = x_test[idx], y_test[idx] prediction = np.argmax(model.predict(image[np.newaxis, ...]), axis=-1) print(f"True Label: {label}, Predicted: {prediction[0]}") plt.imshow(image.squeeze(), cmap='gray') plt.title(f"True: {label}, Predicted: {prediction[0]}") plt.axis('off') plt.show() |
7. יצירת קוד תוכנה ואלקטרוניקה על ידי בינה מלאוכתית
https://wokwi.com/projects/399760959908478977
7.1 נתון התוכנה הבאה עבור גלאי מרחק בקש מ chatgp להוסיף קוד תוכנה עבור לד אדום לפין מספר 16 אם המרחק קטן מ 100 cm
יש להעתיק את קוד התכונה הקיים ולבקש בהבינה מלאכותית להוסיף קוד תוכנה
7.2 שים לב לחיבור הלד יש רגל ארוכה מחוברת לפין וקצרה- הוסף בעצמך
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
// www.robotronix.co.il // Distance sensor // learn arduino לימוד ארדואינו קורס C506 const int pingPin = 4; // Trigger Pin of Ultrasonic Sensor const int echoPin = 2; // Echo Pin of Ultrasonic Sensor void setup() { Serial.begin(9600); // Starting Serial Terminal } void loop() { long duration, inches, cm; pinMode(pingPin, OUTPUT); digitalWrite(pingPin, LOW); delayMicroseconds(2); digitalWrite(pingPin, HIGH); delayMicroseconds(10); digitalWrite(pingPin, LOW); pinMode(echoPin, INPUT); duration = pulseIn(echoPin, HIGH); inches = microsecondsToInches(duration); cm = microsecondsToCentimeters(duration); // Serial.print(inches); // Serial.print("in, "); Serial.print(cm); Serial.print("cm"); Serial.println(); delay(250); } long microsecondsToInches(long microseconds) { return (microseconds / 74 / 2); } long microsecondsToCentimeters(long microseconds) { return (microseconds / 29 / 2); } |
software defined radio
sdr
sdr בעולם ההבטחה – בדיקת בטיחות נגד תקיפות
יסודות בינה מלאכותית : 11-RB27 – תרגול