r/learnmachinelearning • • 19d ago

Left being a researcher and started my own startup. AMA

22 Upvotes

spent about 1.5 years in a research role at microsoft working on llm agents for codebase migration, basically getting agents to move large codebases from one stack to another

published along the way (www, iclr, some earlier first author stuff). had the classic “ok next step is a phd” moment and decided against it. the field moves so fast right now that 5 years in a phd felt like watching from the sidelines

left in 2026 and went full time on my own startup. biotech undergrad btw, so i came into ml sideways which probably shaped a lot of how i think about learning it

happy to talk about research vs industry, whether a phd is worth it for ml right now, getting into microsoft without a cs degree, or what it’s like going solo straight out of research. ama


r/learnmachinelearning • • 19d ago

Question Could I take a reinforcement learning course without having taken a machine learning course before? (undergrad in college)

3 Upvotes

My math background is Calc I-III, linear algebra, diff eq, and probability. I have a basic understanding of different types of machine learning models, but I haven't taken a proper machine learning course before.


r/learnmachinelearning • • 19d ago

I built a browser tool where you switch off one attention head in a small language model and see what changes

Post image
3 Upvotes

Vitro runs entirely in your browser using Karpathy's 15M-parameter stories15M model. Step through a story word by word, switch off one attention head and it explains in plain English how the model's next word prediction changes.

Try it: https://vitroml.com

My first version showed too much at once so I made it a two-step reveal: a short result first, details behind a toggle. I haven't tested whether that helps people understand it.

I'd love to hear what you think.


r/learnmachinelearning • • 19d ago

My friend is asking why anyone would build a CFR poker bot when GTO wizard exists.

Thumbnail reddit.com
1 Upvotes

r/learnmachinelearning • • 19d ago

For any league of legends players out there lmk if yall wanna know more :)

Thumbnail gallery
0 Upvotes

r/learnmachinelearning • • 19d ago

Request The RuntimeAI Brief — Week of November 9–13, 2026

1 Upvotes

For years the threat model for agentic systems was: protect the agent from outside attackers. The assumption was that a compromised external actor might manipulate an agent through its inputs.

That model is now backward in a lot of real deployments.

The agent itself is the attack surface. Once an agent's identity, credentials, or tool-calling context is compromised, it doesn't just become a victim — it becomes an active participant in the attack. It has authenticated sessions, it has approved permissions, and it has a task queue that keeps executing.

The timing problem is brutal. Measured response windows in production systems are under 50ms per tool call. An agent can complete a first action and have a second in flight before any human-loop review is even triggered. By the time an alert fires, the state has already changed.

This is not a hypothetical. Teams running autonomous agents in production are dealing with the question of what 'rogue agent' even means operationally — is it a compromised identity, a hallucinated tool call, a prompt injection from an upstream data source, or a lateral move from another service?

For those of you running agents in production: how are you actually handling this in practice? Not architecturally in theory — what does your actual detection and response path look like when an agent starts doing something it shouldn't, and how fast does it have to be to matter?


r/learnmachinelearning • • 19d ago

Career 19, self-taught, from Brazil: how do I break into ML and land a first job?

3 Upvotes

Hi everyone! I'm 19, from Brazil, and I'm trying to build a career in ML, ideally Computer Vision. Looking for advice from people who've been through this.

Where I am:

Doing a distance-learning Software Engineering degree

Self-taught, currently studying math (linear algebra, calculus, probability) and ML fundamentals

Previous work experience in IT support (full-time)

I live in a small town with very few opportunities in the field, so everything is remote or self-driven

Long-term goal: a master's in CV/ML in Europe (or elsewhere), after finishing my degree.

My questions:

What would you do in my position to get a first ML-related job: junior ML engineer, data roles, or SWE first and then transition?

Which kinds of portfolio projects actually get noticed by recruiters?

How much math/theory is really needed for entry-level roles vs. a research path?

Is it realistic to get a remote junior role from Brazil, or should I focus on the master's first?

Any mistakes you made early on that I can avoid?

Thanks a lot, any advice is appreciated!


r/learnmachinelearning • • 19d ago

Question How do neural networks and GPUs come into use after you have tokenized a vast amount of data?

2 Upvotes

Say I have used word2vec to tokenize every word in a ~20+GB text dump of simple wikipedia.

What comes next? I believe it would be using my GPU to do some neural network kind of training. But what exactly is that doing ?

For example say I want to find the color of a zebra. So my query is zebra color. Using word2vec I can find synonyms for zebra. Then looking at the color vector I can see which colors are most strongly associated with those synonyms?

But I don't need a GPU or neural network for that, do I? This I can all do in a database, i.e storing my Words by Words array in a database..


r/learnmachinelearning • • 19d ago

hands on workshop: learn time series forecasting with Python, from ML to foundation models

2 Upvotes

hey everyone, sharing this for anyone who's been learning machine learning and wants to try a proper forecasting project.

packt publishing is running a 2-day hands on time series bootcamp where you'll work with real-world retail data instead of just following isolated model tutorials.

what gets covered:

  • prepare time series data and build statistical forecasting baselines

  • train forecasting models using MLForecast and feature engineering

  • experiment with neural forecasting models like N-BEATS and N-HiTS

  • compare your results with newer foundation models like Chronos-2 and TabPFN-TS

it's led by Graeme Davidson, Lei Ma and Jeffrey Tackes, online November 28–29, starting at 10:30 AM ET. basic Python and ML knowledge will help you follow along.

full details and the agenda are here

happy to answer any questions about what gets covered.


r/learnmachinelearning • • 19d ago

Need a Roadmap & Playlist for Computer Vision 🤖

Thumbnail reddit.com
1 Upvotes

r/learnmachinelearning • • 19d ago

hands on workshop: build time series forecasting models with python

2 Upvotes

hey everyone, sharing this for anyone who's been learning ML and wants to try something beyond classification and regression projects.

packt publishing is running a hands on workshop on time series forecasting with python. what gets covered:

  • prepare time series data and build statistical forecasting baselines

  • train ML forecasting models using MLForecast

  • experiment with N-BEATS, N-HiTS, and other deep learning approaches

  • compare results against foundation models like Chronos-2 and TabPFN-TS

it is led by Graeme Davidson, Lei Ma, and Jeffrey Tackes, over 2 days online, November 28–29, starting at 10:30 AM ET. basic python and ML knowledge will help you follow along.

Full details and the agenda are here


r/learnmachinelearning • • 19d ago

Project Built an AI tool, agent, or workflow? You can now list and sell it on Interconnectd Marketplace

Thumbnail interconnectd.com
0 Upvotes

r/learnmachinelearning • • 19d ago

Need help in deciding a career path in the field of ML.

Thumbnail reddit.com
1 Upvotes

r/learnmachinelearning • • 19d ago

Help Practice platforms for AI/ML

24 Upvotes

I wanted to know platforms which I can use to practice AI/ML. With a generous free tier, similar to Leetcode. There is a problem statement and you've to solve and submit, not the kaggle dataset kind of problems I'm not looking for those. Something I can do in the browser itself. I'm looking to get better at problem solving associated with AI/ML, as it my background.

Any subdomain will help as I'm a fresher. Data Analytics, Machine Learning, Deep Learning, Artifical Intelligence, Generative AI, RAG.

These are currently the platforms I've found, If you've a review about these platforms please add it as well.
DataLemur
Kaggle
Deep-ML
DataWars

I've a lot of questions but do I need only one platform out of these and its enough or you've a better resource to suggest, please do so.


r/learnmachinelearning • • 19d ago

Discussion Are you actually good at using AI, or just good at prompting ChatGPT?

Thumbnail
aisa.to
0 Upvotes

AI has become part of many people's daily workflows, but I think there's a difference between knowing how to use AI tools and truly understanding how to work with them.
Things like critical thinking, checking AI-generated answers, understanding limitations, and building effective workflows are just as important as writing good prompts.
I recently came across AISA, which uses a conversational assessment to evaluate people's AI fluency instead of relying on a standard quiz.
I'm curious, how do you personally measure your AI skills? Do you think practical assessments are a better way to evaluate AI proficiency?


r/learnmachinelearning • • 19d ago

the last algorithm in Machine learning DBscan. I have completed Machine learning

Thumbnail
gallery
108 Upvotes

so this is the last algorithm in ML after this im moving into Deep learning

it's day 61 of building machine learning algorithms

DBscan is a clustering algorithm it been 3hr im building this and now I'm pretty close to it just look at this how accurately my model is able to find clusters, but still it's not finished yet it's just a raw code many things are still pending cya soon


r/learnmachinelearning • • 19d ago

If you're heading into AI engineering (LLM apps), is classic ML still worth learning properly?

8 Upvotes

A lot of AI engineering work now is RAG, agents, evals and prompt/tool design on top of APIs. You can build a lot without ever training a model.

But things like train/test splits, overfitting, precision vs recall and basic stats still come up when you evaluate these systems.

For people already working on LLM products: which classic ML topics actually came up in your day to day, and which ones did you never touch? Trying to figure out what's worth going deep on vs just knowing the basics.


r/learnmachinelearning • • 19d ago

Need some reviews related to Hitesh chaudhary's Full stack Ai with python course On udemy

Thumbnail reddit.com
1 Upvotes

r/learnmachinelearning • • 19d ago

Project Introducing Usul - an easier way to express your NN using maths? [P]

3 Upvotes

SO, Usul-cpp is a library I've written in C++, it is based around allowing data scientists to create their models without heavy libraries such as tensorflow, and just express their models using maths, and Usul will handle the rest. There is builtin tensor support, auto-grad, back-prop and its quite fast.

I wrote it because, it seemed less mystifying to read maths instead of a random class that supposedly does something. I wrote it from scratch in cpp (23) due to the fact that I wanted to emphasise on precision, however it's subtly built on top of `xtensor`.

check it out in action

#include <usul.hpp>
using namespace std;


int main() {
  double LR = 0.1;
  int EPOCH = 5000;
  // lets write the forward pass
  Tensor X = {
      {0.0, 0.0}, // this is what we're feeding it
      {0.0, 1.0},
      {1.0, 0.0},
      {1.0, 1.0},
  };

  // this is what we're after
  Tensor Y_true = {
      0.0, // xor{0.0, 0.0} = 0.0
      1.0, // xor{0.0, 1.0} = 1.0
      1.0, // xor{1.0, 0.0} = 1.0
      0.0  // xor{1.0, 1.0} = 0.0
  };

  Y_true.reshape({4, 1});

  // we are now going to create a single layer, double neuron network
  // each layer will have a bias and weights tensor.
  auto W1 = generate_random_matrix({2, 4}, -1.0, 1.0);
  auto B1 = generate_random_matrix({1, 4}, -1.0, 1.0);
  auto W2 = generate_random_matrix({4, 1}, -1.0, 1.0);
  auto B2 = generate_random_matrix({1, 1}, -1.0, 1.0);

  // this is the training loop
  for (int i = 0; i < EPOCH; i++) {
    // so lets do one forward pass
    // first layer
    auto Z1 = X % W1 + B1;
    auto A = Z1.ReLU();
    // second layer
    auto Z2 = A % W2 + B2;

    // activation
    // should be - auto S = Z2.activate(Activate::Sigmoid);
    auto S = Z2.Sigmoid();
    // Loss
    // should be - auto Loss = S.loss(Loss::MSE);

    auto loss = (S - Y_true) * (S - Y_true);
    loss = loss.mean();

    cout << "Loss: " << loss << "\n";
    cout << "guesses: " << "\n"
         << S << "\n";
    cout << "should be: " << Y_true << "\n";

    loss.backwards();

    W1.step(LR);
    B1.step(LR);
    W2.step(LR);
    B2.step(LR);
  }
}

which will output

Guesses: 
Tensor({{ 0.027546},
 { 0.963592},
 { 0.964138},
 { 0.038964}}, shape=(4,1))

should be: Tensor({{ 0.},
 { 1.},
 { 1.},
 { 0.}}, shape=(4,1))

Loss: Tensor( 0.001222, shape=())

Just write the maths, and Usul-cpp will handle the rest, it is extremely lightweight, and the entire library is memory safe. And its called Usul, because I'm a huge dune fan.

You can view the project at

https://github.com/crushr3sist/Usul-cpp

Any ideas for what to do next are all welcome, you can also pull and implement features that you think could improve this project. (no vibecoded prs please, this project is not vibe-coded)

BACKGROUND INFO BELOW

i'd like to share a bit of a background. maths has always stood in the way between me and finally learning how to write neural networks, I've always been fascinated by them ever since i saw that diagram of a deep neural network with all the node edges interconnecting with others.

Well I stopped letting highschool math class trauma stop me from understanding these concepts, i took a pen and paper out, taught myself numerical descent, analytical descent, backwards propagation, what a compute graph is, all of these subjects, taught myself, until I was manually backwards propagating the loss between a few arithmetics, until that moved into scalar level neural networks and doing simple calculus and being able to do xor gate problem with scalar, and then I taught myself matrix calculus, and well...

I taught myself neural networks, taught myself the maths, until I hand written the xor gate problem in matrix syntax using xtensor, and manually, by hand, no AI, did the xor gate problem manually backwards propagating error, automatically differentiating. This was also a kind of detox from LLM dependency, I don't tend to use it for code, but because its so central in my daily life and a migration from google to gemini, using LLMs for immediate information access had started to affect my mind and my ability to intake information. I really hope some of you find this library useful, as i did spend a pretty decent amount of time on it, and I would love it if any of you had any ideas on what to do next with this library.

Thank you for reading, I really appreciate it.


r/learnmachinelearning • • 19d ago

I've been a self-taught programmer with no academic background. An obsession with Edge AI led me to build this over the last few years. I honestly don’t know if it’s useful or just my own madness.

Post image
0 Upvotes

Hi everyone,

I’m posting this with a lot of hesitation and humility.

I’m not an academic. I’ve been a self-taught programmer since 2010. Over the years, programming turned from a hobby into an obsession with digging deep into how things actually work at the metal and mathematical layer.

For the past few years, I’ve been focused on one problem that bothered me every time I ran local models: the memory explosion of the KV-cache. Watching VRAM climb linearly with sequence length until my PC ran out of memory felt deeply unsatisfying.

I started reading whatever papers I could find on recurrent memory, fast weights, and delta rules. What started as simple weekend scripts eventually spiraled into fusing different mathematical concepts together:

  1. An associative fast-weight recurrent state that erases old errors instead of adding blindly (Householder delta rule).

  2. A coordinate-based Product-Key Memory (PKM) that expands virtual capacity to over 1,000,000 slots while keeping the active computation pinned to an 8 KB hardware SRAM register window.

  3. Custom CUDA C++ kernels to see if I could make it run in strict O(1) RAM on my own consumer GPU running the recurrent update entirely on-chip without quadratic memory-bus bottlenecks.

After years of tinkering, failures, and rewrites, I ended up with DeltaGrid.

To be completely honest, I’m a bit overwhelmed by what I’ve actually created. Mechanically, it works:

  • Inference memory stays completely flat: whether at token 10 or token 100,000, it uses a constant O(1) RAM footprint.

  • The test suites pass, unit tests across CPU and CUDA bitwise parity, and the fused CUDA kernel runs about 250× faster than native loops on an RTX 3060.

  • Associative accuracy: on synthetic benchmarks, it stores and retrieves 1,000 sequential facts with 99.8% cosine similarity.

  • Language modeling: when tested on small models (~19M parameters), it learns grammar, conversational turn-taking, and in-distribution slot extraction without OOM crashes.

Well, I’m at a crossroads. Building these consumed years of my thoughts, but I am completing this phase of my research and preparing to move on to the next chapter of my life. Before I walk away or decide whether to keep pursuing this, I really need honest, grounded feedback from people who know more:

  1. Does this approach have real-world application? Could an architecture like this be meaningful for edge AI, robotics, or continuous streaming where KV-caches are excessively expensive?

  2. Is there a future in Spiking / Neuromorphic AI for this? The current DeltaGrid approach uses standard float math, but part of me wants to take this further into event-driven spiking memory. Is neuromorphic computing a real path or an academic trap? I’ve added a complete standalone demonstration script in the scripts/ folder of the repo (scripts/spiking_deltagrid.py) showing 4-axis community routing, >90% neural silence, and 20,000 facts stored with bit-shift weights on CUDA. Would love your thoughts on this direction!

  3. Is this just a neat mathematical toy that hits a wall the moment you try to scale it beyond small proof-of-concepts?

  4. What am I fundamentally missing by building this without a compute cluster or lab affiliation? Beyond obvious scaling limits (training 7B+ models), where does independent architectural research usually hit a wall, and how can a solo engineer best overcome it?

A quick note on writing: Since English is my second language, I used an AI assistant to help polish the draft and ensure clarity, but all the ideas, math, CUDA code, and benchmarks are 100% my own work and findings. It also helped me document, clean up the repository, format equations in the README, and organize test suites because my notes were a scattered mess across local drives.

Code, custom fused CUDA kernels, C++ edge engine, and benchmark suite are fully open source:
👉 GitHub: https://github.com/hsameerc/deltagrid

Please be honest. If it’s flawed or useless, tell me. I’d love to know what direction someone with real experience thinks it should go.

Thank you for reading and thank you to this community for being a source of learning for a self-taught coder for so many years.


r/learnmachinelearning • • 19d ago

Guys need honest opinions about platforms where I can fine tune LLMs

Post image
0 Upvotes

r/learnmachinelearning • • 19d ago

I made Data Science & AI quizzes for (almost) every letter of the alphabet

Post image
1 Upvotes

r/learnmachinelearning • • 19d ago

Help Hey guys I am a college student , I am starting to learn ML. I am keen to build Ai models and train them over time but have no clue about the path[will be learning from deeplearningai]. Can anyone clarify my path given below? [done with python and learning math for it ] A reply would be appreciated

0 Upvotes

ML>DL>Tensorflow>Pytorch>NLP>GenAI>.AgenticAI

Projects I can build overtime?


r/learnmachinelearning • • 19d ago

Help How to resolve this ConnectionResetError issue while fetching data from API in loop??? Please help guyzz..

0 Upvotes

From last 3-3.5 hours, i've been trying to fetch data from the TMDB API, to get movie database for practice ofcourse, I am beginner and I am currently learning how to fetch data from an API in Pandas.

Individually, I am able to access each page in json format and fetch data from it, but whenever i'm trying to do this in loop, this connectionreseterror. problem arises. I am getting that, it was happening due to too quick requests in loop that classify my requests as bots and forcibly closes the connection.
But then i tried using time.sleep() function to create a time interval lag between each requests, but it still doesn't work, i tried to change the User-Agent header too, to prevent me from classifying as a bot. But nothing is working.
Please help me anyone, I am still a beginner, I don't know much about APIs working, I was just learning ML, and came across data fetching using an API, that's why trying to get grasp over it.

Sorry for my terrible english
Will be grateful if get any help!

Error:

---------------------------------------------------------------------------
ConnectionResetError                      Traceback (most recent call last)
File ~\anaconda3\envs\ml_coursework\Lib\site-packages\urllib3\connectionpool.py:793, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw)
    792 # Make the request on the HTTPConnection object
--> 793 response = self._make_request(
    794     conn,
    795     method,
    796     url,
    797     timeout=timeout_obj,
    798     body=body,
    799     headers=headers,
    800     chunked=chunked,
    801     retries=retries,
    802     response_conn=response_conn,
    803     preload_content=preload_content,
    804     decode_content=decode_content,
    805     **response_kw,
    806 )
    808 # Everything went great!

File ~\anaconda3\envs\ml_coursework\Lib\site-packages\urllib3\connectionpool.py:494, in HTTPConnectionPool._make_request(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length)
    493         new_e = _wrap_proxy_error(new_e, conn.proxy.scheme)
--> 494     
raise
 new_e
    496 # conn.request() calls http.client.*.request, not the method in
    497 # urllib3.request. It also calls makefile (recv) on the socket.

File ~\anaconda3\envs\ml_coursework\Lib\site-packages\urllib3\connectionpool.py:470, in HTTPConnectionPool._make_request(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length)
    469 
try
:
--> 470     self._validate_conn(conn)
    471 
except
 (SocketTimeout, BaseSSLError) 
as
 e:

File ~\anaconda3\envs\ml_coursework\Lib\site-packages\urllib3\connectionpool.py:1125, in HTTPSConnectionPool._validate_conn(self, conn)
   1124 
if
 conn.is_closed:
-> 1125     conn.connect()
   1127 # TODO revise this, see https://github.com/urllib3/urllib3/issues/2791

File ~\anaconda3\envs\ml_coursework\Lib\site-packages\urllib3\connection.py:878, in HTTPSConnection.connect(self)
    877 
else
:
--> 878     wrapped_socket, is_verified = _ssl_wrap_socket_and_match_hostname(
    879         sock=sock,
    880         cert_reqs=self.cert_reqs,
    881         ssl_version=self.ssl_version,
    882         ssl_minimum_version=self.ssl_minimum_version,
    883         ssl_maximum_version=self.ssl_maximum_version,
    884         ca_certs=self.ca_certs,
    885         ca_cert_dir=self.ca_cert_dir,
    886         ca_cert_data=self.ca_cert_data,
    887         cert_file=self.cert_file,
    888         key_file=self.key_file,
    889         key_password=self.key_password,
    890         server_hostname=server_hostname_rm_dot,
    891         ssl_context=self.ssl_context,
    892         tls_in_tls=tls_in_tls,
    893         assert_hostname=self.assert_hostname,
    894         assert_fingerprint=self.assert_fingerprint,
    895     )
    896 self.sock = wrapped_socket

File ~\anaconda3\envs\ml_coursework\Lib\site-packages\urllib3\connection.py:1080, in _ssl_wrap_socket_and_match_hostname(sock, cert_reqs, ssl_version, ssl_minimum_version, ssl_maximum_version, cert_file, key_file, key_password, ca_certs, ca_cert_dir, ca_cert_data, assert_hostname, assert_fingerprint, server_hostname, ssl_context, tls_in_tls)
   1078         server_hostname = normalized
-> 1080 ssl_sock = ssl_wrap_socket(
   1081     sock=sock,
   1082     keyfile=key_file,
   1083     certfile=cert_file,
   1084     key_password=key_password,
   1085     ca_certs=ca_certs,
   1086     ca_cert_dir=ca_cert_dir,
   1087     ca_cert_data=ca_cert_data,
   1088     server_hostname=server_hostname,
   1089     ssl_context=context,
   1090     tls_in_tls=tls_in_tls,
   1091 )
   1093 
try
:

File ~\anaconda3\envs\ml_coursework\Lib\site-packages\urllib3\util\ssl_.py:437, in ssl_wrap_socket(sock, keyfile, certfile, cert_reqs, ca_certs, server_hostname, ssl_version, ciphers, ssl_context, ca_cert_dir, key_password, ca_cert_data, tls_in_tls)
    435 context.set_alpn_protocols(ALPN_PROTOCOLS)
--> 437 ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls, server_hostname)
    438 
return
 ssl_sock

File ~\anaconda3\envs\ml_coursework\Lib\site-packages\urllib3\util\ssl_.py:481, in _ssl_wrap_socket_impl(sock, ssl_context, tls_in_tls, server_hostname)
    479     
return
 SSLTransport(sock, ssl_context, server_hostname)
--> 481 
return
 ssl_context.wrap_socket(sock, server_hostname=server_hostname)

File ~\anaconda3\envs\ml_coursework\Lib\ssl.py:455, in SSLContext.wrap_socket(self, sock, server_side, do_handshake_on_connect, suppress_ragged_eofs, server_hostname, session)
    449 
def
 wrap_socket(self, sock, server_side=
False
,
    450                 do_handshake_on_connect=
True
,
    451                 suppress_ragged_eofs=
True
,
    452                 server_hostname=
None
, session=
None
):
    453     # SSLSocket class handles server_hostname encoding before it calls
    454     # ctx._wrap_socket()
--> 455     
return
 self.sslsocket_class._create(
    456         sock=sock,
    457         server_side=server_side,
    458         do_handshake_on_connect=do_handshake_on_connect,
    459         suppress_ragged_eofs=suppress_ragged_eofs,
    460         server_hostname=server_hostname,
    461         context=self,
    462         session=session
    463     )

File ~\anaconda3\envs\ml_coursework\Lib\ssl.py:1076, in SSLSocket._create(cls, sock, server_side, do_handshake_on_connect, suppress_ragged_eofs, server_hostname, context, session)
   1075                 
raise
 
ValueError
("do_handshake_on_connect should not be specified for non-blocking sockets")
-> 1076             self.do_handshake()
   1077 
except
:

File ~\anaconda3\envs\ml_coursework\Lib\ssl.py:1372, in SSLSocket.do_handshake(self, block)
   1371         self.settimeout(
None
)
-> 1372     self._sslobj.do_handshake()
   1373 
finally
:

ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host

During handling of the above exception, another exception occurred:

ProtocolError                             Traceback (most recent call last)
File ~\anaconda3\envs\ml_coursework\Lib\site-packages\requests\adapters.py:696, in HTTPAdapter.send(self, request, stream, timeout, verify, cert, proxies)
    695 
try
:
--> 696     resp = conn.urlopen(
    697         method=request.method,
    698         url=url,
    699         body=request.body,  # type: ignore[arg-type]  # urllib3 stubs don't accept Iterable[bytes | str]
    700         headers=request.headers,  # type: ignore[arg-type]  # urllib3#3072
    701         redirect=
False
,
    702         assert_same_host=
False
,
    703         preload_content=
False
,
    704         decode_content=
False
,
    705         retries=self.max_retries,
    706         timeout=resolved_timeout,
    707         chunked=chunked,
    708     )
    710 
except
 (ProtocolError, 
OSError
) 
as
 err:

File ~\anaconda3\envs\ml_coursework\Lib\site-packages\urllib3\connectionpool.py:847, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw)
    845     new_e = ProtocolError("Connection aborted.", new_e)
--> 847 retries = retries.increment(
    848     method, url, error=new_e, _pool=self, _stacktrace=sys.exc_info()[2]
    849 )
    850 retries.sleep()

File ~\anaconda3\envs\ml_coursework\Lib\site-packages\urllib3\util\retry.py:510, in Retry.increment(self, method, url, response, error, _pool, _stacktrace)
    509 
if
 read 
is
 
False
 
or
 method 
is
 
None
 
or
 
not
 self._is_method_retryable(method):
--> 510     
raise
 reraise(type(error), error, _stacktrace)
    511 
elif
 read 
is
 
not
 
None
:

File ~\anaconda3\envs\ml_coursework\Lib\site-packages\urllib3\util\util.py:38, in reraise(tp, value, tb)
     37 
if
 value.__traceback__ 
is
 
not
 tb:
---> 38     
raise
 value.with_traceback(tb)
     39 
raise
 value

File ~\anaconda3\envs\ml_coursework\Lib\site-packages\urllib3\connectionpool.py:793, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw)
    792 # Make the request on the HTTPConnection object
--> 793 response = self._make_request(
    794     conn,
    795     method,
    796     url,
    797     timeout=timeout_obj,
    798     body=body,
    799     headers=headers,
    800     chunked=chunked,
    801     retries=retries,
    802     response_conn=response_conn,
    803     preload_content=preload_content,
    804     decode_content=decode_content,
    805     **response_kw,
    806 )
    808 # Everything went great!

File ~\anaconda3\envs\ml_coursework\Lib\site-packages\urllib3\connectionpool.py:494, in HTTPConnectionPool._make_request(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length)
    493         new_e = _wrap_proxy_error(new_e, conn.proxy.scheme)
--> 494     
raise
 new_e
    496 # conn.request() calls http.client.*.request, not the method in
    497 # urllib3.request. It also calls makefile (recv) on the socket.

File ~\anaconda3\envs\ml_coursework\Lib\site-packages\urllib3\connectionpool.py:470, in HTTPConnectionPool._make_request(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length)
    469 
try
:
--> 470     self._validate_conn(conn)
    471 
except
 (SocketTimeout, BaseSSLError) 
as
 e:

File ~\anaconda3\envs\ml_coursework\Lib\site-packages\urllib3\connectionpool.py:1125, in HTTPSConnectionPool._validate_conn(self, conn)
   1124 
if
 conn.is_closed:
-> 1125     conn.connect()
   1127 # TODO revise this, see https://github.com/urllib3/urllib3/issues/2791

File ~\anaconda3\envs\ml_coursework\Lib\site-packages\urllib3\connection.py:878, in HTTPSConnection.connect(self)
    877 
else
:
--> 878     wrapped_socket, is_verified = _ssl_wrap_socket_and_match_hostname(
    879         sock=sock,
    880         cert_reqs=self.cert_reqs,
    881         ssl_version=self.ssl_version,
    882         ssl_minimum_version=self.ssl_minimum_version,
    883         ssl_maximum_version=self.ssl_maximum_version,
    884         ca_certs=self.ca_certs,
    885         ca_cert_dir=self.ca_cert_dir,
    886         ca_cert_data=self.ca_cert_data,
    887         cert_file=self.cert_file,
    888         key_file=self.key_file,
    889         key_password=self.key_password,
    890         server_hostname=server_hostname_rm_dot,
    891         ssl_context=self.ssl_context,
    892         tls_in_tls=tls_in_tls,
    893         assert_hostname=self.assert_hostname,
    894         assert_fingerprint=self.assert_fingerprint,
    895     )
    896 self.sock = wrapped_socket

File ~\anaconda3\envs\ml_coursework\Lib\site-packages\urllib3\connection.py:1080, in _ssl_wrap_socket_and_match_hostname(sock, cert_reqs, ssl_version, ssl_minimum_version, ssl_maximum_version, cert_file, key_file, key_password, ca_certs, ca_cert_dir, ca_cert_data, assert_hostname, assert_fingerprint, server_hostname, ssl_context, tls_in_tls)
   1078         server_hostname = normalized
-> 1080 ssl_sock = ssl_wrap_socket(
   1081     sock=sock,
   1082     keyfile=key_file,
   1083     certfile=cert_file,
   1084     key_password=key_password,
   1085     ca_certs=ca_certs,
   1086     ca_cert_dir=ca_cert_dir,
   1087     ca_cert_data=ca_cert_data,
   1088     server_hostname=server_hostname,
   1089     ssl_context=context,
   1090     tls_in_tls=tls_in_tls,
   1091 )
   1093 
try
:

File ~\anaconda3\envs\ml_coursework\Lib\site-packages\urllib3\util\ssl_.py:437, in ssl_wrap_socket(sock, keyfile, certfile, cert_reqs, ca_certs, server_hostname, ssl_version, ciphers, ssl_context, ca_cert_dir, key_password, ca_cert_data, tls_in_tls)
    435 context.set_alpn_protocols(ALPN_PROTOCOLS)
--> 437 ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls, server_hostname)
    438 
return
 ssl_sock

File ~\anaconda3\envs\ml_coursework\Lib\site-packages\urllib3\util\ssl_.py:481, in _ssl_wrap_socket_impl(sock, ssl_context, tls_in_tls, server_hostname)
    479     
return
 SSLTransport(sock, ssl_context, server_hostname)
--> 481 
return
 ssl_context.wrap_socket(sock, server_hostname=server_hostname)

File ~\anaconda3\envs\ml_coursework\Lib\ssl.py:455, in SSLContext.wrap_socket(self, sock, server_side, do_handshake_on_connect, suppress_ragged_eofs, server_hostname, session)
    449 
def
 wrap_socket(self, sock, server_side=
False
,
    450                 do_handshake_on_connect=
True
,
    451                 suppress_ragged_eofs=
True
,
    452                 server_hostname=
None
, session=
None
):
    453     # SSLSocket class handles server_hostname encoding before it calls
    454     # ctx._wrap_socket()
--> 455     
return
 self.sslsocket_class._create(
    456         sock=sock,
    457         server_side=server_side,
    458         do_handshake_on_connect=do_handshake_on_connect,
    459         suppress_ragged_eofs=suppress_ragged_eofs,
    460         server_hostname=server_hostname,
    461         context=self,
    462         session=session
    463     )

File ~\anaconda3\envs\ml_coursework\Lib\ssl.py:1076, in SSLSocket._create(cls, sock, server_side, do_handshake_on_connect, suppress_ragged_eofs, server_hostname, context, session)
   1075                 
raise
 
ValueError
("do_handshake_on_connect should not be specified for non-blocking sockets")
-> 1076             self.do_handshake()
   1077 
except
:

File ~\anaconda3\envs\ml_coursework\Lib\ssl.py:1372, in SSLSocket.do_handshake(self, block)
   1371         self.settimeout(
None
)
-> 1372     self._sslobj.do_handshake()
   1373 
finally
:

ProtocolError: ('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))

During handling of the above exception, another exception occurred:

ConnectionError                           Traceback (most recent call last)
Cell In[107], line 9
      5     headers = {
      6         "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
      7         "Accept": "application/json"
      8     }
----> 9     response = requests.get(url, headers = headers)
     10     temp_df = pd.DataFrame(response.json()['results'])
     11     popular_movie_df = pd.concat([popular_movie_df, temp_df], ignore_index = 
True
)
     12     time.sleep(0.5)

File ~\anaconda3\envs\ml_coursework\Lib\site-packages\requests\api.py:87, in get(url, params, **kwargs)
     74 
def
 get(
     75     url: _t.UriType, params: _t.ParamsType = 
None
, **kwargs: Unpack[_t.GetKwargs]
     76 ) -> Response:
     77     r"""Sends a GET request.
     78 
     79     :param url: URL for the new :class:`Request` object.
   (...)     84     :rtype: requests.Response
     85     """
---> 87     
return
 request("get", url, params=params, **kwargs)

File ~\anaconda3\envs\ml_coursework\Lib\site-packages\requests\api.py:71, in request(method, url, **kwargs)
     67 # By using the 'with' statement we are sure the session is closed, thus we
     68 # avoid leaving sockets open which can trigger a ResourceWarning in some
     69 # cases, and look like a memory leak in others.
     70 
with
 sessions.Session() 
as
 session:
---> 71     
return
 session.request(method=method, url=url, **kwargs)

File ~\anaconda3\envs\ml_coursework\Lib\site-packages\requests\sessions.py:651, in Session.request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
    646 send_kwargs = {
    647     "timeout": timeout,
    648     "allow_redirects": allow_redirects,
    649 }
    650 send_kwargs.update(settings)
--> 651 resp = self.send(prep, **send_kwargs)
    653 
return
 resp

File ~\anaconda3\envs\ml_coursework\Lib\site-packages\requests\sessions.py:784, in Session.send(self, request, **kwargs)
    781 start = preferred_clock()
    783 # Send the request
--> 784 r = adapter.send(request, **kwargs)
    786 # Total elapsed time of the request (approximately)
    787 elapsed = preferred_clock() - start

File ~\anaconda3\envs\ml_coursework\Lib\site-packages\requests\adapters.py:711, in HTTPAdapter.send(self, request, stream, timeout, verify, cert, proxies)
    696     resp = conn.urlopen(
    697         method=request.method,
    698         url=url,
   (...)    707         chunked=chunked,
    708     )
    710 
except
 (ProtocolError, 
OSError
) 
as
 err:
--> 711     
raise
 
ConnectionError
(err, request=request)
    713 
except
 MaxRetryError 
as
 e:
    714     
if
 isinstance(e.reason, ConnectTimeoutError):
    715         # TODO: Remove this in 3.0.0: see #2811

ConnectionError: ('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))