Skip to content

Commit 965eecd

Browse files
committed
2 parents 710833e + 375477a commit 965eecd

File tree

108 files changed

+146714
-2845
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+146714
-2845
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import random
2+
import time
3+
4+
# Word lists for different difficulty levels
5+
easy_words = ['cat', 'dog', 'sun', 'book', 'tree', 'car', 'bird']
6+
medium_words = ['elephant', 'giraffe', 'balloon', 'umbrella', 'vacation']
7+
hard_words = ['substitution', 'enlightenment', 'interrogation', 'psychological', 'astronomy']
8+
9+
# Function to select a random word based on difficulty
10+
def generate_word(level):
11+
if level == 'Easy':
12+
return random.choice(easy_words)
13+
elif level == 'Medium':
14+
return random.choice(medium_words)
15+
elif level == 'Hard':
16+
return random.choice(hard_words)
17+
18+
# Function to adjust difficulty based on score
19+
def adjust_difficulty(score):
20+
if score >= 50 and score < 100:
21+
return 'Medium'
22+
elif score >= 100:
23+
return 'Hard'
24+
else:
25+
return 'Easy'
26+
27+
# Function to run the typing game
28+
def start_game():
29+
score = 0
30+
level = 'Easy'
31+
32+
print("Welcome to the AI-Powered Typing Game!\n")
33+
print("Instructions:")
34+
print("Type the given word correctly to score points.")
35+
print("Difficulty will increase as your score increases.\n")
36+
37+
# Main game loop
38+
for round_num in range(10): # Number of rounds (10 in this example)
39+
print(f"\nRound {round_num + 1}: Difficulty Level - {level}")
40+
word_to_type = generate_word(level)
41+
print(f"Type this word: {word_to_type}")
42+
43+
start_time = time.time() # Start the timer
44+
user_input = input("Your input: ")
45+
46+
# Check if the user typed the correct word
47+
if user_input.lower() == word_to_type.lower():
48+
time_taken = time.time() - start_time
49+
score += 10 # Increase score for correct input
50+
print(f"Correct! You took {time_taken:.2f} seconds.")
51+
print(f"Your score: {score}")
52+
else:
53+
print("Incorrect! Try harder next time.")
54+
55+
# Adjust the difficulty based on score
56+
level = adjust_difficulty(score)
57+
58+
print("\nGame Over!")
59+
print(f"Your final score: {score}")
60+
if score >= 100:
61+
print("You're a typing master!")
62+
elif score >= 50:
63+
print("Good job! Keep practicing!")
64+
else:
65+
print("Keep trying! You'll get better.")
66+
67+
# Run the game
68+
start_game()
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# AI-Powered Typing Game
2+
3+
This is a simple AI-powered typing game written in pure Python. The game challenges players to type words correctly to score points. The difficulty level increases as the score improves, making the game progressively harder.
4+
5+
## How to Play
6+
7+
1. You will be given a word to type, starting at an **Easy** difficulty level.
8+
2. Type the word exactly as shown (case-insensitive) and press Enter.
9+
3. If you type the word correctly, you will score 10 points.
10+
4. The game consists of 10 rounds, and the difficulty will increase as follows:
11+
- **Easy**: 0 - 49 points
12+
- **Medium**: 50 - 99 points
13+
- **Hard**: 100+ points
14+
5. At the end of the game, your final score will be displayed, and you'll get feedback based on your performance.
15+
16+
## Running the game
17+
1. Download the ai-typing.py file.
18+
2. Run the game using the following command:
19+
python ai-typing.py
20+
3. Enjoy playing!
21+
22+
23+
## Game Features
24+
25+
- The game adjusts difficulty dynamically as the player progresses.
26+
- Timed responses show how long it took you to type the word (though it doesn’t affect your score).
27+
- Encouraging feedback at the end of the game based on your total score:
28+
- **100+ points**: Typing master!
29+
- **50 - 99 points**: Good job!
30+
- **0 - 49 points**: Keep practicing!
31+
32+
## Example Gameplay
33+
34+
```bash
35+
Welcome to the AI-Powered Typing Game!
36+
37+
Instructions:
38+
Type the given word correctly to score points.
39+
Difficulty will increase as your score increases.
40+
41+
Round 1: Difficulty Level - Easy
42+
Type this word: cat
43+
Your input: cat
44+
Correct! You took 1.23 seconds.
45+
Your score: 10
46+
47+
Round 2: Difficulty Level - Easy
48+
Type this word: dog
49+
Your input: doog
50+
Incorrect! Try harder next time.
51+
52+
...
53+
54+
Game Over!
55+
Your final score: 70
56+
Good job! Keep practicing!
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Python 3.x
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# **Bird Species Classification** 🐦
2+
3+
### 🎯 Goal
4+
The primary goal of this project is to build deep learning models to classify Bird species .
5+
6+
### 🧵 Dataset : https://www.kaggle.com/datasets/akash2907/bird-species-classification/data
7+
8+
### 🧾 Description
9+
This dataset consists of over 170 labeled images of birds, including validation images. Each image belongs to only one bird category. The challenge is to develop models that can accurately classify these images into the correct species.
10+
11+
### 📚 Libraries Needed
12+
- os - Provides functions to interact with the operating system.
13+
- shutil - Offers file operations like copying, moving, and removing files.
14+
- time - Used for time-related functions.
15+
- torch - Core library for PyTorch, used for deep learning.
16+
- torch.nn - Contains neural network layers and loss functions.
17+
- torchvision - Provides datasets, models, and image transformation tools for computer vision.
18+
- torchvision.transforms - Contains common image transformation operations.
19+
- torch.optim - Optimizers for training neural networks.
20+
- matplotlib.pyplot - Used for data visualization, like plotting graphs.
21+
22+
## EDA Result 👉 [Classified Bird Species](https://github.com/Archi20876/machine-learning-repos/blob/main/Classification%20Models/Bird%20species%20classification/bird-species-classification.ipynb)
23+
24+
25+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# **CSGO Round Winter Classification** ❄️
2+
3+
### 🎯 Goal
4+
Predict the Winning individual of Snapshots round
5+
6+
### 🧵 Dataset : [LINK](https://github.com/Archi20876/machine-learning-repos/blob/main/Classification%20Models/CSGO%20Round%20Winner%20Classification/Dataset/csgo.csv)
7+
8+
9+
### 🧾 Description
10+
This dataset consists of over 170 labeled images of birds, including validation images. Each image belongs to only one bird category. The challenge is to develop models that can accurately classify these images into the correct species.
11+
12+
### 📚 Libraries Needed
13+
- Numpy
14+
- Pandas
15+
- Matplotlib
16+
- Seaborn
17+
- Scikit-Learn
18+
19+
## EDA Result 👉 [CSGO Round Winter.ipynb](https://github.com/Archi20876/machine-learning-repos/blob/main/Classification%20Models/CSGO%20Round%20Winner%20Classification/Model/CS_GO_Round_Winner_Classification.ipynb)
20+
### For more information please refer to [Model](https://github.com/Archi20876/machine-learning-repos/tree/main/Classification%20Models/CSGO%20Round%20Winner%20Classification/Model)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# **Cartier Jewelry Classification** 💎
2+
3+
### 🎯 Goal
4+
The aim of this project is to make a classification model, which will classify the jewelries based on the various features.
5+
6+
7+
### 🧵 Dataset : [LINK](https://github.com/Archi20876/machine-learning-repos/blob/main/Classification%20Models/Cartier%20Jewelry%20Classification/Dataset/cartier_catalog.csv)
8+
9+
### 🧾 Description
10+
Cartier International SNC, or simply Cartier (/ˈkɑːrtieɪ/; French: [kaʁtje]), is a French luxury goods conglomerate which designs, manufactures, distributes, and sells jewellery and watches. Founded by Louis-François Cartier in Paris in 1847, the company remained under family control until 1964. The company maintains its headquarters in Paris, although it is a wholly owned subsidiary of the Swiss Richemont Group. Cartier operates more than 200 stores in 125 countries, with three Temples (Historical Maisons) in London, New York, and Paris.
11+
12+
### 📚 Libraries Needed
13+
- Numpy
14+
- Pandas
15+
- Matplotlib
16+
- XgBoost
17+
- Sklearn
18+
- seaborn
19+
20+
21+
## EDA Result 👉 [ Cartier Classification.ipynb](https://github.com/Archi20876/machine-learning-repos/blob/main/Classification%20Models/Cartier%20Jewelry%20Classification/Model/cartier_jewelry_classification.ipynb)
22+
### For more information please refer to [Model](https://github.com/Archi20876/machine-learning-repos/tree/main/Classification%20Models/Cartier%20Jewelry%20Classification/Model)
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Fake News Detection using CNN
2+
3+
This project implements a Convolutional Neural Network (CNN) to detect and classify fake news articles from textual data. The dataset used consists of labeled news articles, categorized as either real or fake, and is obtained from various sources including Kaggle. The implementation is done in Python using popular machine learning libraries.
4+
5+
## Table of Contents
6+
- [Project Overview](#project-overview)
7+
- [Dataset](#dataset)
8+
- [Installation](#installation)
9+
- [Usage](#usage)
10+
- [Model Architecture](#model-architecture)
11+
- [Training](#training)
12+
- [Evaluation](#evaluation)
13+
- [Results](#results)
14+
15+
## Project Overview
16+
The goal of this project is to detect fake news using a Convolutional Neural Network (CNN). The model is trained on a dataset of news articles labeled as real or fake. This project demonstrates the process of loading the dataset, preprocessing the text, building the model, training the model, and evaluating its performance.
17+
18+
## Dataset
19+
The dataset used in this project is from Kaggle and contains thousands of labeled news articles. You can download the dataset from [here](https://www.kaggle.com/c/fake-news).
20+
21+
## Installation
22+
To run this project, you need to have the following dependencies installed:
23+
24+
- Python 3.x
25+
- TensorFlow
26+
- Keras
27+
- NumPy
28+
- Pandas
29+
- Scikit-learn
30+
- Matplotlib
31+
32+
You can install the necessary packages using the following commands:
33+
34+
```bash
35+
pip install tensorflow keras numpy pandas scikit-learn matplotlib
36+
```
37+
Usage
38+
Clone the repository:
39+
```bash
40+
git clone https://github.com/recodehive/machine-learning-repos/Fake-News-Detection.git
41+
cd Fake-News-Detection
42+
```
43+
## Model Architecture
44+
The model is a Convolutional Neural Network (CNN) with the following architecture:
45+
- Embedding layer for word representation
46+
- Convolutional layers to capture spatial hierarchies
47+
- MaxPooling layers to reduce dimensionality
48+
- Flatten layer to convert the 3D output to 1D
49+
- Fully connected (Dense) layers for classification
50+
- Output layer with a sigmoid activation function for binary classification
51+
52+
## Training
53+
The model is trained using the Adam optimizer and binary cross-entropy loss. The dataset is split into training and validation sets to monitor the performance of the model during training.
54+
55+
## Evaluation
56+
The model is evaluated on a separate test set to measure its accuracy. The evaluation results, including accuracy and loss, are printed to the console.
57+
58+
## Results
59+
The model achieves competitive accuracy on the test set. Training and validation accuracy can be visualized through plots generated during training.

0 commit comments

Comments
 (0)