script stringlengths 113 767k |
|---|
# ### **[Coconut Leaf Pest Identification](https://www.kaggle.com/datasets/shravanatirtha/coconut-leaf-dataset-for-pest-identification)** using transfer learning
# **Problem**: classify and predict pest-infected leaves to be made easy for agriculture
# **Solution:**
# * model used: EfficientNet_B7
# * pretrained on: Im... |
import numpy as np
import pandas as pd
import matplotlib.pylab as plt
import seaborn as sns
df = pd.read_csv("/kaggle/input/insurance/insurance.csv")
df.head()
df.describe()
df.shape
df.columns
print(f"age : {df.age.nunique()}")
print(f"sex : {df.sex.nunique()}")
print(f"bmi : {df.bmi.nunique()}")
print(f"children : {... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
df = pd.read_csv("/kaggle/input/customer-shopping-dataset/customer_shopping_data.csv")
df.info()
df.head()
def age_group(value):
if 18 <= value <= 24:
return "18-24"
elif 25 <= value <= 34:
return "25... |
# # 1 | Multi Armed Bandits
# A classic example of Reinforcment Learning Problems
import os
for dirname, _, filenames in os.walk("/kaggle/input"):
for filename in filenames:
print(os.path.join(dirname, filename))
import pandas as pd
import numpy as np
import random
import seaborn as sns
from IPython.displa... |
# In this notebook, I will be fitting a LightGBM classification model on this simulated dataset, where I tune its hyperparameters through Bayesian Optimization (with Gaussian process as a surrogate model). I will also attempt to interpret the effects of the features.
# to install with optuna
import numpy as np
import p... |
# # Credit Card Customers - EDA and XGBoost
# **Introduction**
# This notebook uses data available at [https://www.kaggle.com/sakshigoyal7/credit-card-customers](http://) and:
# * Reads in the relevant data.
# * Performs exploratory data analysis (EDA) to identify trends and estimate feature importance.
# * Uses an XGB... |
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
# Input data files are available in the read-only "../input/" directory
# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory
import os
for dirname... |
import numpy as np
import pandas as pd
import re
data = pd.read_csv("/kaggle/input/chatgpt-paraphrases/chatgpt_paraphrases.csv")
data
category = {}
for i in range(len(data)):
chatgpt = data.iloc[i]["paraphrases"][1:-1].split(", ")
for j in chatgpt[:1]:
category[j[1:-1]] = "chatgpt"
category[data.il... |
# # Exercice détection du diabète
# ## Lecture des données
# Afficher les graphs dans Jupyther
# Import des librairies
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
import seaborn as sns
# Lecture des données
t = pd.read_csv("../input/pima-indians-diabetes-database/diabetes.csv")
t.head()... |
# **IMPORTING FILES PATHS**
import os
files = []
for dirname, _, filenames in os.walk("/kaggle/input"):
for filename in filenames:
files += [os.path.join(dirname, filename)]
files
# **TAKING A SINGLE FILE**
# Model fits only for indexes: 0,6,7 (lat data)
file = files[5]
print(file)
# **READING FILE DATA ... |
# # Bagging Classifier
# Bagging Classifier is an ensemble method, that helps in reducing the variance of individual estimators by introducing randomisation into the training stage of each of the estimators and making an ensemble out of all the estimators.
# ***
# It simply, takes all the predictions from different est... |
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
# Input data files are available in the read-only "../input/" directory
# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory
import os
for dirname... |
import pandas as pd
# ****Importing pandas module and naming it as "pd"****
# **1. Load the melb_data dataset into the Pandas dataframe.**
melb_data = pd.read_csv("/kaggle/input/melb-data/melb_data.csv")
melb_data.head()
# The melb_data dataset from Platon was empty, so we just added these kaggle data and worked on i... |
# EDA&
# Visualization
# Recommendation System
# ### Brief description of the project
# Assuming that the randomly generated movie lists A, B, and C under certain conditions are each 100 movies that Personas A, B, and C have seen, it is a project to define what type of person each person is and to recommend to that pe... |
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
# Input data files are available in the read-only "../input/" directory
# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory
import os
for dirname... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
test = pd.read_csv("../input/usa-housing-dataset/housing_test.csv")
train = pd.read_csv("../input/usa-housing-dataset/housing_train.csv")
train.describe()
train.head()
(train.shape), (test.shape)
idsUnique = len(train.Id)
prin... |
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
# Input data files are available in the read-only "../input/" directory
# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory
import os
for dirname... |
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
# Input data files are available in the read-only "../input/" directory
# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory
import os
for dirname... |
# ## TR PDNN 2023
# diadaptasi dari: https://github.com/img88/ALPR_IndonesiaPlateNumber_ComputerVision
# ! pip install imutils -q
import os
import matplotlib.pyplot as plt
import numpy as np
import cv2
# import imutils
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from sklea... |
# # CNN
# import models
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
import matplotlib.pyplot as plt
import seaborn as sns
from keras.models import Sequential
from keras.callbacks import EarlyStopping
from keras.layers.convolutional import Conv1D, MaxPooli... |
import pandas as pd
r_file_path = "../input/drug-data/drug200.csv"
r_data = pd.read_csv(r_file_path)
r_data.columns
import pandas as pd
r_file_path = "../input/drug-data/drug200.csv"
r_data = pd.read_csv(r_file_path)
r_labels = ["Drug"]
r_features = ["Age", "Sex", "BP", "Cholesterol", "Na_to_K"]
y = r_data[r_labels]
... |
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
# Input data files are available in the read-only "../input/" directory
# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory
import os
for dirname... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.linear_model import LinearRegression
import warnings
warnings.filterwarnings("ignore")
df1 = pd.read_csv("/kaggle/input/happiness-index-2018-2019/2018.csv")
df2 = pd.read_csv("/kaggle/input/happiness-index-2018-20... |
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
# Input data files are available in the read-only "../input/" directory
# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory
import os
for dirname... |
# # `CROP RECOMMENDATION`
# Recommending the crop according to certain situations and features is basically Crop Recommendation. The selection of crops & cropping system plays a major role in improving the productivity and profitability of the farmers. Crop recommendation system thereby helps farmers during this decisi... |
# One of the challenges that investors face is the likelihood of the price movement - i.e., what is the probability that the price will reach a certain level. One way to address this challenge is to simulate the price movement using [Monte Carlo method](https://en.wikipedia.org/wiki/Monte_Carlo_method).
# Briefly speak... |
import numpy as np
import sqlite3
import pandas as pd
import matplotlib.pyplot as plt
conn = sqlite3.connect("/kaggle/input/ipldatabase/database.sqlite")
c = conn.cursor()
# ### No of players in the IPL country wise
sql = """
select Country.Country_Name, COUNT(Player.Country_Name) AS Number_of_Players
FROM Country
JO... |
# **Type conversion -***Convert one data type to another*
# **Implicit**
Revenue_A = 22
Revenue_B = 20.4
type(Revenue_A)
type(Revenue_B)
Revenue = Revenue_A + Revenue_B
print("Total Revenue is", Revenue)
|
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
# Input data files are available in the read-only "../input/" directory
# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory
import os
for dirname... |
import sys
sys.path.append("../input/pytorch-image-models/pytorch-image-models-master")
# sys.setrecursionlimit(10**6)
# ====================================================
# Directory settings
# ====================================================
import os
OUTPUT_DIR = "./"
if not os.path.exists(OUTPUT_DIR):
o... |
# # LesionFinder: Bounding Box Regression for Chest CT (Evaluation)
# Here, we evaluate the previously trained LesionFinder model for lesion bounding box regression. The training notebook can be found [here](https://www.kaggle.com/code/benjaminahlbrecht/lesionfinder-bounding-box-regression-for-chest-ct).
# ## Preamble
... |
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
# Input data files are available in the read-only "../input/" directory
# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory
import os
for dirname... |
# ### Recently I published a self help book titled Inspiration: Thoughts on Spirituality, Technology, Wealth, Leadership and Motivation. The preview of the book can be read from the Amazon link https://lnkd.in/gj7bMQA
# Some years back I went for a trip to Kodaikanal in Tamil Nadu.There we had a Fruit Milk Shake which ... |
# # Spam tweets detection
# The provided dataset consists of tweets, and the task is to define which of them are spam tweets.
import pandas as pd
import numpy as np
import re
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_style("darkgrid")
from wordcloud import WordCloud
import nltk
from nltk.corpus imp... |
from transformers import AutoTokenizer
from torch.utils.data import Dataset
import pandas as pd
import numpy as np
import warnings
import os
warnings.simplefilter("ignore")
os.environ["TOKENIZERS_PARALLELISM"] = "false"
class PretrainingDataset(Dataset):
def __init__(self, texts, tokenizer, texts_pair=None, max_... |
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
# Input data files are available in the read-only "../input/" directory
# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory
import os
leagues = {... |
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
import seaborn as sns
import matplotlib.pyplot as plt
# Input data files are available in the read-only "../input/" directory
# For example, running this (by clicking run or pressing Shift+Enter) will list all ... |
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
# Input data files are available in the read-only "../input/" directory
# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory
import os
for dirname... |
# # 利用逻辑回归机器学习预测血糖值
# 在采集的血糖数据集基础上,进行机器学习,并预测血糖是否超标 (>6.1)
# 前期血糖采集原理:采用透射式近红外光谱法,嵌入式微处理器分别驱动红光和红外光发射端照射人体指尖部位,光电接收端负责收集透射光,再通过信息处理模块进行信号的放大滤波和光电转换,通过朗伯比尔定律计算得到红光与红外光透射能量的比例值与初始血糖值;再通过能量代谢守恒法进行血糖测量值的修正,修正参数包括人体血氧饱和度、人体心率值、手指指尖体表温度值、环境温度值及体辐射能量值。由于还原性血红蛋白对红光的吸收强,但对红外光的吸收相对较弱;血红蛋白并带有氧分子的血红细胞对红光的吸收比较弱,对红外光的吸收比较强,因此原始光电容积脉... |
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
X_train = pd.read_csv(
"/kaggle/input/house-prices-advanced-regression-techniques/train.csv"
)
y_train = X_train[["SalePrice"]]
X_test = pd.read_csv(
"/kaggle/input/house-prices-advanced-regression-tech... |
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
# Input data files are available in the read-only "../input/" directory
# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory
import os
for dirname... |
# # Machine Learning
# **Machine learning is like teaching a computer how to learn from examples, rather than giving it step-by-step instructions. This allows the computer to find patterns and make predictions based on data, which can be useful for things like recognizing faces or making personalized recommendations.**... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import warnings
warnings.filterwarnings("ignore")
dataset = pd.read_csv("/kaggle/input/mental-health-in-tech-survey/survey.csv")
dataset_head = dataset.head()
dataset_head
dataset.info()
dataset.columns
dataset.shape
dataset.i... |
# **IMPORTING FILES PATHS**
import os
files = []
for dirname, _, filenames in os.walk("/kaggle/input"):
for filename in filenames:
files += [os.path.join(dirname, filename)]
files
# **TAKING A SINGLE FILE**
file = files[0]
print(file)
# **READING FILE DATA FROM EXCEL**
data_set = pd.read_excel(file)
data... |
import numpy as np
import pandas as pd
from sklearn.metrics import mean_squared_error
from sklearn.preprocessing import StandardScaler
import matplotlib.pyplot as plt
df = pd.read_excel("/kaggle/input/tiapose-dataset/bebidas.xlsx")
df.index = pd.to_datetime(df["DATA"], format="%Y-%m-%d")
bud = df[["BUD"]]
scaler = Sta... |
# # TELECOMMUNICATION
#
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
# # Data Preprocess
df = pd.read_csv("/kaggle/input/telecom-users-dataset/telecom_users.csv")
print(df.shape)
df.head()
df.info()
# * Data has no null variables so that is great.
# * We do not need som... |
import os
import numpy as np
import pandas as pd
import tensorflow as tf
import tensorflow.keras as keras
import rawpy
import random
import matplotlib.pyplot as plt
from tensorflow.keras import Input, Model
from tensorflow.keras.layers import (
UpSampling2D,
Conv2D,
MaxPooling2D,
Dropout,
concatenat... |
# Сперва импортируем нужные нам библиотеки и взглянем на данные.
import pandas as pd
import numpy as np
import seaborn as sns
from matplotlib import pyplot as plt
df = pd.read_csv("./drive/MyDrive/Colab_Notebooks/DATA/train.csv")
df.sample(10)
df.info()
df.isna().sum()
# Данные попались без пропусков в каждой колонке... |
import numpy as np
import pandas as pd
import plotly.express as px
import plotly.figure_factory as ff
business = pd.read_json(
"../input/yelp-dataset/yelp_academic_dataset_business.json", lines=True
)
len(business.business_id.unique())
print(f"shape = {business.shape}")
print()
print("Null value list")
print(busin... |
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
# Input data files are available in the read-only "../input/" directory
# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory
import os
for dirname... |
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
# Input data files are available in the read-only "../input/" directory
# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory
import os
for dirname... |
# # How does Quantum Computers represent data?
# Majority of computing in this era utilise classical computers for intense number crunching and other computationally expensive tasks. In classical computers, data is represented in classical bits, a single bit can only represent two values "0" and "1" in base 2, which c... |
import pandas as pd
import seaborn as sns
import numpy as np
cardio = pd.read_csv("/kaggle/input/cardiogoodfitness/CardioGoodFitness.csv")
cardio.columns
cardio.shape
cardio.info()
# No Null values in the data
cardio.head()
# ##Initial Data Exploration
cardio.describe().T
cardio.isna().sum()
# There are no missing ... |
# # Titanic
# # 1.Load Data & Check Information
import pandas as pd
import numpy as np
import os
for dirname, _, filenames in os.walk("/kaggle/input"):
for filename in filenames:
print(os.path.join(dirname, filename))
df_train = pd.read_csv("../input/titanic/train.csv")
df_test = pd.read_csv("../input/tita... |
import pandas as pd
d = {
"Student": ["Aman", "Biswa", "Aman", "Disha", "Dhruvika", "Aman"],
"Marks": [23, 44, 33, 54, 78, 23],
"Age": [10, 19, 17, 18, 18, 18],
}
a = pd.DataFrame(d)
a
a["Student"].drop_duplicates(keep="last")
a.drop_duplicates(subset=["Student", "Marks", "Age"], ignore_index=True, keep=Fa... |
# # Restaurant Recommendation System
# ## 2. Exploratory Data Analysis (EDA)
# ## Aim
# After getting our data ready, we still want to make sense of it. In EDA we look at various plots and actually let the data tell us its story. This step will give us a deeper understanding of data. We'll also try to make data more am... |
# # What is single model for classification and regression?
# A single model for both classification and regression is a machine learning model that can handle both classification and regression tasks. This type of model is often called a "hybrid" or "multi-task" model because it can perform multiple tasks simultaneous... |
# > # **DATA MINING**
# * Dwi Krisnawan
# * Bandem Mahatma
# * Gus Rai Surya Laksana
# # **Data Visualization Section**
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import tensorflow as tf
from mpl_toolkits.mplot3d import Axes3D
diabetes = pd.read_csv("../input/diabetes/... |
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
# Input data files are available in the read-only "../input/" directory
# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory
import os
for dirname... |
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
# Input data files are available in the read-only "../input/" directory
# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory
import os
for dirname... |
import pandas as pd
import numpy as np
from datasets import Dataset, DatasetDict
from transformers import TrainingArguments, Trainer
from transformers import AutoModelForSequenceClassification, AutoTokenizer
from sklearn.model_selection import train_test_split
df = pd.read_csv("/kaggle/input/nlp-getting-started/train.... |
# BigQuery
PROJECT_ID = "hackernews-301014"
from google.cloud import bigquery
client = bigquery.Client(project=PROJECT_ID)
# Construct a reference to the "hacker_news" dataset
dataset_ref = client.dataset("hacker_news", project="bigquery-public-data")
# API request - fetch the dataset
dataset = client.get_dataset(data... |
# # Health Insurance Lead Prediction
# [Link to competition here!](https://datahack.analyticsvidhya.com/contest/job-a-thon/)
# Go there and register to be able to download the dataset and submit your predictions.
# Your Client FinMan is a financial services company that provides various financial services like loan, in... |
import numpy as np
import pandas as pd
import os
for dirname, _, filenames in os.walk("/kaggle/input"):
for filename in filenames:
print(os.path.join(dirname, filename))
from mlxtend.frequent_patterns import apriori, association_rules
df = pd.read_csv(r"/kaggle/input/home-basics-data/Home Basics Data.csv"... |
# ##### from skimage.metrics import structural_similarity as ssim
# import cv2
# import numpy as np
# import math
# from matplotlib import pyplot as plt
# def mse(imageA, imageB):
# err = np.sum((imageA.astype("float") - imageB.astype("float")) ** 2)
# err /= float(imageA.shape[0] * imageA.shape[1])
# return err
# def... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import sklearn
from sklearn.preprocessing import MinMaxScaler
from sklearn.preprocessing import normalize
from sklearn.model_selection import train_test_split
from autogluon.tabular import TabularDataset, TabularPredictor
from ... |
from __future__ import print_function
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
import pandas as pd
from tqdm.notebook import tqdm
from copy import deepcopy
from itertools import chain
from math import isna... |
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
# Input data files are available in the read-only "../input/" directory
# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory
import os
for dirname... |
# # Kidney Stone Prediction
# ### Table of contents
# - [Importing Libraries & Exploring the data](#1)
# - [Exploratory Data Analysis](#2)
# - [Check for Information Bias in Train data and Original Data](#2.1)
# - [Linear Correlation between the features](#2.2)
# - [Feature Distributions for train & test data](#2.3)
# ... |
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
# Input data files are available in the read-only "../input/" directory
# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory
import os
for dirname... |
import os
import matplotlib.pyplot as plt
import seaborn as sns
import IPython.display as ipd
import librosa.display
import numpy as np
import pandas as pd
from scipy.fftpack import fft
from scipy import signal
from scipy.io import wavfile
import librosa
import glob
import tensorflow as tf
import wave
import sys
from t... |
# # TABLE OF CONTENTS
# * [IMPORTS](#1)
# * [INTRODUCTION](#2)
# * [CONFIGURATION](#2.1)
# * [EXECUTIVE SUMMARY](#2.2)
# * [PREPROCESSING](#3)
# * [INFERENCES](#3.1)
# * [ADVERSARIAL CV](#4)
# * [INFERENCES](#4.1)
# * [EDA- VISUALS](#5)
# * [TARGET BALANCE](#5.1)
# * [PAIRPLOTS](#5.2)
# * [DISTRIUTION PLOTS](#5.3)
# *... |
import math
import re
import string
from random import randint
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from nltk.corpus import stopwords
from scipy.stats import zscore
from sklearn.preprocessing import MinMaxScaler
from wordcloud import STOPWORDS, WordCloud
# Loadin... |
# Disaster Tweets: A Study of Various Approaches to Text Classification
# Table of Contents
# * [Introduction](#introduction)
# * [First Look and Some Initial Thoughts](#firstlook)
# * [Preprocessing](#preprocessing)
# * [Taking Care of the keyword and location Columns](#taking)
# * [Implementing a Bag of Words Model f... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.ensemble import BaggingClassifier
df = pd.read_csv("/kaggle/input/suv-nanze/suv.csv")
df.drop("User ID", axis=1, inplace=True)
df.head(5)
df.Gender = pd.get_dummies(df.Gender, drop_first=True)
X = df.to_numpy()
np.random.seed = 0
X = X... |
# ***
# # *Predictive Maintenance Study*
# This study is based on a Kaggle database on predictive maintenance made available to the general public (https://www.kaggle.com/datasets/shivamb/machine-predictive-maintenance-classification). It's primary objectives are to build machine learning models able to make prediction... |
import os
for dirname, _, filenames in os.walk("/kaggle/input"):
for filename in filenames:
print(os.path.join(dirname, filename))
# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using "Save & Run All"
# You can also write tempo... |
# importing libraries
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import numpy as np
import random
# Define the network architecture
class QNetwork(nn.Module):
def __init__(self, state_size, action_size):
super(QNetwork, self).__init__()
self.fc1 ... |
# Importing Libraries
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
# reading data set (Salary_Data.csv) using pandas
df = pd.read_csv("../input/random-salary-data-of-employes-age-wise/Salary_Data.csv")
## Now some Eploratory Data Analysis EDA
# Checking first five rows
d... |
# Bristol-Myers Squibb – Molecular Translation
# Exploratory Data Analysis (EDA)
# CREATED BY: DARIEN SCHETTLER
# TABLE OF CONTENTS
# ---
# 0 IMPORTS
# ---
# 1 BACKGROUND INFORMATION
# ---
# 2 SETUP
# ---
# 3 HELPER FUNCTIONS
# ... |
# # Quick Australian population EDA and Visualisation
# ## 1. Importing libraries and dataset
import os
import numpy as np
import pandas as pd
import plotly.express as px
import numpy as np
import matplotlib.pyplot as plt
df_master = pd.read_csv("/kaggle/input/worldcities-australia/au.csv")
# ## 2. A brief EDA
df_mas... |
# ### Bitte denken Sie vor der Abgabe des Links daran, Ihr Notebook mit Klick auf den Button "Save Version" (oben rechts) zu speichern.
# Bearbeitungshinweis: Sie sind frei in der Art und Weise, wie Sie die Aufgaben lösen. Sie können z.B. auch weitere Code-Blöcke einfügen. Wenn Sie nicht weiterkommen, fragen Sie im For... |
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
# Input data files are available in the read-only "../input/" directory
# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory
import os
for dirname... |
# Importing the required libraries
import numpy as np
import pandas as pd
from sklearn.ensemble import RandomForestRegressor
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_squared_error
from keras.models import Sequential
from keras.layers import Dense
from keras.optimizers import... |
# # MNIST Improved Model
# In this notebook, we create an improved (from our baseline) model for handwritten digit recognition on the MNIST data set.
# ### Import packages
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import tensorflow as tf
# ### Load data
train_data = pd.read_csv("/kaggle/in... |
import scipy.io
import numpy as np
import math
from progressbar import ProgressBar
data = scipy.io.loadmat("/kaggle/input/admlhw4/data1.mat")
X_train = np.asarray(data["TrainingX"])
X_test = np.asarray(data["TestX"])
Y_train = np.asarray(data["TrainingY"])
Y_test = np.asarray(data["TestY"])
def find_sigma(X):
p_... |
from keras.preprocessing.image import img_to_array, load_img
import numpy as np
import glob
import os
from skimage import data, color
from skimage.transform import rescale, resize, downscale_local_mean
import argparse
from PIL import Image
from keras.callbacks import ModelCheckpoint, EarlyStopping
import numpy as np
im... |
import numpy as np
import cv2
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
import tensorflow as tf
from tensorflow.keras.models import Model
from tensorflow.keras.layers import (
Input,
Conv2D,
MaxPooling2D,
Dropout,
concatenate,
Conv2DTranspose,
UpSampling2D,... |
import numpy as np
import pandas as pd
train_original = pd.read_csv(
"/kaggle/input/yasmines-meteorological-mystery-dsc-psut-comp/train_data.csv",
parse_dates=["date"],
)
test_original = pd.read_csv(
"/kaggle/input/yasmines-meteorological-mystery-dsc-psut-comp/test_data.csv",
parse_dates=["date"],
)
sa... |
# ### Entrance Hall
# In this kernel, I will be working with a surgery time prediction dataset and my main objective is to transform the data into
# a more useful format for machine learning models. To achieve this goal, I will focus on data preprocessing steps such as
# handling missing values, dealing with categorica... |
# * Dataframe is a 2D data structure
# * Behaves similar to how we store data in Excel
# * Data is alligned in tabular fashion
# * Mutable and can store heterogenous data
import pandas as pd
# Creating DataFrame
# **using list**
l = ["Monica", "Chandler", "Ross", "Rachel", "Joe", "Phoebe"]
df = pd.DataFrame(l)
df
# *... |
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
# Input data files are available in the read-only "../input/" directory
# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory
import os
for dirname... |
# # Ⅰ.配置YOLOv5_OBB环境(用于旋转目标检测)
# ## 1. 安装YOLOv5_OBB
# Download YOLOv5_OBB
# Install dependencies
import torch
device = "cuda" if torch.cuda.is_available() else "cpu"
print("Using {} device".format(device))
# ## 2. 安装DOTA_devkit
# # Ⅱ. 配置数据集
# %cd /kaggle/working/yolov5_obb/
# %cd /kaggle/input/dronevehicle/train/tra... |
# # Objective
# The objective is to analyze the daily count of vaccinations in the top 5 countries in terms of the total vaccinations.
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
# Input data files are available in the read-only "../input/" directory
# F... |
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
# Input data files are available in the read-only "../input/" directory
# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory
# You can write up to ... |
# * 범주형 변수들 숫자로 맵핑해주기
# * 이름을 가지고 파생변수를 만들기 (성 Mr, Ms, Dr, Miss)
# * 결측치나 이상치 처리하기 (결측치를 최대 빈도수인 변수로 채우든지(범주형 변수일 경우), 수치형 변수일경우엔 결측치를 평균이나 중앙값으로 채워주세요)
# * 의사결정나무 만들고 Gridsearch 로 적절한 파라미터 찾기
# * plot_tree or export graphiz 모듈 이용해서 시각화
import os
for dirname, _, filenames in os.walk("/kaggle/input"):
for filename ... |
# # Objective
# * To predict whether a liability customer will buy a personal loan or not.
# # Problem Definition
# How do we build a model that will help the marketing department to identify the potential customers who have a higher probability of purchasing the loan. How do we evaluate the performance of such a model... |
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
# импортируем библиотеки для визуализации
import matplotlib.pyplot as plt
import seaborn as sns
# Загружаем специальный удобный инструмент для разделения датасета:
from sklearn.model_selection import train_tes... |
# Here I present some simple data analysis and a sample submission.
# The question uploaded to Kaggle with very similar to test case `d` in the qualifiers.
# You can refer to discussion on how to solve `d` on Codeforces - https://codeforces.com/blog/entry/88188
import collections
import random
import numpy as np
import... |
# # TV Shows and Movies listed on Netflix
# This dataset consists of tv shows and movies available on Netflix as of 2019. The dataset is collected from Flixable which is a third-party Netflix search engine.
# In 2018, they released an interesting report which shows that the number of TV shows on Netflix has nearly trip... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.