Giter Site home page Giter Site logo

Mission-driven to maximize decision intelligence.

Open to collaboration on data science / data analysis projects. Gmail LinkedIn

   Army Career                                                                        More Recently

Work Experience Wordclouds

Wordcloud code

# Import necessary libraries/modules
import textract from nltk.corpus import stopwords from nltk.tokenize import word_tokenize, sent_tokenize import re from wordcloud import WordCloud

# Extract text from the document text = textract.process('/Users/chris/Desktop/Army.docx')

# Filter out character codewords cleaned_text = re.sub(r'\(n|xe2|x80|x99|t|xc2)', '', str(text))

# Tokenize the words in the text tokens = word_tokenize(cleaned_text)

# Tokenizing the sentences in the text sentences = sent_tokenize(cleaned_text)

# Remove stopwords and create 'filtered_tokens' variable stop_words = set(stopwords.words('english')) filtered_tokens = [word for word in tokens if word not in stop_words]

# Create wordcloud with filtered tokens fig, ax = plt.subplots() fig.patch.set_facecolor('black')

wordcloud = WordCloud(width=1400, height=1000).generate(' '.join(filtered_tokens)) plt.imshow(wordcloud, interpolation='bilinear') plt.axis('off') plt.show()

Tree Map/Confusion Matrix code

# Import necessary libraries/modules import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import squarify

# Plot hobbies treemap categories = ['Piano', 'Hiking in the Mountains', 'Snowboarding', 'Tennis','CrossFit', 'AI Generated Art','Learning New Skills','Going on Adventures!'] sizes = [20, 20, 10, 10, 20, 5, 15, 15] colors = ['#dfe318', '#2db27d', '#38598c', '#0b101b']

# Create a figure and a set of subplots fig, ax = plt.subplots(figsize=(12, 8))

# Set the background color of the axes and the figure ax.set_facecolor('#1e2327') # for the axes fig.patch.set_facecolor('#1e2327') # for the figure background

squarify.plot(sizes=sizes, label=categories, color=colors, alpha=0.7, pad=0.01, ax=ax)

plt.title('Some of my Hobbies',fontweight='bold',fontsize=20, color='#F0EAD6') plt.axis('off') # Disable the axis

# Adjust label formatting for i, label in enumerate(plt.gca().texts): label.set_fontsize(13.5)
label.set_weight('bold') if categories[i] == 'Going on Adventures!':
label.set_rotation(90) label.set_color('#2db27d') if categories[i] == 'Tennis': label.set_color('#2db27d')

plt.show()

# Create list of predictions and transform into 2x2 numpy array predictions_list = [0,0,0,1] predictions_matrix = np.array(predictions_list).reshape(2,2)

# Change background color fig, ax = plt.subplots(figsize=(5,4)) fig.patch.set_facecolor('#1e2327') ax.set_facecolor('#1e2327')

# Plot confusion matrix using seaborn heatmap plt.figure(figsize=(5,4)) ax = sns.heatmap(predictions_matrix, vmin=0, vmax=1, annot=True, cmap = sns.color_palette("mako", as_cmap=True), fmt='g') plt.title('Confusion Matrix', fontsize=16, fontweight='bold', color='#F0EAD6') plt.xlabel('Predicted Label', color='#F0EAD6') plt.ylabel('True Label', color='#F0EAD6') ax.tick_params(axis='both', colors='#F0EAD6')

# Access the color bar cbar = ax.collections[0].colorbar

# Change the color of the color bar's tick labels cbar.ax.yaxis.set_tick_params(color='#F0EAD6') # Change tick label colors plt.setp(plt.getp(cbar.ax.axes, 'yticklabels'), color='#F0EAD6') # Change tick text colors

plt.show()

Hobbies Treemap and Confusion Matrix Welcome!

I predicted you'd be visiting today.

Looks like my Accuracy, Recall, Precision, and F1 scores are all at 100%!

Chris Aguirre's Projects

automatidata icon automatidata

A/B Testing, Multiple Linear Regression, Machine Learning, EDA, Statistical Testing, Data Cleaning, Feature Engineering

cyclistic_chicago icon cyclistic_chicago

Data Cleaning/Wrangling, Feature Engineering, EDA, Machine Learning, Statistical Testing

salifort-motors icon salifort-motors

EDA, Logistic Regression, Machine Learning, Statistical Testing, Data Cleaning, Feature Engineering

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.