# -*- coding: utf-8 -*- """python code.ipynb Automatically generated by Colab. Original file is located at https://colab.research.google.com/drive/1mxH3vDVZ4xyhu0NpmolxTWit0ZAkxG3V """ import matplotlib.pyplot as plt import pandas as pd import numpy as np # Read data from CSV file csv_file_path = 'datasets.csv' data = pd.read_csv(csv_file_path) # Categories (Cryptocurrencies) for x-axis categories = [ '1INCHBUSD', 'ADXBUSD', 'ALICEBUSD', 'ANKRBUSD', 'ASTRBUSD', 'AUTOBUSD', 'BANDBUSD', 'BIFIBUSD', 'BSWBUSD', 'CAKEBUSD', 'CREAMBUSD', 'CKBBUSD', 'CVPBUSD', 'DENTBUSD', 'DOCKBUSD', 'ELFBUSD', 'FARMBUSD', 'FLOWBUSD', 'GALBUSD', 'GTOBUSD', 'ICXBUSD', 'IOTABUSD', 'LAZIOBUSD', 'LTCBUSD', 'MATICBUSD', 'MINABUSD', 'MULTIBUSD', 'OCEANBUSD', 'OOKIBUSD', 'PHABUSD', 'POWRBUSD', 'REIBUSD', 'RVNBUSD', 'SKLBUSD', 'STEEMBUSD', 'SUNBUSD', 'THETABUSD', 'TRIBUSD', 'UMABUSD', 'UNFIUSD', 'WAVESBUSD', 'WNXMBUSD', 'XVGBUSD', 'YFIBUSD', 'ZILBUSD', 'ADABUSD', 'ANKRBUSD', 'ASTRBUSD', 'AUTOUSD', 'BATBUSD' ] # Random example data for bars cross_over = np.random.randint(0, 21, size=len(categories)) ma44 = np.random.randint(0, 21, size=len(categories)) x = np.arange(len(categories)) # the label locations width = 0.35 # the width of the bars fig, ax = plt.subplots(figsize=(14, 8)) rects1 = ax.bar(x - width/2, cross_over, width, label='CrossOver') rects2 = ax.bar(x + width/2, ma44, width, label='MA44') # Add some text for labels, title and custom x-axis tick labels, etc. ax.set_xlabel('Coin') ax.set_ylabel('Values') ax.set_title('Distribution of Trading Strategies by Coin') ax.set_xticks(x) ax.set_xticklabels(categories, rotation=90) ax.set_yticks([0, 5, 10, 15, 20]) ax.legend() fig.tight_layout() plt.show() # Simulated coin names based on the image provided coins = ['GDAXBTC', 'BINAETH', 'BINAADA', 'GDAXETH', 'BINAXRP', 'BINABNB', 'GDAXLTC', 'BINALTC', 'BINATRX', 'BINAETC', 'GDAXBCH', 'GDAXETC', 'BINAQTUM', 'BINAOMG', 'BINAEOS', 'GDAXZRX', 'BINABAT', 'GDAXUSDC', 'BINAXLM', 'BINAONT', 'BINAIOTA', 'GDAXALGO', 'BINAATOM', 'BINANEOS', 'BINANEO', 'BINAVET', 'BINAIOST', 'BINAZEC', 'BINAELF', 'BINALINK', 'BINAVTH', 'GDAXDOGE', 'BINAANKR', 'BINATWT', 'BINASXP', 'BINASAND', 'GDAXTHETA', 'BINAUNI', 'BINAAAVE', 'BINACOMP', 'BINADOT', 'BINAALICE', 'BINASOL', 'BINAAVAX', 'GDAXSHIB'] # Generating mock data for CrossOver and MA44 strategies np.random.seed(0) # For reproducibility of the random data cross_over = np.random.randint(5, 25, size=len(coins)) ma44 = np.random.randint(1, 20, size=len(coins)) # Creating DataFrame df = pd.DataFrame({ 'Coin': coins, 'CrossOver': cross_over, 'MA44': ma44 }) # Plotting fig, ax = plt.subplots(figsize=(10, 5)) bar_width = 0.4 index = np.arange(len(df['Coin'])) # Assigning colors as per the original chart: blue for CrossOver and orange for MA44 bars1 = ax.bar(index - bar_width/2, df['CrossOver'], bar_width, color='blue', label='CrossOver') bars2 = ax.bar(index + bar_width/2, df['MA44'], bar_width, color='orange', label='MA44') # Set x and y axis labels, title, and legend, if needed (omitting here for exact match) ax.set_xticks(index) ax.set_xticklabels(df['Coin'], rotation=90) ax.set_ylim(0, 30) # Setting Y-axis to match the maximum value seen in the image # Removing titles and labels for an exact visual match ax.set_title('') ax.set_xlabel('') ax.set_ylabel('') ax.legend() # Include if the original has a legend plt.tight_layout() # Ensure no clipping of tick labels plt.show() # Original list of coin names from your input coins = ["ZILBUSD", "XVGBUSD", "XECBUSD", "WAVESBUSD", "UMABUSD", "TRBBUSD", "THETABUSD", "SUNBUSD", "STEEMBUSD", "SKLBUSD", "RVNBUSD", "REIBUSD", "QNTBUSD", "POWRBUSD", "PHABUSD", "OOKIBUSD", "OCEANBUSD", "MULTIBUSD", "MINABUSD", "MATICBUSD", "LTCBUSD", "LAZIOBUSD", "KAVABUSD", "IOTABUSD", "ICXBUSD", "GTOBUSD", "GALBUSD", "FLOWBUSD", "FARMBUSD", "ELFBUSD", "DOCKBUSD", "DENTBUSD", "CVPBUSD", "CREAMBUSD", "CKBBUSD", "CAKEBUSD", "BSWBUSD", "BIFIBUSD", "BANDBUSD", "AUTOBUSD", "ASTRBUSD", "ANKRBUSD", "ALICEBUSD", "ADXBUSUSD", "1INCHBUSD"] # Reversing the order of the coins coins.reverse() # Simulating random data for 'CrossOver' and 'MA44' strategies np.random.seed(0) cross_over_values = np.random.normal(0, 1, size=len(coins)) ma44_values = np.random.normal(0, 1, size=len(coins)) # Creating the line graph fig, ax = plt.subplots(figsize=(15, 6)) # Adjust the figure size as needed ax.plot(coins, cross_over_values, label='CrossOver', color='orange') ax.plot(coins, ma44_values, label='MA44', color='yellow') ax.set_xticks(np.arange(len(coins))) ax.set_xticklabels(coins, rotation=90) # Rotate the labels for better readability ax.set_ylim(-5, 2) # Set the Y-axis limit according to your requirements # Adding a legend ax.legend() plt.tight_layout() plt.show() # Original list of coin names from your input coins = ["ZILBUSD", "XVGBUSD", "XECBUSD", "WAVESBUSD", "UMABUSD", "TRBBUSD", "THETABUSD", "SUNBUSD", "STEEMBUSD", "SKLBUSD", "RVNBUSD", "REIBUSD", "QNTBUSD", "POWRBUSD", "PHABUSD", "OOKIBUSD", "OCEANBUSD", "MULTIBUSD", "MINABUSD", "MATICBUSD", "LTCBUSD", "LAZIOBUSD", "KAVABUSD", "IOTABUSD", "ICXBUSD", "GTOBUSD", "GALBUSD", "FLOWBUSD", "FARMBUSD", "ELFBUSD", "DOCKBUSD", "DENTBUSD", "CVPBUSD", "CREAMBUSD", "CKBBUSD", "CAKEBUSD", "BSWBUSD", "BIFIBUSD", "BANDBUSD", "AUTOBUSD", "ASTRBUSD", "ANKRBUSD", "ALICEBUSD", "ADXBUSUSD", "1INCHBUSD"] # Reversing the order of the coins coins.reverse() # Simulating random data for 'CrossOver' and 'MA44' strategies np.random.seed(0) cross_over_values = np.random.normal(0, 1, size=len(coins)) ma44_values = np.random.normal(0, 1, size=len(coins)) # Creating the line graph fig, ax = plt.subplots(figsize=(15, 6)) # Adjust the figure size as needed ax.plot(coins, cross_over_values, label='CrossOver', color='orange') ax.plot(coins, ma44_values, label='MA44', color='yellow') ax.set_xticks(np.arange(len(coins))) ax.set_xticklabels(coins, rotation=90) # Rotate the labels for better readability ax.set_ylim(-5, 2) # Set the Y-axis limit according to your requirements # Adding a legend ax.legend() plt.tight_layout() plt.show() # Assume some sort of time-like sequential data for the X-axis. We need to format these as seen. # Let's simulate a date range and then format it to look like '1.655T' etc. dates = pd.date_range(start='2024-01-01', periods=100, freq='T') formatted_dates = dates.strftime('%H.%M') + 'T' # Simulate the T label as seen # Simulate some data for Bollinger Bands and some other strategy ('GS') np.random.seed(0) price_data = np.random.normal(loc=0.08, scale=0.01, size=len(dates)) price_data += np.sin(np.linspace(0, 10, len(dates))) * 0.01 # Add some cyclicality # Create a DataFrame df = pd.DataFrame({ 'Time': formatted_dates, 'Price': price_data }) # Calculate moving average and Bollinger Bands df['Moving Average'] = df['Price'].rolling(window=20).mean() df['Upper Band'] = df['Moving Average'] + 2 * df['Price'].rolling(window=20).std() df['Lower Band'] = df['Moving Average'] - 2 * df['Price'].rolling(window=20).std() # Plotting fig, ax = plt.subplots(figsize=(10, 5)) ax.plot(df['Time'], df['Price'], label='Price', color='turquoise') ax.plot(df['Time'], df['Moving Average'], label='BOLL(close,20)', color='blue') ax.plot(df['Time'], df['Upper Band'], label='Upper Band', linestyle='--', color='darkblue') ax.plot(df['Time'], df['Lower Band'], label='Lower Band', linestyle='--', color='darkblue') # Set graph limits and ticks based on your image ax.set_xlim('1.655T', '1.657T') # Adjust as needed to match your exact ticks ax.set_ylim(0.05, 0.11) # Customizing tick marks and labels ax.set_xticks(np.linspace(0, len(df)-1, 5)) # 5 ticks as seen in your graph ax.set_xticklabels(['1.655T', '1.656T', '1.6565T', '1.657T', '1.6575T']) ax.set_title('IDEXBUSD Quant Figure') ax.set_xlabel('Time') ax.set_ylabel('Price') ax.legend() ax.grid(True) plt.tight_layout() plt.show() # Model names models = ['Logistic Regression', 'SVC', 'SGD', 'Gaussian Naive Bayes', 'Decision Tree', 'Extra Tree', 'Random Forest', 'Bagging', 'Gradient Boost', 'AdaBoost', 'Histogram Gradient Boost', 'XGBoost', 'Ridge Classifier', 'LDA', 'QDA'] # Randomly generated data for demonstration; replace with your actual data np.random.seed(0) accuracy = np.random.uniform(0.5, 1, len(models)) # Uniform distribution between 0.5 and 1 recall = np.random.uniform(0.5, 1, len(models)) f1_score = np.random.uniform(0.5, 1, len(models)) # The x locations for the groups x = np.arange(len(models)) # Width of the bars width = 0.25 fig, ax = plt.subplots(figsize=(14, 7)) rects1 = ax.bar(x - width, accuracy, width, label='Accuracy', color='orange') rects2 = ax.bar(x, recall, width, label='Recall', color='blue') rects3 = ax.bar(x + width, f1_score, width, label='F1-Score', color='green') # Add some text for labels, title and custom x-axis tick labels, etc. ax.set_xticks(x) ax.set_xticklabels(models, rotation=45, ha="right") ax.legend() fig.tight_layout() plt.show() # Creating a DataFrame from the provided data data = { 'Model': ['Logistic Regression', 'SVC', 'SGD', 'Gaussian Naive Bayes', 'KNeighbors Classifier', 'Decision Tree', 'Extra Tree', 'Random Forest', 'Bagging', 'Gradient Boosting', 'AdaBoost', 'HistGradientBoost', 'XGBoost', 'Ridge Classifier', 'LDA', 'QDA'], 'Accuracy': [0.35, 0.65, 0.59, 0.35, 0.66, 0.64, 0.60, 0.66, 0.65, 0.66, 0.67, 0.67, 0.67, 0.68, 0.62, 0.63], 'Recall': [0.31, 0.69, 0.60, 0.32, 0.59, 0.58, 0.58, 0.67, 0.62, 0.67, 0.64, 0.65, 0.63, 0.65, 0.66, 0.67], 'F1-Score': [0.34, 0.81, 0.56, 0.28, 0.69, 0.67, 0.67, 0.65, 0.61, 0.62, 0.62, 0.76, 0.64, 0.66, 0.66, 0.65] } df = pd.DataFrame(data) # Set the Model names as the index df.set_index('Model', inplace=True) # X values mapped to model indices x = np.arange(len(df)) # Plotting fig, ax = plt.subplots(figsize=(14, 7)) ax.plot(x, df['Accuracy'], marker='o', linestyle='-', color='orange', label='Accuracy') ax.plot(x, df['Recall'], marker='o', linestyle='-', color='green', label='Recall') ax.plot(x, df['F1-Score'], marker='o', linestyle='-', color='blue', label='F1-Score') ax.set_xticks(x) ax.set_xticklabels(df.index, rotation=45, ha="right") ax.legend() plt.tight_layout() plt.show() # Data from your table data = { 'Model': ['Logistic Regression', 'SVC', 'SGD', 'Gaussian Naive Bayes', 'KNeighbors Classifier', 'Decision Tree', 'Extra Tree', 'Random Forest', 'Bagging', 'Gradient Boosting', 'AdaBoost', 'HistGradientBoost', 'XGBoost', 'Ridge Classifier', 'LDA', 'QDA'], 'Accuracy': [0.57, 0.64, 0.45, 0.36, 0.61, 0.59, 0.61, 0.66, 0.61, 0.65, 0.63, 0.62, 0.64, 0.64, 0.63, 0.51], 'Recall': [0.57, 0.64, 0.45, 0.36, 0.61, 0.59, 0.61, 0.66, 0.61, 0.65, 0.74, 0.62, 0.64, 0.64, 0.63, 0.51], 'F1-Score': [0.63, 0.78, 0.35, 0.28, 0.73, 0.69, 0.71, 0.76, 0.70, 0.76, 0.62, 0.74, 0.75, 0.77, 0.76, 0.50] } # Convert data to DataFrame df = pd.DataFrame(data) # Plotting fig, ax = plt.subplots(figsize=(14, 8)) # Bar locations x = np.arange(len(df['Model'])) # the label locations width = 0.25 # the width of the bars # Create stacked bars rects1 = ax.bar(x, df['Accuracy'], width, label='Accuracy', color='orange') rects2 = ax.bar(x, df['Recall'], width, bottom=df['Accuracy'], label='Recall', color='blue') rects3 = ax.bar(x, df['F1-Score'], width, bottom=df['Accuracy'] + df['Recall'], label='F1-Score', color='green') # Add some text for labels, title and custom x-axis tick labels, etc. ax.set_ylabel('Scores') ax.set_title('Bar Chart On Model Performance with 80/20 Ratio') ax.set_xticks(x) ax.set_xticklabels(df['Model'], rotation=45, ha='right') ax.legend() # Setting Y-axis values as per your requirement ax.set_yticks([0, 0.5, 1, 1.5, 2]) fig.tight_layout() # adjust subplot parameters to give specified padding plt.show() # Data from your table data = { 'Model': ['Logistic Regression', 'SVC', 'SGD', 'Gaussian Naive Bayes', 'KNeighbors Classifier', 'Decision Tree', 'Extra Tree', 'Random Forest', 'Bagging', 'Gradient Boosting', 'AdaBoost', 'HistGradientBoost', 'XGBoost', 'Ridge Classifier', 'LDA', 'QDA'], 'Accuracy': [0.57, 0.64, 0.45, 0.36, 0.61, 0.59, 0.61, 0.66, 0.61, 0.65, 0.63, 0.62, 0.64, 0.64, 0.63, 0.51], 'Recall': [0.57, 0.64, 0.45, 0.36, 0.61, 0.59, 0.61, 0.66, 0.61, 0.65, 0.74, 0.62, 0.64, 0.64, 0.63, 0.51], 'F1-Score': [0.63, 0.78, 0.35, 0.28, 0.73, 0.69, 0.71, 0.76, 0.70, 0.76, 0.62, 0.74, 0.75, 0.77, 0.76, 0.50] } # Convert data to DataFrame df = pd.DataFrame(data) # Plotting fig, ax = plt.subplots(figsize=(14, 8)) # Line plots for each metric ax.plot(df['Model'], df['Accuracy'], marker='o', linestyle='-', color='orange', label='Accuracy') ax.plot(df['Model'], df['Recall'], marker='o', linestyle='-', color='blue', label='Recall') ax.plot(df['Model'], df['F1-Score'], marker='o', linestyle='-', color='green', label='F1-Score') ax.set_xticks(np.arange(len(df['Model']))) ax.set_xticklabels(df['Model'], rotation=45, ha='right') ax.set_ylim(0.3, 0.8) # Adjusting y-axis to match provided graph ax.legend() fig.tight_layout() # adjust subplot parameters to give specified padding plt.show() # Data from your table data = { 'Model': ['Logistic Regression', 'SVC', 'SGD', 'Gaussian Naive Bayes', 'KNeighborsClassifier', 'Decision Tree', 'Extra Tree', 'Random Forest', 'Bagging', 'Gradient Boosting', 'AdaBoast', 'HistGradientBoast', 'XGBOOST', 'Ridge Classifier', 'LDA', 'QDA'], 'Accuracy': [0.49, 0.49, 0.51, 0.51, 0.59, 0.72, 0.72, 0.78, 0.70, 0.71, 0.62, 0.75, 0.76, 0.60, 0.59, 0.53], 'Recall': [0.00, 0.00, 0.35, 1.00, 0.54, 0.63, 0.62, 0.76, 0.58, 0.66, 0.59, 0.71, 0.72, 0.53, 0.55, 0.99], 'F1-Score': [0.00, 0.01, 0.42, 0.68, 0.57, 0.70, 0.70, 0.78, 0.67, 0.70, 0.61, 0.75, 0.75, 0.57, 0.58, 0.68] } # Convert data to DataFrame df = pd.DataFrame(data) # Plotting fig, ax = plt.subplots(figsize=(14, 8)) # Bar locations x = np.arange(len(df['Model'])) # the label locations width = 0.35 # the width of the bars # Create stacked bars rects1 = ax.bar(x, df['Accuracy'], width, label='Accuracy', color='orange') rects2 = ax.bar(x, df['Recall'], width, bottom=df['Accuracy'], label='Recall', color='blue') rects3 = ax.bar(x, df['F1-Score'], width, bottom=df['Accuracy'] + df['Recall'], label='F1-Score', color='green') # Add some text for labels, title and custom x-axis tick labels, etc. ax.set_xticks(x) ax.set_xticklabels(df['Model'], rotation=45, ha='right') ax.legend() # Setting Y-axis values as per your requirement ax.set_yticks([0, 0.5, 1, 1.5, 2]) fig.tight_layout() # adjust subplot parameters to give specified padding plt.show() # Data from your table data = { 'Model': ['Logistic Regression', 'SVC', 'SGD', 'Gaussian Naive Bayes', 'KNeighborsClassifier', 'Decision Tree', 'Extra Tree', 'Random Forest', 'Bagging', 'Gradient Boosting', 'AdaBoast', 'HistGradientBoast', 'XGBOOST', 'Ridge Classifier', 'Linear Discriminant Analysis(LDA)', 'Quadratic Discriminant Analysis(QDA)'], 'Accuracy': [0.48, 0.48, 0.48, 0.48, 0.62, 0.71, 0.76, 0.80, 0.70, 0.72, 0.63, 0.78, 0.77, 0.61, 0.61, 0.55], 'Recall': [0.00, 0.00, 0.20, 1.00, 0.54, 0.62, 0.68, 0.70, 0.60, 0.67, 0.62, 0.75, 0.72, 0.50, 0.50, 0.99], 'F1-Score': [0.00, 0.01, 0.28, 0.01, 0.59, 0.69, 0.74, 0.78, 0.67, 0.70, 0.64, 0.78, 0.72, 0.57, 0.57, 0.69] } # Convert data to DataFrame df = pd.DataFrame(data) # Plotting fig, ax = plt.subplots(figsize=(14, 8)) # Bar locations x = np.arange(len(df['Model'])) # the label locations width = 0.35 # the width of the bars # Create stacked bars rects1 = ax.bar(x, df['Accuracy'], width, label='Accuracy', color='orange') rects2 = ax.bar(x, df['Recall'], width, bottom=df['Accuracy'], label='Recall', color='blue') rects3 = ax.bar(x, df['F1-Score'], width, bottom=df['Accuracy'] + df['Recall'], label='F1-Score', color='green') ax.set_xticks(x) ax.set_xticklabels(df['Model'], rotation=45, ha='right') ax.legend() # Setting Y-axis values as per your requirement ax.set_yticks([0, 0.5, 1, 1.5, 2]) fig.tight_layout() # adjust subplot parameters to give specified padding plt.show() # Data from your table data = { 'Model': ['Logistic Regression', 'SVC', 'SGD', 'Gaussian Naive Bayes', 'KNeighborsClassifier', 'Decision Tree', 'Extra Tree', 'Random Forest', 'Bagging', 'Gradient Boosting', 'AdaBoast', 'HistGradientBoast', 'XGBOOST', 'Ridge Classifier', 'Linear Discriminant Analysis(LDA)', 'Quadratic Discriminant Analysis(QDA)'], 'Accuracy': [0.48, 0.48, 0.48, 0.48, 0.62, 0.71, 0.76, 0.80, 0.70, 0.72, 0.63, 0.78, 0.77, 0.61, 0.61, 0.55], 'Recall': [0.00, 0.00, 0.20, 1.00, 0.54, 0.62, 0.68, 0.70, 0.60, 0.67, 0.62, 0.75, 0.72, 0.50, 0.50, 0.99], 'F1-Score': [0.00, 0.01, 0.28, 0.01, 0.59, 0.69, 0.74, 0.78, 0.67, 0.70, 0.64, 0.78, 0.72, 0.57, 0.57, 0.69] } # Convert data to DataFrame df = pd.DataFrame(data) # Plotting fig, ax = plt.subplots(figsize=(14, 8)) # Line plots for each metric ax.plot(df['Model'], df['Accuracy'], marker='o', linestyle='-', color='orange', label='Accuracy') ax.plot(df['Model'], df['Recall'], marker='o', linestyle='-', color='blue', label='Recall') ax.plot(df['Model'], df['F1-Score'], marker='o', linestyle='-', color='green', label='F1-Score') # Add some text for labels, title and custom x-axis tick labels, etc. ax.set_ylabel('Scores') ax.set_title('Scatter Chart For Balance Dataset With 80/20 Ratio') ax.set_xticks(np.arange(len(df['Model']))) ax.set_xticklabels(df['Model'], rotation=45, ha='right') ax.set_ylim(0, 1) # Adjusting y-axis to match provided graph ax.legend() fig.tight_layout() # adjust subplot parameters to give specified padding plt.show() # Data from your table data = { 'Model': ['Logistic Regression', 'SVC', 'KNeigboursClassifier', 'Decision Tree', 'Extra Tree', 'Random Forest', 'Bagging', 'AdaBoast', 'HistGradientBoast', 'XGBOOST'], 'Accuracy': [0.65, 0.65, 0.57, 0.65, 0.65, 0.64, 0.65, 0.65, 0.63, 0.65], 'Recall': [1.00, 1.00, 0.79, 1.00, 1.00, 0.99, 1.00, 1.00, 0.88, 1.00], 'F1-Score': [0.79, 0.79, 0.70, 0.79, 0.79, 0.78, 0.79, 0.79, 0.76, 0.79] } # Convert data to DataFrame df = pd.DataFrame(data) # Plotting fig, ax = plt.subplots(figsize=(14, 8)) # Bar locations x = np.arange(len(df['Model'])) # the label locations width = 0.35 # the width of the bars # Create stacked bars rects1 = ax.bar(x, df['Accuracy'], width, label='Accuracy', color='orange') rects2 = ax.bar(x, df['Recall'], width, bottom=df['Accuracy'], label='Recall', color='blue') rects3 = ax.bar(x, df['F1-Score'], width, bottom=df['Accuracy'] + df['Recall'], label='F1-Score', color='green') # Add some text for labels, title and custom x-axis tick labels, etc. ax.set_ylabel('Scores') ax.set_title('Bar Chart For Hyper-Parametrized Models With 70/30 Ratio') ax.set_xticks(x) ax.set_xticklabels(df['Model'], rotation=45, ha='right') ax.legend() # Setting Y-axis values as per your requirement ax.set_yticks([0, 0.5, 1, 1.5, 2, 2.5]) fig.tight_layout() # adjust subplot parameters to give specified padding plt.show() # Data from your table data = { 'Model': ['Logistic Regression', 'SVC', 'KNeigboursClassifier', 'Decision Tree', 'Extra Tree', 'Random Forest', 'Bagging', 'AdaBoast', 'HistGradientBoast', 'XGBOOST'], 'Accuracy': [0.65, 0.65, 0.57, 0.65, 0.65, 0.64, 0.65, 0.65, 0.63, 0.65], 'Recall': [1.00, 1.00, 0.79, 1.00, 1.00, 0.99, 1.00, 1.00, 0.88, 1.00], 'F1-Score': [0.79, 0.79, 0.70, 0.79, 0.79, 0.78, 0.79, 0.79, 0.76, 0.79] } # Convert data to DataFrame df = pd.DataFrame(data) # Plotting fig, ax = plt.subplots(figsize=(14, 8)) # Line plots for each metric ax.plot(df['Model'], df['Accuracy'], marker='o', linestyle='-', color='orange', label='Accuracy') ax.plot(df['Model'], df['Recall'], marker='o', linestyle='-', color='blue', label='Recall') ax.plot(df['Model'], df['F1-Score'], marker='o', linestyle='-', color='green', label='F1-Score') ax.set_xticks(np.arange(len(df['Model']))) ax.set_xticklabels(df['Model'], rotation=45, ha='right') ax.set_yticks([0.6, 0.7, 0.8, 0.9, 1.0]) # Setting the y-axis ticks as specified ax.set_ylim(0.55, 1.05) # Adjusting y-axis to match provided graph ax.grid(True) # Add grid for better visualization ax.legend() fig.tight_layout() # adjust subplot parameters to give specified padding plt.show() # Data from your table data = { 'Model': ['Logistic Regression', 'SVC', 'KNeigboursClassifier', 'Decision Tree', 'Extra Tree', 'Random Forest', 'Bagging', 'AdaBoast', 'HistGradientBoast', 'XGBOOST'], 'Accuracy': [0.70, 0.70, 0.63, 0.70, 0.70, 0.69, 0.70, 0.70, 0.63, 0.70], 'Recall': [0.84, 1.00, 0.80, 1.00, 1.00, 0.97, 1.00, 1.00, 0.88, 1.00], 'F1-Score': [0.76, 0.82, 0.75, 0.82, 0.82, 0.81, 0.82, 0.82, 0.75, 0.82] } # Convert data to DataFrame df = pd.DataFrame(data) # Plotting fig, ax = plt.subplots(figsize=(14, 8)) width = 0.6 # the width of the bars # Stacked bar chart ax.bar(df['Model'], df['Accuracy'], width, label='Accuracy', color='orange') ax.bar(df['Model'], df['Recall'], width, bottom=df['Accuracy'], label='Recall', color='blue') ax.bar(df['Model'], df['F1-Score'], width, bottom=df['Accuracy'] + df['Recall'], label='F1-Score', color='green') ax.set_xticks(np.arange(len(df['Model']))) ax.set_xticklabels(df['Model'], rotation=45, ha='right') ax.set_yticks([0.5, 1, 1.5, 2, 2.5]) ax.set_ylim(0, 2.5) ax.legend() fig.tight_layout() # adjust subplot parameters to give specified padding plt.show() # Data from your table data = { 'Model': ['Logistic Regression', 'SVC', 'SGD', 'Gaussian Naive Bayes', 'KNeighborsClassifier', 'Decision Tree', 'Extra Tree', 'Random Forest', 'Bagging', 'Gradient Boosting', 'AdaBoast', 'HistGradientBoast', 'XGBOOST', 'Ridge Classifier', 'LDA', 'QDA'], 'Accuracy': [0.49, 0.49, 0.51, 0.51, 0.59, 0.72, 0.72, 0.78, 0.70, 0.71, 0.62, 0.75, 0.76, 0.60, 0.59, 0.53], 'Recall': [0.00, 0.00, 0.35, 1.00, 0.54, 0.63, 0.62, 0.76, 0.58, 0.66, 0.59, 0.71, 0.72, 0.53, 0.55, 0.99], 'F1-Score': [0.00, 0.01, 0.42, 0.68, 0.57, 0.70, 0.70, 0.78, 0.67, 0.70, 0.61, 0.75, 0.75, 0.57, 0.58, 0.68] } # Convert data to DataFrame df = pd.DataFrame(data) # Plotting fig, ax = plt.subplots(figsize=(14, 8)) # Line plots for each metric ax.plot(df['Model'], df['Accuracy'], marker='o', linestyle='-', color='orange', label='Accuracy') ax.plot(df['Model'], df['Recall'], marker='o', linestyle='-', color='blue', label='Recall') ax.plot(df['Model'], df['F1-Score'], marker='o', linestyle='-', color='green', label='F1-Score') # Add some text for labels, title and custom x-axis tick labels, etc. ax.set_ylabel('Scores') ax.set_title('Scatter Chart For Balance Dataset With 70/30 Ratio') ax.set_xticks(np.arange(len(df['Model']))) ax.set_xticklabels(df['Model'], rotation=45, ha='right') ax.set_ylim(0, 1) # Adjusting y-axis to match provided graph ax.legend() fig.tight_layout() # adjust subplot parameters to give specified padding plt.show()