All Projects → JMistral → Musicbox

JMistral / Musicbox

Projects that are alternatives of or similar to Musicbox

Voice emotion
Detecting emotion in voices
Stars: ✭ 33 (+0%)
Mutual labels:  jupyter-notebook
Natural Language Processing
Resources for "Natural Language Processing" Coursera course.
Stars: ✭ 969 (+2836.36%)
Mutual labels:  jupyter-notebook
Prediciting Binary Options
Predicting forex binary options using time series data and machine learning
Stars: ✭ 33 (+0%)
Mutual labels:  jupyter-notebook
Simple Ssd For Beginners
This repository contains easy SSD(Single Shot MultiBox Detector) implemented with Pytorch and is easy to read and learn
Stars: ✭ 33 (+0%)
Mutual labels:  jupyter-notebook
Geemap
A Python package for interactive mapping with Google Earth Engine, ipyleaflet, and folium
Stars: ✭ 959 (+2806.06%)
Mutual labels:  jupyter-notebook
Sanet Keras
Implement SANet for crowd counting in Keras.
Stars: ✭ 33 (+0%)
Mutual labels:  jupyter-notebook
Pm Pyro
PyMC3-like Interface for Pyro
Stars: ✭ 33 (+0%)
Mutual labels:  jupyter-notebook
Hse Nlp Coursera
Solution for https://www.coursera.org/learn/language-processing
Stars: ✭ 33 (+0%)
Mutual labels:  jupyter-notebook
Aws Deepracer Workshops
DeepRacer workshop content
Stars: ✭ 968 (+2833.33%)
Mutual labels:  jupyter-notebook
Interviewqs.com code snippets
Stars: ✭ 33 (+0%)
Mutual labels:  jupyter-notebook
Pytorch Softplus Normalization Uncertainty Estimation Bayesian Cnn
PyTorch code for Paper "Uncertainty Estimations by Softplus normalization in Bayesian Convolutional Neural Networks with Variational Inference"
Stars: ✭ 33 (+0%)
Mutual labels:  jupyter-notebook
Multi Label
Pytorch code for multi-Instance multi-label problem
Stars: ✭ 33 (+0%)
Mutual labels:  jupyter-notebook
Foltr Es
The source code to reproduce the results reported in the 'Federated Online Learning to Rank with Evolution Strategies' paper, published at WSDM 2019.
Stars: ✭ 33 (+0%)
Mutual labels:  jupyter-notebook
Numerical methods youtube
Stars: ✭ 32 (-3.03%)
Mutual labels:  jupyter-notebook
Cgm Ml
Child Growth Monitor Machine Learning
Stars: ✭ 33 (+0%)
Mutual labels:  jupyter-notebook
Attentive Neural Processes
implementing "recurrent attentive neural processes" to forecast power usage (w. LSTM baseline, MCDropout)
Stars: ✭ 33 (+0%)
Mutual labels:  jupyter-notebook
Multitask Learning
MSc group project: Reproduction of 'Multi-Task Learning using Uncertainty to Weigh Losses for Scene Geometry and Semantics'; A. Kendall, Y. Gal, R. Cipolla
Stars: ✭ 33 (+0%)
Mutual labels:  jupyter-notebook
Retainvis
An implementation of RetainVis: Visual Analytics with Interpretable and Interactive Recurrent Neural Networks on Electronic Medical Records
Stars: ✭ 33 (+0%)
Mutual labels:  jupyter-notebook
Stats and probability
Tutorial on stats and probability
Stars: ✭ 33 (+0%)
Mutual labels:  jupyter-notebook
Vizwiz Vqa Pytorch
PyTorch VQA implementation that achieved top performances in the (ECCV18) VizWiz Grand Challenge: Answering Visual Questions from Blind People
Stars: ✭ 33 (+0%)
Mutual labels:  jupyter-notebook

MusicBox

Step 1. Installing Spark

Source: https://medium.com/@GalarnykMichael/install-spark-on-mac-pyspark-453f395f240b

Step 2. Loading Raw Data with PySpark DataFrame

I have to say that spark dataframe is way less handy than pandas.dataframe for me. Anyway, to avoid some malformated lines, I have to use filter function on RDD first and then transform RDD to DataFrame

from pyspark.sql.types import *

def parseLine(line):
    fields = line.split('\t')
    if len(fields) == 10:
        try:
            uid = float(fields[0])
            device = str(fields[1])
            song_id = str(fields[2])
            song_type = float(fields[3])
            song_name = str(fields[4])
            singer = str(fields[5])
            play_time = str(fields[6])
            song_length = float(fields[7])
            paid_flag = float(fields[8])
            fn = str(fields[9])
            return Row(uid, device, song_id, song_type, song_name, singer, play_time, song_length, paid_flag, fn)
        except:
            return Row(None)
    else:
        return Row(None)


schema = StructType([StructField('uid', FloatType(), False),
                     StructField('device', StringType(), True),
                     StructField('song_id', StringType(), False),
                     StructField('song_type', FloatType(), True),
                     StructField('song_name', StringType(), True),
                     StructField('singer', StringType(), True),
                     StructField('play_time', StringType(), False),
                     StructField('song_length', FloatType(), True),
                     StructField('paid_flag', FloatType(), True),
                     StructField('fn', StringType(), True),])
songs = lines.map(parseLine).filter(lambda x: len(x) == len(schema))
# Convert that to a DataFrame
songDataset = spark.createDataFrame(songs,schema).cache()
songDataset.show()

Here is the result:

+------------+------+---------+---------+--------------------+--------------------+---------+-----------+---------+------------------+ | uid|device| song_id|song_type| song_name| singer|play_time|song_length|paid_flag| fn| +------------+------+---------+---------+--------------------+--------------------+---------+-----------+---------+------------------+ |1.54422688E8| ar |20870993 | 1.0| 用情 | 狮子合唱团 | 22013 | 332.0| 0.0| 20170301_play.log| |1.54421904E8| ip | 6560858 | 0.0| 表情不要悲伤 | 伯贤&D.O.&张艺兴&朴灿烈 | 96 | 161.0| 0.0| 20170301_play.log| |1.54422624E8| ar | 3385963 | 1.0|Baby, Don't Cry(人...| EXO | 235868 | 235.0| 0.0| 20170301_play.log| |1.54410272E8| ar | 6777172 | 0.0| 3D-环绕音律1(3D Mix) | McTaiM | 164 | 237.0| 0.0| 20170301_play.log| |1.54407792E8| ar |19472465 | 0.0| 刚好遇见你 | 曲肖冰 | 24 | 201.0| 0.0| 20170301_play.log| |1.54422624E8| ar | 3198036 | 1.0| 只唱给你听 | SpeXial | 275249 | 0.0| 0.0| 20170301_play.log| |1.54422688E8| ar | 891952 | 0.0| 老男孩-(电影《老男孩》主题曲) | 筷子兄弟 | 300 | 300.0| 0.0| 20170301_play.log| +------------+------+---------+---------+--------------------+--------------------+---------+-----------+---------+------------------+

Check some statistics of the data:

songDataset.describe().show()

+-------+--------------------+---------+--------------------+-------------------+---------+--------------------+-------------------+------------------+---------+--------------------+ |summary| uid| device| song_id| song_type|song_name| singer| play_time| song_length|paid_flag| fn| +-------+--------------------+---------+--------------------+-------------------+---------+--------------------+-------------------+------------------+---------+--------------------+ | count| 164264529|164264529| 164264529| 164264529|164264529| 164264529| 164264529| 164264529|164264529| 164264529| | mean|1.3238275802376163E8| null|1.233773654943951...|0.14990355586749954| Infinity|2.069222247928341...| 204343.58310764717|-66.93764578220485| 0.0| null| | stddev|6.4977108791913636E7| null|3.724137957677398...| 0.3858627542831314| NaN|1.842783835874818...|5.244159580504907E8|1066716.9038908319| 0.0| null| | min| 0.0| | | 0.0| | | | -2.14748365E9| 0.0| 20170301_play.log| | max| 1.6926232E8| wp| 9999985| 3.0| 🙄| 😝😝😝😝😝| nan | 1.34396621E9| 0.0| 20170512_3_play.log| +-------+--------------------+---------+--------------------+-------------------+---------+--------------------+-------------------+------------------+---------+--------------------+

songDataset.groupBy('uid').count().orderBy('count', ascending = False).show(truncate=False)

+------------+-------+ |uid |count | +------------+-------+ |1685126.0 |8124398| |3.7025504E7 |5903930| |751824.0 |4554232| |1791497.0 |3376118| |497685.0 |3031361| |1062806.0 |2354592| |736305.0 |1848836| |0.0 |1201159| |1749320.0 |835164 | |4.6532272E7 |500025 | |1679121.0 |488577 | |2.8638488E7 |469655 | |637650.0 |243074 | |1.5594824E8 |217992 | |533817.0 |173401 | |3.2166204E7 |156643 | |6.4268008E7 |150171 | |2.6036032E7 |114145 | |3.2104144E7 |99175 | |1.67982848E8|82687 | +------------+-------+ only showing top 20 rows

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].